2011-12-03 17:22:09 +00: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.
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include "dreamweb/dreamweb.h"
|
|
|
|
|
|
|
|
namespace DreamGen {
|
|
|
|
|
2011-12-18 15:20:17 +00:00
|
|
|
static void (DreamBase::*reelCallbacks[57])(ReelRoutine &) = {
|
2011-12-16 16:11:46 +00:00
|
|
|
&DreamBase::gamer, &DreamBase::sparkyDrip,
|
|
|
|
&DreamBase::eden, &DreamBase::edenInBath,
|
|
|
|
&DreamBase::sparky, &DreamBase::smokeBloke,
|
|
|
|
&DreamBase::manAsleep, &DreamBase::drunk,
|
|
|
|
&DreamBase::receptionist, &DreamBase::genericPerson /*maleFan*/,
|
|
|
|
&DreamBase::genericPerson /*femaleFan*/, &DreamBase::louis,
|
|
|
|
&DreamBase::louisChair, &DreamBase::soldier1,
|
|
|
|
&DreamBase::bossMan, &DreamBase::interviewer,
|
|
|
|
&DreamBase::heavy, &DreamBase::manAsleep /*manAsleep2*/,
|
|
|
|
&DreamBase::genericPerson /*manSatStill*/, &DreamBase::drinker,
|
|
|
|
&DreamBase::bartender, &DreamBase::genericPerson /*otherSmoker*/,
|
|
|
|
&DreamBase::genericPerson /*tattooMan*/, &DreamBase::attendant,
|
|
|
|
&DreamBase::keeper, &DreamBase::candles1,
|
|
|
|
&DreamBase::smallCandle, &DreamBase::security,
|
|
|
|
&DreamBase::copper, &DreamBase::poolGuard,
|
|
|
|
&DreamBase::rockstar, &DreamBase::businessMan,
|
|
|
|
&DreamBase::train, &DreamBase::genericPerson /*aide*/,
|
2011-12-18 15:20:17 +00:00
|
|
|
&DreamBase::mugger, &DreamBase::helicopter,
|
2011-12-16 16:11:46 +00:00
|
|
|
&DreamBase::introMagic1, &DreamBase::introMusic,
|
|
|
|
&DreamBase::introMagic2, &DreamBase::candles2,
|
|
|
|
&DreamBase::gates, &DreamBase::introMagic3,
|
|
|
|
&DreamBase::introMonks1, &DreamBase::candles,
|
|
|
|
&DreamBase::introMonks2, &DreamBase::handClap,
|
2011-12-18 14:32:25 +00:00
|
|
|
&DreamBase::monkAndRyan, &DreamBase::endGameSeq,
|
2011-12-16 16:11:46 +00:00
|
|
|
&DreamBase::priest, &DreamBase::madman,
|
|
|
|
&DreamBase::madmansTelly, &DreamBase::alleyBarkSound,
|
|
|
|
&DreamBase::foghornSound, &DreamBase::carParkDrip,
|
|
|
|
&DreamBase::carParkDrip, &DreamBase::carParkDrip,
|
|
|
|
&DreamBase::carParkDrip
|
2011-12-03 17:22:09 +00:00
|
|
|
};
|
|
|
|
|
2011-12-17 21:26:17 +00:00
|
|
|
static const ReelRoutine g_initialReelRoutines[] = {
|
|
|
|
// Room number and x,y
|
|
|
|
// reel pointer
|
|
|
|
// speed,speed count,convers. no.
|
|
|
|
{ 1,44,0, 20, 2,0,1 },
|
|
|
|
{ 1,55,0, 0, 50,20,0 },
|
|
|
|
{ 24,22,0, 74, 1,0,0 },
|
|
|
|
{ 24,33,10, 75, 1,0,1 },
|
|
|
|
{ 1,44,0, 27, 2,0,2 },
|
|
|
|
{ 1,44,0, 96, 3,0,4 },
|
|
|
|
{ 1,44,0, 118, 2,0,5 },
|
|
|
|
{ 1,44,10, 0, 2,0,0 },
|
|
|
|
{ 5,22,20, 53, 3,0,0 },
|
|
|
|
{ 5,22,20, 40, 1,0,2 },
|
|
|
|
{ 5,22,20, 50, 1,0,3 },
|
|
|
|
{ 2,11,10, 192, 1,0,0 },
|
|
|
|
{ 2,11,10, 182, 2,0,1 },
|
|
|
|
{ 8,11,10, 0, 2,0,1 },
|
|
|
|
{ 23,0,50, 0, 3,0,0 },
|
|
|
|
{ 28,11,20, 250, 4,0,0 },
|
|
|
|
{ 23,0,50, 43, 2,0,8 },
|
|
|
|
{ 23,11,40, 130, 2,0,1 },
|
|
|
|
{ 23,22,40, 122, 2,0,2 },
|
|
|
|
{ 23,22,40, 105, 2,0,3 },
|
|
|
|
{ 23,22,40, 81, 2,0,4 },
|
|
|
|
{ 23,11,40, 135, 2,0,5 },
|
|
|
|
{ 23,22,40, 145, 2,0,6 },
|
|
|
|
{ 4,22,30, 0, 2,0,0 },
|
|
|
|
{ 45,22,30, 200, 0,0,20 },
|
|
|
|
{ 45,22,30, 39, 2,0,0 },
|
|
|
|
{ 45,22,30, 25, 2,0,0 },
|
|
|
|
{ 8,22,40, 32, 2,0,0 },
|
|
|
|
{ 7,11,20, 64, 2,0,0 },
|
|
|
|
{ 22,22,20, 82, 2,0,0 },
|
|
|
|
{ 27,11,30, 0, 2,0,0 },
|
|
|
|
{ 20,0,30, 0, 2,0,0 },
|
|
|
|
{ 14,33,40, 21, 1,0,0 },
|
|
|
|
{ 29,11,10, 0, 1,0,0 },
|
|
|
|
{ 2,22,0, 2, 2,0,0 },
|
|
|
|
{ 25,0,50, 4, 2,0,0 },
|
|
|
|
{ 50,22,30, 121, 2,0,0 },
|
|
|
|
{ 50,22,30, 0, 20,0,0 },
|
|
|
|
{ 52,22,30, 192, 2,0,0 },
|
|
|
|
{ 52,22,30, 233, 2,0,0 },
|
|
|
|
{ 50,22,40, 104, 55,0,0 }, // ...., 65,0,0 for German CD
|
|
|
|
{ 53,33,0, 99, 2,0,0 },
|
|
|
|
{ 50,22,40, 0, 3,0,0 },
|
|
|
|
{ 50,22,30, 162, 2,0,0 },
|
|
|
|
{ 52,22,30, 57, 2,0,0 },
|
|
|
|
{ 52,22,30, 0, 2,0,0 },
|
|
|
|
{ 54,0,0, 72, 3,0,0 },
|
|
|
|
{ 55,44,0, 0, 2,0,0 },
|
|
|
|
{ 19,0,0, 0, 28,0,0 },
|
|
|
|
{ 14,22,0, 2, 2,0,0 },
|
|
|
|
{ 14,22,0, 300, 1,0,0 },
|
|
|
|
{ 10,22,30, 174, 0,0,0 },
|
|
|
|
{ 12,22,20, 0, 1,0,0 },
|
|
|
|
{ 11,11,20, 0, 50,20,0 },
|
|
|
|
{ 11,11,30, 0, 50,20,0 },
|
|
|
|
{ 11,22,20, 0, 50,20,0 },
|
|
|
|
{ 14,33,40, 0, 50,20,0 },
|
|
|
|
{ 255,0,0, 0, 0,0,0 }
|
|
|
|
};
|
|
|
|
|
2011-12-18 15:53:47 +00:00
|
|
|
void DreamBase::setupInitialReelRoutines() {
|
|
|
|
for (unsigned int i = 0; i < kNumReelRoutines + 1; ++i) {
|
|
|
|
_reelRoutines[i] = g_initialReelRoutines[i];
|
|
|
|
if (_reelRoutines[i].period == 55 && isCD() && engine->getLanguage() == Common::DE_DEU)
|
|
|
|
_reelRoutines[i].period = 65;
|
2011-12-17 21:26:17 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2011-12-18 15:20:17 +00:00
|
|
|
void DreamBase::updatePeople() {
|
2011-12-23 18:13:42 +00:00
|
|
|
_peopleList.clear();
|
2011-12-03 17:22:09 +00:00
|
|
|
++data.word(kMaintimer);
|
|
|
|
|
2011-12-18 15:53:47 +00:00
|
|
|
for (int i = 0; _reelRoutines[i].reallocation != 255; ++i) {
|
|
|
|
if (_reelRoutines[i].reallocation == data.byte(kReallocation) &&
|
|
|
|
_reelRoutines[i].mapX == data.byte(kMapx) &&
|
|
|
|
_reelRoutines[i].mapY == data.byte(kMapy)) {
|
2011-12-15 22:46:05 +00:00
|
|
|
assert(reelCallbacks[i]);
|
2011-12-18 15:53:47 +00:00
|
|
|
(this->*(reelCallbacks[i]))(_reelRoutines[i]);
|
2011-12-03 17:22:09 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2011-12-16 16:11:46 +00:00
|
|
|
void DreamBase::madmanText() {
|
2011-12-15 22:41:27 +00:00
|
|
|
byte origCount;
|
|
|
|
|
2011-12-03 17:22:09 +00:00
|
|
|
if (isCD()) {
|
|
|
|
if (data.byte(kSpeechcount) >= 63)
|
|
|
|
return;
|
2011-12-27 23:49:35 +00:00
|
|
|
if (_channel1Playing != 255)
|
2011-12-03 17:22:09 +00:00
|
|
|
return;
|
2011-12-15 22:41:27 +00:00
|
|
|
origCount = data.byte(kSpeechcount);
|
2011-12-03 17:22:09 +00:00
|
|
|
++data.byte(kSpeechcount);
|
|
|
|
} else {
|
|
|
|
if (data.byte(kCombatcount) >= 61)
|
|
|
|
return;
|
2011-12-15 22:41:27 +00:00
|
|
|
if (data.byte(kCombatcount) & 3)
|
2011-12-03 17:22:09 +00:00
|
|
|
return;
|
2011-12-15 22:41:27 +00:00
|
|
|
origCount = data.byte(kCombatcount) / 4;
|
2011-12-03 17:22:09 +00:00
|
|
|
}
|
2011-12-15 22:41:27 +00:00
|
|
|
setupTimedTemp(47 + origCount, 82, 72, 80, 90, 1);
|
2011-12-03 17:22:09 +00:00
|
|
|
}
|
|
|
|
|
2011-12-16 16:11:46 +00:00
|
|
|
void DreamBase::madman(ReelRoutine &routine) {
|
2011-12-03 17:22:09 +00:00
|
|
|
data.word(kWatchingtime) = 2;
|
2011-12-04 13:48:29 +00:00
|
|
|
if (checkSpeed(routine)) {
|
2011-12-03 17:53:20 +00:00
|
|
|
uint16 newReelPointer = routine.reelPointer();
|
|
|
|
if (newReelPointer >= 364) {
|
2011-12-03 17:22:09 +00:00
|
|
|
data.byte(kMandead) = 2;
|
2011-12-03 17:53:20 +00:00
|
|
|
showGameReel(&routine);
|
2011-12-03 17:22:09 +00:00
|
|
|
return;
|
|
|
|
}
|
2011-12-03 17:53:20 +00:00
|
|
|
if (newReelPointer == 10) {
|
2011-12-03 17:22:09 +00:00
|
|
|
loadTempText("DREAMWEB.T82");
|
|
|
|
data.byte(kCombatcount) = (uint8)-1;
|
|
|
|
data.byte(kSpeechcount) = 0;
|
|
|
|
}
|
2011-12-03 17:53:20 +00:00
|
|
|
++newReelPointer;
|
|
|
|
if (newReelPointer == 294) {
|
2011-12-28 00:04:12 +00:00
|
|
|
if (!_wonGame) {
|
|
|
|
_wonGame = true;
|
2011-12-03 17:53:20 +00:00
|
|
|
getRidOfTempText();
|
|
|
|
}
|
2011-12-03 17:22:09 +00:00
|
|
|
return;
|
|
|
|
}
|
2011-12-03 17:53:20 +00:00
|
|
|
if (newReelPointer == 66) {
|
2011-12-03 17:22:09 +00:00
|
|
|
++data.byte(kCombatcount);
|
|
|
|
madmanText();
|
2011-12-03 17:53:20 +00:00
|
|
|
newReelPointer = 53;
|
2011-12-03 17:22:09 +00:00
|
|
|
if (data.byte(kCombatcount) >= (isCD() ? 64 : 62)) {
|
|
|
|
if (data.byte(kCombatcount) == (isCD() ? 70 : 68))
|
2011-12-03 17:53:20 +00:00
|
|
|
newReelPointer = 310;
|
2011-12-03 17:22:09 +00:00
|
|
|
else {
|
|
|
|
if (data.byte(kLastweapon) == 8) {
|
|
|
|
data.byte(kCombatcount) = isCD() ? 72 : 70;
|
|
|
|
data.byte(kLastweapon) = (uint8)-1;
|
|
|
|
data.byte(kMadmanflag) = 1;
|
2011-12-03 17:53:20 +00:00
|
|
|
newReelPointer = 67;
|
2011-12-03 17:22:09 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2011-12-03 17:53:20 +00:00
|
|
|
routine.setReelPointer(newReelPointer);
|
2011-12-03 17:22:09 +00:00
|
|
|
}
|
2011-12-03 17:53:20 +00:00
|
|
|
showGameReel(&routine);
|
|
|
|
routine.mapX = data.byte(kMapx);
|
2011-12-03 17:22:09 +00:00
|
|
|
madMode();
|
|
|
|
}
|
|
|
|
|
2011-12-16 16:05:15 +00:00
|
|
|
void DreamBase::madMode() {
|
2011-12-03 17:22:09 +00:00
|
|
|
data.word(kWatchingtime) = 2;
|
|
|
|
data.byte(kPointermode) = 0;
|
|
|
|
if (data.byte(kCombatcount) < (isCD() ? 65 : 63))
|
|
|
|
return;
|
|
|
|
if (data.byte(kCombatcount) >= (isCD() ? 70 : 68))
|
|
|
|
return;
|
|
|
|
data.byte(kPointermode) = 2;
|
|
|
|
}
|
|
|
|
|
2011-12-16 16:05:15 +00:00
|
|
|
void DreamBase::addToPeopleList(ReelRoutine *routine) {
|
2011-12-23 18:13:42 +00:00
|
|
|
People people;
|
|
|
|
people._reelPointer = routine->reelPointer();
|
|
|
|
people._routinePointer = routine;
|
|
|
|
people.b4 = routine->b7;
|
2011-12-03 17:22:09 +00:00
|
|
|
|
2011-12-23 18:13:42 +00:00
|
|
|
_peopleList.push_back(people);
|
2011-12-03 17:22:09 +00:00
|
|
|
}
|
|
|
|
|
2011-12-16 16:05:15 +00:00
|
|
|
bool DreamBase::checkSpeed(ReelRoutine &routine) {
|
2011-12-03 17:22:09 +00:00
|
|
|
if (data.byte(kLastweapon) != (uint8)-1)
|
|
|
|
return true;
|
2011-12-04 13:48:29 +00:00
|
|
|
++routine.counter;
|
|
|
|
if (routine.counter != routine.period)
|
2011-12-03 17:22:09 +00:00
|
|
|
return false;
|
2011-12-04 13:48:29 +00:00
|
|
|
routine.counter = 0;
|
2011-12-03 17:22:09 +00:00
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
2011-12-16 16:11:46 +00:00
|
|
|
void DreamBase::sparkyDrip(ReelRoutine &routine) {
|
2011-12-04 13:48:29 +00:00
|
|
|
if (checkSpeed(routine))
|
2011-12-03 17:22:09 +00:00
|
|
|
playChannel0(14, 0);
|
|
|
|
}
|
|
|
|
|
2011-12-16 16:11:46 +00:00
|
|
|
void DreamBase::genericPerson(ReelRoutine &routine) {
|
2011-12-03 17:22:09 +00:00
|
|
|
showGameReel(&routine);
|
|
|
|
addToPeopleList(&routine);
|
|
|
|
}
|
|
|
|
|
2011-12-16 16:11:46 +00:00
|
|
|
void DreamBase::gamer(ReelRoutine &routine) {
|
2011-12-04 13:48:29 +00:00
|
|
|
if (checkSpeed(routine)) {
|
2011-12-03 17:22:09 +00:00
|
|
|
uint8 v;
|
|
|
|
do {
|
|
|
|
v = 20 + engine->randomNumber() % 5;
|
|
|
|
} while (v == routine.reelPointer());
|
|
|
|
routine.setReelPointer(v);
|
|
|
|
}
|
|
|
|
|
|
|
|
showGameReel(&routine);
|
|
|
|
addToPeopleList(&routine);
|
|
|
|
}
|
|
|
|
|
2011-12-16 16:11:46 +00:00
|
|
|
void DreamBase::eden(ReelRoutine &routine) {
|
2011-12-03 17:22:09 +00:00
|
|
|
if (data.byte(kGeneraldead))
|
|
|
|
return;
|
|
|
|
showGameReel(&routine);
|
|
|
|
addToPeopleList(&routine);
|
|
|
|
}
|
|
|
|
|
2011-12-16 16:11:46 +00:00
|
|
|
void DreamBase::sparky(ReelRoutine &routine) {
|
2011-12-03 17:22:09 +00:00
|
|
|
if (data.word(kCard1money))
|
|
|
|
routine.b7 = 3;
|
2011-12-04 13:48:29 +00:00
|
|
|
if (checkSpeed(routine)) {
|
2011-12-23 16:09:46 +00:00
|
|
|
if (routine.reelPointer() == 34) {
|
2011-12-03 17:22:09 +00:00
|
|
|
if (engine->randomNumber() < 30)
|
|
|
|
routine.incReelPointer();
|
|
|
|
else
|
|
|
|
routine.setReelPointer(27);
|
|
|
|
} else {
|
|
|
|
if (routine.reelPointer() != 48)
|
|
|
|
routine.incReelPointer();
|
|
|
|
else
|
|
|
|
routine.setReelPointer(27);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
showGameReel(&routine);
|
|
|
|
addToPeopleList(&routine);
|
|
|
|
if (routine.b7 & 128)
|
|
|
|
data.byte(kTalkedtosparky) = 1;
|
|
|
|
}
|
|
|
|
|
2011-12-16 16:11:46 +00:00
|
|
|
void DreamBase::rockstar(ReelRoutine &routine) {
|
2011-12-03 17:22:09 +00:00
|
|
|
if ((routine.reelPointer() == 303) || (routine.reelPointer() == 118)) {
|
|
|
|
data.byte(kNewlocation) = 45;
|
|
|
|
showGameReel(&routine);
|
|
|
|
return;
|
|
|
|
}
|
2011-12-04 13:48:29 +00:00
|
|
|
if (checkSpeed(routine)) {
|
2011-12-03 17:22:09 +00:00
|
|
|
uint16 nextReelPointer = routine.reelPointer() + 1;
|
|
|
|
if (nextReelPointer == 118) {
|
|
|
|
data.byte(kMandead) = 2;
|
|
|
|
} else if (nextReelPointer == 79) {
|
|
|
|
--nextReelPointer;
|
|
|
|
if (data.byte(kLastweapon) != 1) {
|
|
|
|
++data.byte(kCombatcount);
|
|
|
|
if (data.byte(kCombatcount) == 40) {
|
|
|
|
data.byte(kCombatcount) = 0;
|
|
|
|
nextReelPointer = 79;
|
|
|
|
}
|
|
|
|
} else {
|
2011-12-04 18:25:54 +00:00
|
|
|
data.byte(kLastweapon) = (uint8)-1;
|
2011-12-03 17:22:09 +00:00
|
|
|
nextReelPointer = 123;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
routine.setReelPointer(nextReelPointer);
|
|
|
|
}
|
|
|
|
showGameReel(&routine);
|
|
|
|
if (routine.reelPointer() == 78) {
|
|
|
|
addToPeopleList(&routine);
|
|
|
|
data.byte(kPointermode) = 2;
|
|
|
|
data.word(kWatchingtime) = 0;
|
|
|
|
} else {
|
|
|
|
data.word(kWatchingtime) = 2;
|
|
|
|
data.byte(kPointermode) = 0;
|
|
|
|
routine.mapY = data.byte(kMapy);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2011-12-16 16:11:46 +00:00
|
|
|
void DreamBase::madmansTelly(ReelRoutine &routine) {
|
2011-12-03 19:01:51 +00:00
|
|
|
uint16 nextReelPointer = routine.reelPointer() + 1;
|
|
|
|
if (nextReelPointer == 307)
|
|
|
|
nextReelPointer = 300;
|
|
|
|
routine.setReelPointer(nextReelPointer);
|
|
|
|
showGameReel(&routine);
|
|
|
|
}
|
|
|
|
|
2011-12-04 13:22:13 +00:00
|
|
|
|
2011-12-16 16:11:46 +00:00
|
|
|
void DreamBase::smokeBloke(ReelRoutine &routine) {
|
2011-12-04 13:22:13 +00:00
|
|
|
if (data.byte(kRockstardead) == 0) {
|
|
|
|
if (routine.b7 & 128)
|
2011-12-12 20:55:29 +00:00
|
|
|
DreamBase::setLocation(5);
|
2011-12-04 13:22:13 +00:00
|
|
|
}
|
2011-12-04 13:48:29 +00:00
|
|
|
if (checkSpeed(routine)) {
|
2011-12-04 13:22:13 +00:00
|
|
|
if (routine.reelPointer() == 100) {
|
|
|
|
if (engine->randomNumber() < 30)
|
|
|
|
routine.incReelPointer();
|
|
|
|
else
|
|
|
|
routine.setReelPointer(96);
|
|
|
|
} else if (routine.reelPointer() == 117)
|
|
|
|
routine.setReelPointer(96);
|
|
|
|
else
|
|
|
|
routine.incReelPointer();
|
|
|
|
}
|
|
|
|
showGameReel(&routine);
|
|
|
|
addToPeopleList(&routine);
|
|
|
|
}
|
|
|
|
|
2011-12-16 16:11:46 +00:00
|
|
|
void DreamBase::manAsleep(ReelRoutine &routine) {
|
2011-12-04 13:45:07 +00:00
|
|
|
routine.b7 &= 127;
|
|
|
|
showGameReel(&routine);
|
|
|
|
addToPeopleList(&routine);
|
|
|
|
}
|
|
|
|
|
2011-12-16 16:11:46 +00:00
|
|
|
void DreamBase::attendant(ReelRoutine &routine) {
|
2011-12-07 08:40:33 +00:00
|
|
|
showGameReel(&routine);
|
|
|
|
addToPeopleList(&routine);
|
|
|
|
if (routine.b7 & 128)
|
|
|
|
data.byte(kTalkedtoattendant) = 1;
|
|
|
|
}
|
|
|
|
|
2011-12-16 16:11:46 +00:00
|
|
|
void DreamBase::keeper(ReelRoutine &routine) {
|
2011-12-07 08:40:33 +00:00
|
|
|
if (data.byte(kKeeperflag) != 0) {
|
|
|
|
// Not waiting
|
|
|
|
addToPeopleList(&routine);
|
|
|
|
showGameReel(&routine);
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (data.word(kReeltowatch) < 190)
|
|
|
|
return; // waiting
|
|
|
|
|
|
|
|
data.byte(kKeeperflag)++;
|
|
|
|
|
2011-12-07 08:57:38 +00:00
|
|
|
if ((routine.b7 & 127) != data.byte(kDreamnumber))
|
2011-12-07 08:40:33 +00:00
|
|
|
routine.b7 = data.byte(kDreamnumber);
|
|
|
|
}
|
2011-12-04 14:44:03 +00:00
|
|
|
|
2011-12-16 16:11:46 +00:00
|
|
|
void DreamBase::drunk(ReelRoutine &routine) {
|
2011-12-04 14:44:03 +00:00
|
|
|
if (data.byte(kGeneraldead))
|
|
|
|
return;
|
|
|
|
routine.b7 &= 127;
|
|
|
|
showGameReel(&routine);
|
|
|
|
addToPeopleList(&routine);
|
|
|
|
}
|
|
|
|
|
2011-12-16 16:11:46 +00:00
|
|
|
void DreamBase::interviewer(ReelRoutine &routine) {
|
2011-12-07 20:09:53 +00:00
|
|
|
if (data.word(kReeltowatch) == 68)
|
|
|
|
routine.incReelPointer();
|
|
|
|
|
|
|
|
if (routine.reelPointer() != 250 && routine.reelPointer() != 259 && checkSpeed(routine))
|
|
|
|
routine.incReelPointer();
|
|
|
|
|
|
|
|
showGameReel(&routine);
|
|
|
|
}
|
|
|
|
|
2011-12-16 16:11:46 +00:00
|
|
|
void DreamBase::drinker(ReelRoutine &routine) {
|
2011-12-07 20:09:53 +00:00
|
|
|
if (checkSpeed(routine)) {
|
|
|
|
routine.incReelPointer();
|
|
|
|
|
|
|
|
if ( routine.reelPointer() == 115 ||
|
|
|
|
(routine.reelPointer() == 106 && engine->randomNumber() >= 3))
|
|
|
|
routine.setReelPointer(105);
|
|
|
|
}
|
|
|
|
|
|
|
|
showGameReel(&routine);
|
|
|
|
addToPeopleList(&routine);
|
|
|
|
}
|
|
|
|
|
2011-12-16 16:11:46 +00:00
|
|
|
void DreamBase::alleyBarkSound(ReelRoutine &routine) {
|
2011-12-07 20:09:53 +00:00
|
|
|
uint16 prevReelPointer = routine.reelPointer() - 1;
|
|
|
|
if (prevReelPointer == 0) {
|
|
|
|
playChannel1(14);
|
|
|
|
routine.setReelPointer(1000);
|
|
|
|
} else {
|
|
|
|
routine.setReelPointer(prevReelPointer);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2011-12-16 16:11:46 +00:00
|
|
|
void DreamBase::introMagic1(ReelRoutine &routine) {
|
2011-12-05 23:31:38 +00:00
|
|
|
if (checkSpeed(routine)) {
|
|
|
|
uint16 nextReelPointer = routine.reelPointer() + 1;
|
|
|
|
if (nextReelPointer == 145)
|
|
|
|
nextReelPointer = 121;
|
|
|
|
routine.setReelPointer(nextReelPointer);
|
|
|
|
if (nextReelPointer == 121) {
|
|
|
|
++data.byte(kIntrocount);
|
|
|
|
intro1Text();
|
|
|
|
if (data.byte(kIntrocount) == 8) {
|
|
|
|
data.byte(kMapy) += 10;
|
|
|
|
data.byte(kNowinnewroom) = 1;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
showGameReel(&routine);
|
|
|
|
}
|
|
|
|
|
2011-12-16 16:11:46 +00:00
|
|
|
void DreamBase::introMagic2(ReelRoutine &routine) {
|
2011-12-07 18:27:01 +00:00
|
|
|
if (checkSpeed(routine)) {
|
|
|
|
uint16 nextReelPointer = routine.reelPointer() + 1;
|
|
|
|
if (nextReelPointer == 216)
|
|
|
|
nextReelPointer = 192;
|
|
|
|
routine.setReelPointer(nextReelPointer);
|
|
|
|
}
|
|
|
|
showGameReel(&routine);
|
|
|
|
}
|
|
|
|
|
2011-12-16 16:11:46 +00:00
|
|
|
void DreamBase::introMagic3(ReelRoutine &routine) {
|
2011-12-07 18:27:01 +00:00
|
|
|
if (checkSpeed(routine)) {
|
|
|
|
uint16 nextReelPointer = routine.reelPointer() + 1;
|
|
|
|
if (nextReelPointer == 218)
|
|
|
|
data.byte(kGetback) = 1;
|
|
|
|
routine.setReelPointer(nextReelPointer);
|
|
|
|
}
|
|
|
|
showGameReel(&routine);
|
|
|
|
routine.mapX = data.byte(kMapx);
|
|
|
|
}
|
|
|
|
|
2011-12-16 16:11:46 +00:00
|
|
|
void DreamBase::candles1(ReelRoutine &routine) {
|
2011-12-07 19:01:53 +00:00
|
|
|
if (checkSpeed(routine)) {
|
|
|
|
uint16 nextReelPointer = routine.reelPointer() + 1;
|
|
|
|
if (nextReelPointer == 44)
|
|
|
|
nextReelPointer = 39;
|
|
|
|
routine.setReelPointer(nextReelPointer);
|
|
|
|
}
|
|
|
|
showGameReel(&routine);
|
|
|
|
}
|
|
|
|
|
2011-12-16 16:11:46 +00:00
|
|
|
void DreamBase::candles2(ReelRoutine &routine) {
|
2011-12-07 19:01:53 +00:00
|
|
|
if (checkSpeed(routine)) {
|
|
|
|
uint16 nextReelPointer = routine.reelPointer() + 1;
|
|
|
|
if (nextReelPointer == 238)
|
|
|
|
nextReelPointer = 233;
|
|
|
|
routine.setReelPointer(nextReelPointer);
|
|
|
|
}
|
|
|
|
showGameReel(&routine);
|
|
|
|
}
|
|
|
|
|
2011-12-16 16:11:46 +00:00
|
|
|
void DreamBase::smallCandle(ReelRoutine &routine) {
|
2011-12-07 19:01:53 +00:00
|
|
|
if (checkSpeed(routine)) {
|
|
|
|
uint16 nextReelPointer = routine.reelPointer() + 1;
|
|
|
|
if (nextReelPointer == 37)
|
|
|
|
nextReelPointer = 25;
|
|
|
|
routine.setReelPointer(nextReelPointer);
|
|
|
|
}
|
|
|
|
showGameReel(&routine);
|
|
|
|
}
|
|
|
|
|
2011-12-16 16:11:46 +00:00
|
|
|
void DreamBase::introMusic(ReelRoutine &routine) {
|
2011-12-05 23:51:10 +00:00
|
|
|
}
|
|
|
|
|
2011-12-16 16:11:46 +00:00
|
|
|
void DreamBase::candles(ReelRoutine &routine) {
|
2011-12-05 23:54:50 +00:00
|
|
|
if (checkSpeed(routine)) {
|
|
|
|
uint16 nextReelPointer = routine.reelPointer() + 1;
|
|
|
|
if (nextReelPointer == 167)
|
|
|
|
nextReelPointer = 162;
|
|
|
|
routine.setReelPointer(nextReelPointer);
|
|
|
|
}
|
|
|
|
showGameReel(&routine);
|
|
|
|
}
|
|
|
|
|
2011-12-16 16:11:46 +00:00
|
|
|
void DreamBase::gates(ReelRoutine &routine) {
|
2011-12-06 00:38:40 +00:00
|
|
|
if (checkSpeed(routine)) {
|
|
|
|
uint16 nextReelPointer = routine.reelPointer() + 1;
|
|
|
|
if (nextReelPointer == 116)
|
|
|
|
playChannel1(17);
|
|
|
|
if (nextReelPointer >= 110)
|
|
|
|
routine.period = 2;
|
|
|
|
if (nextReelPointer == 120) {
|
|
|
|
data.byte(kGetback) = 1;
|
|
|
|
nextReelPointer = 119;
|
|
|
|
}
|
|
|
|
routine.setReelPointer(nextReelPointer);
|
2011-12-16 16:05:15 +00:00
|
|
|
intro3Text(nextReelPointer);
|
2011-12-06 00:38:40 +00:00
|
|
|
}
|
|
|
|
showGameReel(&routine);
|
|
|
|
}
|
|
|
|
|
2011-12-16 16:11:46 +00:00
|
|
|
void DreamBase::security(ReelRoutine &routine) {
|
2011-12-04 14:50:12 +00:00
|
|
|
if (routine.reelPointer() == 32) {
|
|
|
|
if (data.byte(kLastweapon) == 1) {
|
|
|
|
data.word(kWatchingtime) = 10;
|
|
|
|
if ((data.byte(kManspath) == 9) && (data.byte(kFacing) == 0)) {
|
2011-12-04 18:25:54 +00:00
|
|
|
data.byte(kLastweapon) = (uint8)-1;
|
2011-12-04 14:50:12 +00:00
|
|
|
routine.incReelPointer();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
} else if (routine.reelPointer() == 69)
|
|
|
|
return;
|
|
|
|
else {
|
|
|
|
data.word(kWatchingtime) = 10;
|
|
|
|
if (checkSpeed(routine))
|
|
|
|
routine.incReelPointer();
|
|
|
|
}
|
|
|
|
showGameReel(&routine);
|
|
|
|
addToPeopleList(&routine);
|
|
|
|
}
|
|
|
|
|
2011-12-16 16:11:46 +00:00
|
|
|
void DreamBase::edenInBath(ReelRoutine &routine) {
|
2011-12-05 21:51:36 +00:00
|
|
|
if (data.byte(kGeneraldead) == 0 || data.byte(kSartaindead) != 0)
|
|
|
|
return;
|
|
|
|
|
2011-12-05 21:56:08 +00:00
|
|
|
showGameReel(&routine);
|
|
|
|
addToPeopleList(&routine);
|
2011-12-05 21:51:36 +00:00
|
|
|
}
|
|
|
|
|
2011-12-16 16:11:46 +00:00
|
|
|
void DreamBase::louis(ReelRoutine &routine) {
|
2011-12-05 21:51:36 +00:00
|
|
|
if (data.byte(kRockstardead) != 0)
|
|
|
|
return;
|
|
|
|
|
2011-12-05 21:56:08 +00:00
|
|
|
showGameReel(&routine);
|
|
|
|
addToPeopleList(&routine);
|
2011-12-05 21:51:36 +00:00
|
|
|
}
|
|
|
|
|
2011-12-16 16:11:46 +00:00
|
|
|
void DreamBase::handClap(ReelRoutine &routine) {
|
2011-12-05 22:06:04 +00:00
|
|
|
}
|
|
|
|
|
2011-12-16 16:11:46 +00:00
|
|
|
void DreamBase::carParkDrip(ReelRoutine &routine) {
|
2011-12-05 23:16:38 +00:00
|
|
|
if (!checkSpeed(routine))
|
|
|
|
return; // cantdrip2
|
|
|
|
|
|
|
|
playChannel1(14);
|
|
|
|
}
|
|
|
|
|
2011-12-16 16:11:46 +00:00
|
|
|
void DreamBase::foghornSound(ReelRoutine &routine) {
|
2011-12-06 00:34:01 +00:00
|
|
|
if (engine->randomNumber() == 198)
|
|
|
|
playChannel1(13);
|
|
|
|
}
|
|
|
|
|
2011-12-16 16:11:46 +00:00
|
|
|
void DreamBase::train(ReelRoutine &routine) {
|
2011-12-08 09:37:35 +00:00
|
|
|
// The original code has logic for this, but it is disabled
|
2011-12-06 20:18:17 +00:00
|
|
|
}
|
|
|
|
|
2011-12-16 16:11:46 +00:00
|
|
|
void DreamBase::louisChair(ReelRoutine &routine) {
|
2011-12-07 21:01:32 +00:00
|
|
|
if (data.byte(kRockstardead) == 0)
|
|
|
|
return; // notlouis2
|
|
|
|
|
|
|
|
if (checkSpeed(routine)) {
|
|
|
|
uint16 nextReelPointer = routine.reelPointer() + 1;
|
2011-12-07 21:05:41 +00:00
|
|
|
if (nextReelPointer == 191) {
|
2011-12-07 21:01:32 +00:00
|
|
|
routine.setReelPointer(182); // Restart Louis
|
2011-12-07 21:05:41 +00:00
|
|
|
} else if (nextReelPointer != 185) {
|
2011-12-07 21:01:32 +00:00
|
|
|
routine.setReelPointer(nextReelPointer);
|
2011-12-07 21:05:41 +00:00
|
|
|
} else {
|
|
|
|
if (engine->randomNumber() < 245)
|
|
|
|
routine.setReelPointer(182); // Restart Louis
|
|
|
|
else
|
|
|
|
routine.setReelPointer(nextReelPointer);
|
|
|
|
}
|
2011-12-07 21:01:32 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
showGameReel(&routine);
|
|
|
|
addToPeopleList(&routine);
|
|
|
|
}
|
|
|
|
|
2011-12-16 16:11:46 +00:00
|
|
|
void DreamBase::bossMan(ReelRoutine &routine) {
|
2011-12-07 21:33:27 +00:00
|
|
|
if (checkSpeed(routine)) {
|
|
|
|
uint16 nextReelPointer = routine.reelPointer() + 1;
|
|
|
|
|
|
|
|
if (nextReelPointer == 4) {
|
|
|
|
if (data.byte(kGunpassflag) != 1 && engine->randomNumber() >= 10)
|
|
|
|
nextReelPointer = 0;
|
|
|
|
} else if (nextReelPointer == 20) {
|
|
|
|
if (data.byte(kGunpassflag) != 1)
|
|
|
|
nextReelPointer = 0;
|
|
|
|
} else if (nextReelPointer == 41) {
|
|
|
|
nextReelPointer = 0;
|
|
|
|
data.byte(kGunpassflag)++;
|
|
|
|
routine.b7 = 10;
|
|
|
|
}
|
|
|
|
|
|
|
|
routine.setReelPointer(nextReelPointer);
|
|
|
|
}
|
|
|
|
|
|
|
|
showGameReel(&routine);
|
|
|
|
addToPeopleList(&routine);
|
|
|
|
|
|
|
|
if (routine.b7 & 128)
|
|
|
|
data.byte(kTalkedtoboss) = 1;
|
|
|
|
}
|
|
|
|
|
2011-12-16 16:11:46 +00:00
|
|
|
void DreamBase::priest(ReelRoutine &routine) {
|
2011-12-07 22:04:08 +00:00
|
|
|
if (routine.reelPointer() == 8)
|
|
|
|
return; // priestspoken
|
|
|
|
|
|
|
|
data.byte(kPointermode) = 0;
|
|
|
|
data.word(kWatchingtime) = 2;
|
|
|
|
|
|
|
|
if (checkSpeed(routine)) {
|
|
|
|
routine.incReelPointer();
|
|
|
|
priestText(routine);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2011-12-12 18:00:45 +00:00
|
|
|
void DreamBase::priestText(ReelRoutine &routine) {
|
2011-12-07 22:04:08 +00:00
|
|
|
uint16 reel = routine.reelPointer();
|
|
|
|
if (reel < 2 || reel >= 7 || (reel & 1))
|
|
|
|
return; // nopriesttext
|
|
|
|
|
2011-12-12 18:00:45 +00:00
|
|
|
setupTimedUse((reel >> 1) + 50, 54, 1, 72, 80);
|
2011-12-07 22:04:08 +00:00
|
|
|
}
|
|
|
|
|
2011-12-16 16:11:46 +00:00
|
|
|
void DreamBase::monkAndRyan(ReelRoutine &routine) {
|
2011-12-07 22:41:10 +00:00
|
|
|
if (checkSpeed(routine)) {
|
|
|
|
uint16 nextReelPointer = routine.reelPointer() + 1;
|
|
|
|
if (nextReelPointer == 83) {
|
|
|
|
data.byte(kIntrocount)++;
|
|
|
|
textForMonk();
|
|
|
|
nextReelPointer = 77;
|
|
|
|
|
|
|
|
if (data.byte(kIntrocount) == 57) {
|
|
|
|
data.byte(kGetback) = 1;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
routine.setReelPointer(nextReelPointer);
|
|
|
|
}
|
|
|
|
|
|
|
|
showGameReel(&routine);
|
|
|
|
}
|
|
|
|
|
2011-12-16 16:11:46 +00:00
|
|
|
void DreamBase::copper(ReelRoutine &routine) {
|
2011-12-08 09:37:35 +00:00
|
|
|
if (checkSpeed(routine)) {
|
|
|
|
uint16 nextReelPointer = routine.reelPointer() + 1;
|
|
|
|
if (nextReelPointer == 94) {
|
|
|
|
nextReelPointer = 64;
|
|
|
|
} else if (nextReelPointer == 81 || nextReelPointer == 66) {
|
|
|
|
// Might wait
|
|
|
|
if (engine->randomNumber() >= 7)
|
|
|
|
nextReelPointer--;
|
|
|
|
}
|
|
|
|
|
|
|
|
routine.setReelPointer(nextReelPointer);
|
|
|
|
}
|
|
|
|
|
|
|
|
showGameReel(&routine);
|
|
|
|
addToPeopleList(&routine);
|
|
|
|
}
|
|
|
|
|
2011-12-16 16:11:46 +00:00
|
|
|
void DreamBase::introMonks1(ReelRoutine &routine) {
|
2011-12-08 18:42:50 +00:00
|
|
|
if (checkSpeed(routine)) {
|
|
|
|
uint16 nextReelPointer = routine.reelPointer() + 1;
|
|
|
|
|
|
|
|
if (nextReelPointer == 80) {
|
|
|
|
data.byte(kMapy) += 10;
|
|
|
|
data.byte(kNowinnewroom) = 1;
|
|
|
|
showGameReel(&routine);
|
|
|
|
return;
|
|
|
|
} else if (nextReelPointer == 30) {
|
|
|
|
data.byte(kMapy) -= 10;
|
|
|
|
data.byte(kNowinnewroom) = 1;
|
|
|
|
nextReelPointer = 51;
|
|
|
|
}
|
|
|
|
|
|
|
|
routine.setReelPointer(nextReelPointer);
|
|
|
|
|
|
|
|
if (nextReelPointer == 5 || nextReelPointer == 15 ||
|
|
|
|
nextReelPointer == 25 || nextReelPointer == 61 ||
|
|
|
|
nextReelPointer == 71) {
|
|
|
|
// Wait step
|
2011-12-16 16:05:15 +00:00
|
|
|
intro2Text(nextReelPointer);
|
2011-12-08 18:47:55 +00:00
|
|
|
routine.counter = (uint8)-20;
|
2011-12-08 18:42:50 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
showGameReel(&routine);
|
|
|
|
routine.mapY = data.byte(kMapy);
|
|
|
|
}
|
|
|
|
|
2011-12-16 16:11:46 +00:00
|
|
|
void DreamBase::introMonks2(ReelRoutine &routine) {
|
2011-12-08 19:10:39 +00:00
|
|
|
if (checkSpeed(routine)) {
|
|
|
|
uint16 nextReelPointer = routine.reelPointer() + 1;
|
|
|
|
if (nextReelPointer == 87) {
|
|
|
|
data.byte(kIntrocount)++;
|
|
|
|
monks2text();
|
|
|
|
|
|
|
|
if (data.byte(kIntrocount), 19)
|
|
|
|
nextReelPointer = 87;
|
|
|
|
else
|
|
|
|
nextReelPointer = 74;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (nextReelPointer == 110) {
|
|
|
|
data.byte(kIntrocount)++;
|
|
|
|
monks2text();
|
|
|
|
|
|
|
|
if (data.byte(kIntrocount) == 35)
|
|
|
|
nextReelPointer = 111;
|
|
|
|
else
|
|
|
|
nextReelPointer = 98;
|
|
|
|
} else if (nextReelPointer == 176) {
|
|
|
|
data.byte(kGetback) = 1;
|
|
|
|
} else if (nextReelPointer == 125) {
|
|
|
|
nextReelPointer = 140;
|
|
|
|
}
|
|
|
|
|
|
|
|
routine.setReelPointer(nextReelPointer);
|
|
|
|
}
|
|
|
|
|
|
|
|
showGameReel(&routine);
|
|
|
|
}
|
|
|
|
|
2011-12-16 16:11:46 +00:00
|
|
|
void DreamBase::soldier1(ReelRoutine &routine) {
|
2011-12-09 07:42:30 +00:00
|
|
|
if (routine.reelPointer() != 0) {
|
|
|
|
data.word(kWatchingtime) = 10;
|
|
|
|
if (routine.reelPointer() == 30) {
|
|
|
|
data.byte(kCombatcount)++;
|
|
|
|
if (data.byte(kCombatcount) == 40)
|
|
|
|
data.byte(kMandead) = 2;
|
|
|
|
} else if (checkSpeed(routine)) {
|
|
|
|
// Not after shot
|
|
|
|
routine.incReelPointer();
|
|
|
|
}
|
|
|
|
} else if (data.byte(kLastweapon) == 1) {
|
|
|
|
data.word(kWatchingtime) = 10;
|
|
|
|
if (data.byte(kManspath) == 2 && data.byte(kFacing) == 4)
|
|
|
|
routine.incReelPointer();
|
|
|
|
data.byte(kLastweapon) = 0xFF;
|
|
|
|
data.byte(kCombatcount) = 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
showGameReel(&routine);
|
|
|
|
addToPeopleList(&routine);
|
|
|
|
}
|
|
|
|
|
2011-12-16 16:11:46 +00:00
|
|
|
void DreamBase::receptionist(ReelRoutine &routine) {
|
2011-12-13 20:39:34 +00:00
|
|
|
if (checkSpeed(routine)) {
|
|
|
|
if (data.byte(kCardpassflag) == 1) {
|
|
|
|
// Set card
|
|
|
|
data.byte(kCardpassflag)++;
|
|
|
|
routine.b7 = 1;
|
2011-12-13 21:04:26 +00:00
|
|
|
routine.setReelPointer(64);
|
2011-12-13 20:39:34 +00:00
|
|
|
}
|
|
|
|
|
2011-12-13 21:04:26 +00:00
|
|
|
if (routine.reelPointer() != 58) {
|
2011-12-13 20:39:34 +00:00
|
|
|
// notdes1
|
2011-12-13 21:04:26 +00:00
|
|
|
if (routine.reelPointer() != 60) {
|
2011-12-13 20:39:34 +00:00
|
|
|
// notdes2
|
2011-12-13 21:04:26 +00:00
|
|
|
if (routine.reelPointer() != 88)
|
|
|
|
routine.incReelPointer(); // not end card
|
2011-12-13 20:39:34 +00:00
|
|
|
else
|
2011-12-13 21:04:26 +00:00
|
|
|
routine.setReelPointer(53);
|
2011-12-13 20:39:34 +00:00
|
|
|
} else if (engine->randomNumber() >= 240) {
|
2011-12-13 21:04:26 +00:00
|
|
|
routine.setReelPointer(53);
|
2011-12-13 20:39:34 +00:00
|
|
|
}
|
|
|
|
} else if (engine->randomNumber() >= 30) {
|
2011-12-13 21:04:26 +00:00
|
|
|
routine.setReelPointer(55);
|
2011-12-13 20:39:34 +00:00
|
|
|
} else {
|
|
|
|
// notdes2
|
2011-12-13 21:04:26 +00:00
|
|
|
if (routine.reelPointer() != 88)
|
|
|
|
routine.incReelPointer(); // not end card
|
2011-12-13 20:39:34 +00:00
|
|
|
else
|
2011-12-13 21:04:26 +00:00
|
|
|
routine.setReelPointer(53);
|
2011-12-13 20:39:34 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
showGameReel(&routine);
|
|
|
|
addToPeopleList(&routine);
|
|
|
|
if (routine.b7 & 128)
|
|
|
|
data.byte(kTalkedtorecep) = 1;
|
|
|
|
}
|
|
|
|
|
2011-12-16 16:11:46 +00:00
|
|
|
void DreamBase::bartender(ReelRoutine &routine) {
|
2011-12-13 20:39:34 +00:00
|
|
|
if (checkSpeed(routine)) {
|
2011-12-13 21:04:26 +00:00
|
|
|
if (routine.reelPointer() == 86) {
|
2011-12-13 20:39:34 +00:00
|
|
|
if (engine->randomNumber() >= 18)
|
2011-12-13 21:04:26 +00:00
|
|
|
routine.setReelPointer(81);
|
2011-12-13 20:39:34 +00:00
|
|
|
else
|
2011-12-13 21:04:26 +00:00
|
|
|
routine.incReelPointer(); // notsmoket2
|
|
|
|
} else if (routine.reelPointer() == 103) {
|
|
|
|
routine.setReelPointer(81); // notsmoket1
|
2011-12-13 20:39:34 +00:00
|
|
|
} else {
|
2011-12-13 21:04:26 +00:00
|
|
|
routine.incReelPointer(); // notsmoket2
|
2011-12-13 20:39:34 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
showGameReel(&routine);
|
|
|
|
if (data.byte(kGunpassflag) == 1)
|
|
|
|
routine.b7 = 9; // got gun
|
|
|
|
|
|
|
|
addToPeopleList(&routine);
|
|
|
|
}
|
|
|
|
|
2011-12-16 16:11:46 +00:00
|
|
|
void DreamBase::heavy(ReelRoutine &routine) {
|
2011-12-13 23:52:13 +00:00
|
|
|
routine.b7 &= 127;
|
|
|
|
if (routine.reelPointer() != 43) {
|
|
|
|
data.word(kWatchingtime) = 10;
|
|
|
|
if (routine.reelPointer() == 70) {
|
|
|
|
// After shot
|
|
|
|
data.byte(kCombatcount)++;
|
|
|
|
if (data.byte(kCombatcount) == 80)
|
|
|
|
data.byte(kMandead) = 2;
|
|
|
|
} else {
|
|
|
|
if (checkSpeed(routine))
|
|
|
|
routine.incReelPointer();
|
|
|
|
}
|
|
|
|
} else if (data.byte(kLastweapon) == 1 && data.byte(kManspath) == 5 && data.byte(kFacing) == 4) {
|
|
|
|
// Heavy wait
|
|
|
|
data.byte(kLastweapon) = (byte)-1;
|
|
|
|
routine.incReelPointer();
|
|
|
|
data.byte(kCombatcount) = 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
showGameReel(&routine);
|
|
|
|
addToPeopleList(&routine);
|
|
|
|
}
|
|
|
|
|
2011-12-16 16:11:46 +00:00
|
|
|
void DreamBase::helicopter(ReelRoutine &routine) {
|
2011-12-15 10:15:22 +00:00
|
|
|
if (routine.reelPointer() == 203) {
|
|
|
|
// Won helicopter
|
|
|
|
data.byte(kPointermode) = 0;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (checkSpeed(routine)) {
|
|
|
|
uint16 nextReelPointer = routine.reelPointer() + 1;
|
|
|
|
if (nextReelPointer == 53) {
|
|
|
|
// Before killing helicopter
|
|
|
|
data.byte(kCombatcount)++;
|
2011-12-15 21:21:22 +00:00
|
|
|
if (data.byte(kCombatcount) >= 8)
|
2011-12-15 10:15:22 +00:00
|
|
|
data.byte(kMandead) = 2;
|
|
|
|
nextReelPointer = 49;
|
|
|
|
} else if (nextReelPointer == 9) {
|
|
|
|
nextReelPointer--;
|
|
|
|
if (data.byte(kLastweapon) == 1) {
|
|
|
|
data.byte(kLastweapon) = (byte)-1;
|
|
|
|
nextReelPointer = 55;
|
|
|
|
} else {
|
|
|
|
nextReelPointer = 5;
|
|
|
|
data.byte(kCombatcount)++;
|
|
|
|
if (data.byte(kCombatcount) == 20) {
|
|
|
|
data.byte(kCombatcount) = 0;
|
|
|
|
nextReelPointer = 9;
|
|
|
|
}
|
|
|
|
}
|
2011-12-16 09:36:07 +00:00
|
|
|
}
|
2011-12-15 10:15:22 +00:00
|
|
|
|
|
|
|
routine.setReelPointer(nextReelPointer);
|
|
|
|
}
|
|
|
|
|
|
|
|
showGameReel(&routine);
|
|
|
|
routine.mapX = data.byte(kMapx);
|
2011-12-15 21:21:22 +00:00
|
|
|
if (routine.reelPointer() < 9 && data.byte(kCombatcount) >= 7) {
|
2011-12-15 10:15:22 +00:00
|
|
|
data.byte(kPointermode) = 2;
|
|
|
|
data.word(kWatchingtime) = 0;
|
|
|
|
} else {
|
2011-12-15 21:21:22 +00:00
|
|
|
// Not waiting helicopter
|
2011-12-15 10:15:22 +00:00
|
|
|
data.byte(kPointermode) = 0;
|
|
|
|
data.word(kWatchingtime) = 2;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2011-12-18 15:20:17 +00:00
|
|
|
void DreamBase::mugger(ReelRoutine &routine) {
|
2011-12-15 21:45:09 +00:00
|
|
|
if (routine.reelPointer() != 138) {
|
|
|
|
if (routine.reelPointer() == 176)
|
|
|
|
return; // endmugger2
|
|
|
|
|
|
|
|
if (routine.reelPointer() == 2)
|
|
|
|
data.word(kWatchingtime) = 175 * 2; // set watch
|
|
|
|
|
|
|
|
if (checkSpeed(routine))
|
|
|
|
routine.incReelPointer();
|
|
|
|
|
|
|
|
showGameReel(&routine);
|
|
|
|
routine.mapX = data.byte(kMapx);
|
|
|
|
} else {
|
|
|
|
createPanel2();
|
|
|
|
showIcon();
|
|
|
|
|
2011-12-27 17:34:23 +00:00
|
|
|
const uint8 *string = (const uint8 *)_puzzleText.getString(41);
|
2011-12-15 21:45:09 +00:00
|
|
|
uint16 y = 104;
|
|
|
|
printDirect(&string, 33 + 20, &y, 241, 241 & 1);
|
2011-12-25 23:59:04 +00:00
|
|
|
workToScreen();
|
2011-12-15 21:45:09 +00:00
|
|
|
hangOn(300);
|
|
|
|
routine.setReelPointer(140);
|
|
|
|
data.byte(kManspath) = 2;
|
|
|
|
data.byte(kFinaldest) = 2;
|
|
|
|
findXYFromPath();
|
|
|
|
data.byte(kResetmanxy) = 1;
|
|
|
|
data.byte(kCommand) = findExObject("WETA");
|
2011-12-18 09:25:49 +00:00
|
|
|
data.byte(kObjecttype) = kExObjectType;
|
2011-12-15 21:45:09 +00:00
|
|
|
removeObFromInv();
|
|
|
|
data.byte(kCommand) = findExObject("WETB");
|
2011-12-18 09:25:49 +00:00
|
|
|
data.byte(kObjecttype) = kExObjectType;
|
2011-12-15 21:45:09 +00:00
|
|
|
removeObFromInv();
|
|
|
|
makeMainScreen();
|
|
|
|
DreamBase::setupTimedUse(48, 70, 10, 68 - 32, 54 + 64);
|
|
|
|
data.byte(kBeenmugged) = 1;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2011-12-17 13:43:10 +00:00
|
|
|
// Exiting the elevator of Sartain's industries, Sartain (the businessman) and
|
|
|
|
// two bodyguards are expecting Ryan.
|
2011-12-16 16:11:46 +00:00
|
|
|
void DreamBase::businessMan(ReelRoutine &routine) {
|
2011-12-15 22:02:57 +00:00
|
|
|
data.byte(kPointermode) = 0;
|
|
|
|
data.word(kWatchingtime) = 2;
|
2011-12-17 13:43:10 +00:00
|
|
|
if (routine.reelPointer() == 2)
|
|
|
|
DreamBase::setupTimedUse(49, 30, 1, 68, 174); // First
|
2011-12-15 22:02:57 +00:00
|
|
|
|
|
|
|
if (routine.reelPointer() == 95) {
|
2011-12-17 13:43:10 +00:00
|
|
|
// Businessman combat won - end
|
2011-12-15 22:02:57 +00:00
|
|
|
data.byte(kPointermode) = 0;
|
|
|
|
data.word(kWatchingtime) = 0;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (routine.reelPointer() == 49)
|
2011-12-17 13:43:10 +00:00
|
|
|
return; // Businessman combat end
|
2011-12-15 22:02:57 +00:00
|
|
|
|
|
|
|
if (checkSpeed(routine)) {
|
|
|
|
uint16 nextReelPointer = routine.reelPointer() + 1;
|
|
|
|
if (nextReelPointer == 48) {
|
|
|
|
data.byte(kMandead) = 2; // before dead body
|
|
|
|
} else if (nextReelPointer == 15) {
|
|
|
|
nextReelPointer--;
|
|
|
|
if (data.byte(kLastweapon) == 3) {
|
2011-12-16 09:36:07 +00:00
|
|
|
// Shield on bus
|
2011-12-15 22:02:57 +00:00
|
|
|
data.byte(kLastweapon) = (byte)-1;
|
|
|
|
data.byte(kCombatcount) = 0;
|
|
|
|
nextReelPointer = 51;
|
|
|
|
} else {
|
2011-12-17 13:43:10 +00:00
|
|
|
// No shield on businessman
|
2011-12-15 22:02:57 +00:00
|
|
|
data.byte(kCombatcount)++;
|
|
|
|
if (data.byte(kCombatcount) == 20) {
|
|
|
|
data.byte(kCombatcount) = 0;
|
|
|
|
nextReelPointer = 15;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
} else {
|
2011-12-17 13:43:10 +00:00
|
|
|
// Businessman combat won
|
2011-12-15 22:02:57 +00:00
|
|
|
if (nextReelPointer == 91) {
|
|
|
|
turnPathOn(0);
|
|
|
|
turnPathOn(1);
|
|
|
|
turnPathOn(2);
|
|
|
|
turnPathOff(3);
|
|
|
|
data.byte(kManspath) = 5;
|
|
|
|
data.byte(kFinaldest) = 5;
|
|
|
|
findXYFromPath();
|
|
|
|
data.byte(kResetmanxy) = 1;
|
|
|
|
nextReelPointer = 92;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
routine.setReelPointer(nextReelPointer);
|
|
|
|
}
|
|
|
|
|
|
|
|
showGameReel(&routine);
|
|
|
|
routine.mapY = data.byte(kMapy);
|
|
|
|
if (routine.reelPointer() == 14) {
|
|
|
|
data.word(kWatchingtime) = 0;
|
|
|
|
data.byte(kPointermode) = 2;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2011-12-16 16:11:46 +00:00
|
|
|
void DreamBase::endGameSeq(ReelRoutine &routine) {
|
2011-12-15 22:15:04 +00:00
|
|
|
if (checkSpeed(routine)) {
|
|
|
|
uint16 nextReelPointer = routine.reelPointer() + 1;
|
|
|
|
if (nextReelPointer == 51 && data.byte(kIntrocount) != 140) {
|
|
|
|
data.byte(kIntrocount)++;
|
|
|
|
textForEnd();
|
|
|
|
nextReelPointer = 50;
|
|
|
|
}
|
|
|
|
|
|
|
|
routine.setReelPointer(nextReelPointer);
|
|
|
|
if (nextReelPointer == 134) {
|
|
|
|
fadeScreenDownHalf();
|
|
|
|
} else if (nextReelPointer == 324) {
|
|
|
|
fadeScreenDowns();
|
2011-12-28 01:31:24 +00:00
|
|
|
_volumeTo = 7;
|
|
|
|
_volumeDirection = 1;
|
2011-12-15 22:15:04 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
if (nextReelPointer == 340)
|
|
|
|
data.byte(kGetback) = 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
showGameReel(&routine);
|
|
|
|
routine.mapY = data.byte(kMapy);
|
|
|
|
|
|
|
|
if (routine.reelPointer() == 145) {
|
|
|
|
routine.setReelPointer(146);
|
2011-12-26 01:15:47 +00:00
|
|
|
rollEndCreditsGameWon();
|
2011-12-15 22:15:04 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2011-12-16 16:11:46 +00:00
|
|
|
void DreamBase::poolGuard(ReelRoutine &routine) {
|
2011-12-15 22:41:27 +00:00
|
|
|
if (routine.reelPointer() == 214 || routine.reelPointer() == 258) {
|
|
|
|
// Combat over 2
|
|
|
|
showGameReel(&routine);
|
|
|
|
data.word(kWatchingtime) = 2;
|
|
|
|
data.byte(kPointermode) = 0;
|
|
|
|
data.byte(kCombatcount)++;
|
|
|
|
if (data.byte(kCombatcount) < 100)
|
|
|
|
return; // doneover2
|
|
|
|
data.word(kWatchingtime) = 0;
|
|
|
|
data.byte(kMandead) = 2;
|
|
|
|
return;
|
|
|
|
} else if (routine.reelPointer() == 185) {
|
|
|
|
// Combat over 1
|
|
|
|
data.word(kWatchingtime) = 0;
|
|
|
|
data.byte(kPointermode) = 0;
|
|
|
|
turnPathOn(0);
|
|
|
|
turnPathOff(1);
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (routine.reelPointer() == 0)
|
|
|
|
turnPathOn(0); // first pool
|
|
|
|
|
|
|
|
if (checkSpeed(routine)) {
|
|
|
|
uint16 nextReelPointer = routine.reelPointer() + 1;
|
|
|
|
|
|
|
|
if (nextReelPointer != 122) {
|
|
|
|
// Not end guard 1
|
|
|
|
if (nextReelPointer == 147) {
|
|
|
|
nextReelPointer--;
|
|
|
|
if (data.byte(kLastweapon) == 1) {
|
|
|
|
// Gun on pool
|
|
|
|
data.byte(kLastweapon) = (byte)-1;
|
|
|
|
nextReelPointer = 147;
|
|
|
|
} else {
|
|
|
|
// Gun not on pool
|
|
|
|
data.byte(kCombatcount)++;
|
|
|
|
if (data.byte(kCombatcount) == 40) {
|
|
|
|
data.byte(kCombatcount) = 0;
|
|
|
|
nextReelPointer = 220;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
} else {
|
2011-12-16 09:36:07 +00:00
|
|
|
nextReelPointer--;
|
|
|
|
|
|
|
|
if (data.byte(kLastweapon) == 2) {
|
|
|
|
// Axe on pool
|
|
|
|
data.byte(kLastweapon) = (byte)-1;
|
|
|
|
nextReelPointer = 122;
|
|
|
|
} else {
|
|
|
|
data.byte(kCombatcount)++;
|
|
|
|
if (data.byte(kCombatcount) == 40) {
|
|
|
|
data.byte(kCombatcount) = 0;
|
|
|
|
nextReelPointer = 195;
|
|
|
|
}
|
2011-12-15 22:41:27 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
routine.setReelPointer(nextReelPointer);
|
|
|
|
}
|
|
|
|
|
|
|
|
showGameReel(&routine);
|
|
|
|
|
|
|
|
if (routine.reelPointer() != 121 && routine.reelPointer() != 146) {
|
|
|
|
data.byte(kPointermode) = 0;
|
|
|
|
data.word(kWatchingtime) = 2;
|
|
|
|
} else {
|
|
|
|
data.byte(kPointermode) = 2;
|
|
|
|
data.word(kWatchingtime) = 0;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2011-12-06 16:43:23 +00:00
|
|
|
} // End of namespace DreamGen
|