diff options
-rw-r--r-- | engines/startrek/awaymission.cpp | 12 | ||||
-rw-r--r-- | engines/startrek/awaymission.h | 5 | ||||
-rw-r--r-- | engines/startrek/module.mk | 3 | ||||
-rw-r--r-- | engines/startrek/room.cpp | 10 | ||||
-rw-r--r-- | engines/startrek/room.h | 62 | ||||
-rw-r--r-- | engines/startrek/rooms/demon0.cpp | 4 | ||||
-rw-r--r-- | engines/startrek/rooms/demon1.cpp | 12 | ||||
-rw-r--r-- | engines/startrek/rooms/demon2.cpp | 2 | ||||
-rw-r--r-- | engines/startrek/rooms/demon3.cpp | 8 | ||||
-rw-r--r-- | engines/startrek/rooms/demon4.cpp | 2 | ||||
-rw-r--r-- | engines/startrek/rooms/demon5.cpp | 338 | ||||
-rw-r--r-- | engines/startrek/rooms/function_map.h | 55 | ||||
-rw-r--r-- | engines/startrek/text.h | 140 |
13 files changed, 625 insertions, 28 deletions
diff --git a/engines/startrek/awaymission.cpp b/engines/startrek/awaymission.cpp index 0265f4ed60..e118b3d9c5 100644 --- a/engines/startrek/awaymission.cpp +++ b/engines/startrek/awaymission.cpp @@ -71,7 +71,7 @@ void StarTrekEngine::loadRoom(const Common::String &missionName, int roomIndex) _roomIndex = roomIndex; _roomFrameCounter = 0; - _awayMission.transitioningIntoRoom = 0; + _awayMission.disableInput = false; _gfx->fadeoutScreen(); _sound->stopAllVocSounds(); @@ -130,7 +130,7 @@ void StarTrekEngine::initAwayCrewPositions(int warpEntryIndex) { _kirkActor->triggerActionWhenAnimFinished = true; _kirkActor->finishedAnimActionParam = 0xff; - _awayMission.transitioningIntoRoom = 1; + _awayMission.disableInput = true; _warpHotspotsActive = false; break; case 4: // Crew is beaming in. @@ -142,7 +142,7 @@ void StarTrekEngine::initAwayCrewPositions(int warpEntryIndex) { } _kirkActor->triggerActionWhenAnimFinished = true; _kirkActor->finishedAnimActionParam = 0xff; - _awayMission.transitioningIntoRoom = 1; + _awayMission.disableInput = true; playSoundEffectIndex(0x09); _warpHotspotsActive = false; break; @@ -175,7 +175,7 @@ void StarTrekEngine::handleAwayMissionEvents() { break; case TREKEVENT_LBUTTONDOWN: - if (_awayMission.transitioningIntoRoom != 0) + if (_awayMission.disableInput) break; switch (_awayMission.activeAction) { @@ -317,7 +317,7 @@ checkShowInventory: break; case TREKEVENT_RBUTTONDOWN: // TODO: also triggered by key press? - if (_awayMission.transitioningIntoRoom) + if (_awayMission.disableInput) break; hideInventoryIcons(); playSoundEffectIndex(0x07); @@ -396,7 +396,7 @@ void StarTrekEngine::handleAwayMissionAction() { Action action = _actionQueue.pop(); if ((action.type == ACTION_FINISHED_ANIMATION || action.type == ACTION_FINISHED_WALKING) && action.b1 == 0xff) { - _awayMission.transitioningIntoRoom = 0; + _awayMission.disableInput = false; _warpHotspotsActive = true; return; } diff --git a/engines/startrek/awaymission.h b/engines/startrek/awaymission.h index 15333da0cb..f27a65c0ac 100644 --- a/engines/startrek/awaymission.h +++ b/engines/startrek/awaymission.h @@ -33,7 +33,7 @@ struct AwayMission { int16 mouseY; // 0x12 int16 crewGetupTimers[4]; // 0x14 bool disableWalking; // 0x1c - byte transitioningIntoRoom; // 0x1d; Set while beaming in or walking into a room. Disables control? + byte disableInput; // 0x1d; Set while beaming in or walking into a room. Disables control? bool redshirtDead; // 0x1e byte activeAction; // 0x1f byte activeObject; // 0x20; The item that is going to be used on something @@ -65,7 +65,8 @@ struct AwayMission { byte enteredFrom; // 0x3a bool field3b; // 0x3b bool healedMiner; // 0x3c - bool curedBrother; // 0x3d + bool curedChub; // 0x3d + bool field3e; // 0x3e bool knowAboutHypoDytoxin; // 0x3f bool minerDead; // 0x40 byte field41; // 0x41 diff --git a/engines/startrek/module.mk b/engines/startrek/module.mk index 79dd0ecad5..7f089ca085 100644 --- a/engines/startrek/module.mk +++ b/engines/startrek/module.mk @@ -22,7 +22,8 @@ MODULE_OBJS = \ rooms/demon1.o \ rooms/demon2.o \ rooms/demon3.o \ - rooms/demon4.o + rooms/demon4.o \ + rooms/demon5.o diff --git a/engines/startrek/room.cpp b/engines/startrek/room.cpp index 2c181a51a2..8a71961398 100644 --- a/engines/startrek/room.cpp +++ b/engines/startrek/room.cpp @@ -57,6 +57,10 @@ Room::Room(StarTrekEngine *vm, const Common::String &name) : _vm(vm) { _roomActionList = demon4ActionList; _numRoomActions = sizeof(demon4ActionList) / sizeof(RoomAction); } + else if (name == "DEMON5") { + _roomActionList = demon5ActionList; + _numRoomActions = sizeof(demon5ActionList) / sizeof(RoomAction); + } else { warning("Room \"%s\" unimplemented", name.c_str()); _numRoomActions = 0; @@ -220,6 +224,7 @@ int Room::showText(int text) { } void Room::giveItem(int item) { + assert(item >= ITEMS_START && item < ITEMS_END); _vm->_itemList[item - ITEMS_START].have = true; } @@ -235,6 +240,11 @@ void Room::loadRoomIndex(int roomIndex, int spawnIndex) { // manipulate the stack to jump directly back to the start of "runAwayMission"... } +void Room::loseItem(int item) { + assert(item >= ITEMS_START && item < ITEMS_END); + _vm->_itemList[item - ITEMS_START].have = false; +} + void Room::walkCrewman(int actorIndex, int16 destX, int16 destY, uint16 finishedAnimActionParam) { if (!(actorIndex >= OBJECT_KIRK && actorIndex <= OBJECT_REDSHIRT)) error("Tried to walk a non PC"); diff --git a/engines/startrek/room.h b/engines/startrek/room.h index da93a1e14a..9943509749 100644 --- a/engines/startrek/room.h +++ b/engines/startrek/room.h @@ -50,11 +50,6 @@ const int RDF_WARP_ROOM_INDICES = 0x22; const int RDF_ROOM_ENTRY_POSITIONS = 0x2a; const int RDF_BEAM_IN_POSITIONS = 0xaa; -const char SPEAKER_KIRK[] = "Capt. Kirk"; -const char SPEAKER_SPOCK[] = "Mr. Spock"; -const char SPEAKER_MCCOY[] = "Dr. McCoy"; -const char SPEAKER_EVERTS[] = "Ensign Everts"; - class Room { public: @@ -109,6 +104,7 @@ private: int showText(int text); // Cmd 0x03 void giveItem(int item); // Cmd 0x04 void loadRoomIndex(int roomIndex, int spawnIndex); // Cmd 0x06 + void loseItem(int item); // Cmd 0x07 void walkCrewman(int actorIndex, int16 destX, int16 destY, uint16 finishedAnimActionParam);// Cmd 0x08 void loadMapFile(const Common::String &name); // Cmd 0x09 Common::Point getActorPos(int actorIndex); // Cmd 0x0d @@ -334,6 +330,46 @@ public: void demon4UseCrewmanOnPanel(); void demon4CrewmanReachedPanel(); + // DEMON5 + void demon5Tick1(); + void demon5WalkToDoor(); + void demon5TouchedDoorOpenTrigger(); + void demon5DoorOpenedOrReachedDoor(); + void demon5UseSTricorderOnCrate(); + void demon5UsePhaserOnAnything(); + void demon5UseHandOnStephen(); + void demon5UseBerryOnStephen(); + void demon5UseHypoDytoxinOnChub(); + void demon5MccoyReachedChub(); + void demon5MccoyHealedChub(); + void demon5UseHypoDytoxinOnAnything(); + void demon5UseBerryOnChub(); + void demon5LookAtRoberts(); + void demon5LookAtGrisnash(); + void demon5LookAtStephen(); + void demon5LookAtKirk(); + void demon5LookAtSpock(); + void demon5LookAtMccoy(); + void demon5LookAtRedshirt(); + void demon5LookAtMountain(); + void demon5LookAtCrate(); + void demon5LookAnywhere(); + void demon5LookAtChub(); + void demon5TalkToRoberts(); + void demon5TalkToChub(); + void demon5TalkToGrisnash(); + void demon5TalkToStephen(); + void demon5TalkToKirk(); + void demon5TalkToSpock(); + void demon5TalkToRedshirt(); + void demon5TalkToMccoy(); + void demon5UseMTricorderOnRoberts(); + void demon5UseMTricorderOnChub(); + void demon5UseMTricorderOnGrisnash(); + void demon5UseMTricorderOnStephen(); + void demon5CheckCompletedStudy(); + void demon5GetCrate(); + private: // Room-specific variables. This is memset'ed to 0 when the room is initialized. union { @@ -362,6 +398,22 @@ private: bool cb; // 0xcb int16 crewmanUsingPanel; // 0xcf } demon4; + + struct { + bool scannedRoberts; // 0xca + bool scannedChub; // 0xcb + bool scannedGrisnash; // 0xcc + bool scannedStephen; // 0xcd + byte numScanned; // 0xce + byte numTalkedTo; // 0xcf + bool talkedToRoberts; // 0xd0 + bool talkedToChub; // 0xd1 + bool talkedToGrisnash; // 0xd2 + bool talkedToStephen; // 0xd3 + byte doorCounter; // 0xd4 + bool movingToDoor; // 0xd5 + } demon5; + } _roomVar; }; diff --git a/engines/startrek/rooms/demon0.cpp b/engines/startrek/rooms/demon0.cpp index 397a3eb120..d69f8f1db7 100644 --- a/engines/startrek/rooms/demon0.cpp +++ b/engines/startrek/rooms/demon0.cpp @@ -61,7 +61,7 @@ void Room::demon0TouchedWarp0() { } void Room::demon0WalkToBottomDoor() { - _vm->_awayMission.transitioningIntoRoom = 1; + _vm->_awayMission.disableInput = 1; _rdfData[0xcd] = 1; // FIXME _vm->_awayMission.crewDirectionsAfterWalk[OBJECT_KIRK] = DIR_E; walkCrewman(OBJECT_KIRK, 243, 158, 1); @@ -81,7 +81,7 @@ void Room::demon0ReachedBottomDoor() { } void Room::demon0WalkToTopDoor() { - _vm->_awayMission.transitioningIntoRoom = 1; + _vm->_awayMission.disableInput = 1; _rdfData[0xcc] = 1; // FIXME _vm->_awayMission.crewDirectionsAfterWalk[OBJECT_KIRK] = DIR_E; walkCrewman(OBJECT_KIRK, 157, 134, 2); diff --git a/engines/startrek/rooms/demon1.cpp b/engines/startrek/rooms/demon1.cpp index fb5a66e1fc..325f13c843 100644 --- a/engines/startrek/rooms/demon1.cpp +++ b/engines/startrek/rooms/demon1.cpp @@ -216,7 +216,7 @@ void Room::demon1UsePhaserOnAnything() { void Room::demon1UsePhaserOnKlingon1() { if (_rdfData[0xca] != 0) return; - _vm->_awayMission.transitioningIntoRoom = 1; + _vm->_awayMission.disableInput = 1; _rdfData[0xca] = 1; if (_roomVar.demon1.kirkShooting) { @@ -245,7 +245,7 @@ void Room::demon1ShootKlingon1() { void Room::demon1KlingonDropsHand() { loadActorAnim(13, "klghnd", 0x10b, 0x8e, 0); - _vm->_awayMission.transitioningIntoRoom = 0; + _vm->_awayMission.disableInput = 0; _vm->_awayMission.timers[1] = 0; showText(TX_DEM1N020); @@ -265,7 +265,7 @@ void Room::demon1KlingonDropsHand() { void Room::demon1UsePhaserOnKlingon2() { if (_rdfData[0xcb] != 0) return; - _vm->_awayMission.transitioningIntoRoom = 1; + _vm->_awayMission.disableInput = 1; _rdfData[0xcb] = 1; if (_roomVar.demon1.kirkShooting) { @@ -289,13 +289,13 @@ void Room::demon1ShootKlingon2() { loadActorAnim(12, "s0ks2", 0, 0, 0); playSoundEffectIndex(0x06); loadActorAnim2(9, "klg2d", 0xaa, 0x7c, 0); - _vm->_awayMission.transitioningIntoRoom = 0; + _vm->_awayMission.disableInput = 0; } void Room::demon1UsePhaserOnKlingon3() { if (_rdfData[0xcc] != 0) return; - _vm->_awayMission.transitioningIntoRoom = 1; + _vm->_awayMission.disableInput = 1; _rdfData[0xcc] = 1; if (_roomVar.demon1.kirkShooting) { @@ -319,7 +319,7 @@ void Room::demon1ShootKlingon3() { loadActorAnim(12, "s0ks3", 0, 0, 0); playSoundEffectIndex(0x06); loadActorAnim2(10, "klg3d", 0, 0, 0); - _vm->_awayMission.transitioningIntoRoom = 0; + _vm->_awayMission.disableInput = 0; } // Timer 6 expired diff --git a/engines/startrek/rooms/demon2.cpp b/engines/startrek/rooms/demon2.cpp index c707e25308..9f54cded0c 100644 --- a/engines/startrek/rooms/demon2.cpp +++ b/engines/startrek/rooms/demon2.cpp @@ -141,7 +141,7 @@ void Room::demon2UseMTricorderOnBerries() { loadActorAnim2(OBJECT_MCCOY, "mscane", -1, -1, 0); playSoundEffectIndex(0x04); - if (_vm->_awayMission.demon.curedBrother) + if (_vm->_awayMission.demon.curedChub) showText(TX_SPEAKER_MCCOY, TX_DEM2_013); else if (_vm->_awayMission.demon.madeHypoDytoxin) showText(TX_SPEAKER_MCCOY, TX_DEM2_009); diff --git a/engines/startrek/rooms/demon3.cpp b/engines/startrek/rooms/demon3.cpp index 4a62282694..07bb4541e4 100644 --- a/engines/startrek/rooms/demon3.cpp +++ b/engines/startrek/rooms/demon3.cpp @@ -71,7 +71,7 @@ void Room::demon3Timer0Expired() { _vm->_awayMission.timers[1] = 13; _vm->_awayMission.demon.boulder1Gone = true; _vm->_awayMission.demon.numBouldersGone++; - _vm->_awayMission.transitioningIntoRoom = true; + _vm->_awayMission.disableInput = true; playMidiMusicTracks(2, -1); playVoc("BOULDERK"); } @@ -116,7 +116,7 @@ void Room::demon3FinishedWalking5() { playSoundEffectIndex(0x04); showText(TX_SPEAKER_MCCOY, TX_DEM3_019); - _vm->_awayMission.transitioningIntoRoom = false; + _vm->_awayMission.disableInput = false; } void Room::demon3McCoyInFiringPosition() { @@ -194,7 +194,7 @@ void Room::demon3FireAtBoulder() { playSoundEffectIndex(0x06); if (!_roomVar.demon3.boulder1Shot) _vm->_awayMission.timers[0] = 1; - _vm->_awayMission.transitioningIntoRoom = false; + _vm->_awayMission.disableInput = false; } void Room::demon3UsePhaserOnRedshirt() { @@ -262,7 +262,7 @@ void Room::demon3UsePhaserOnBoulder4() { } void Room::demon3BoulderCommon() { - _vm->_awayMission.transitioningIntoRoom = true; + _vm->_awayMission.disableInput = true; Common::Point pos = getActorPos(OBJECT_KIRK); if (!(pos.x == 0x79 && pos.y == 0xa0)) { _roomVar.demon3.inFiringPosition = false; diff --git a/engines/startrek/rooms/demon4.cpp b/engines/startrek/rooms/demon4.cpp index 3596761c7d..2993c176d3 100644 --- a/engines/startrek/rooms/demon4.cpp +++ b/engines/startrek/rooms/demon4.cpp @@ -137,7 +137,7 @@ void Room::demon4UseCrewmanOnPanel() { return; walkCrewman(_roomVar.demon4.crewmanUsingPanel, 0xda, 0x83, 3); _vm->_awayMission.crewDirectionsAfterWalk[_roomVar.demon4.crewmanUsingPanel] = DIR_N; - _vm->_awayMission.transitioningIntoRoom = true; + _vm->_awayMission.disableInput = true; } void Room::demon4CrewmanReachedPanel() { diff --git a/engines/startrek/rooms/demon5.cpp b/engines/startrek/rooms/demon5.cpp new file mode 100644 index 0000000000..94962db22c --- /dev/null +++ b/engines/startrek/rooms/demon5.cpp @@ -0,0 +1,338 @@ +/* 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 "startrek/room.h" + +namespace StarTrek { + +void Room::demon5Tick1() { + playVoc("DEM5LOOP"); + + if (!_vm->_awayMission.demon.curedChub || _vm->_awayMission.demon.field37 != 1) + loadActorAnim(11, "oldman", 0x7a, 0xb0, 0); + loadActorAnim(8, "brorob", 0xc9, 0xa8, 0); + loadActorAnim(9, "crip", 0xe3, 0xa8, 0); + loadActorAnim(10, "brotel", 0xf9, 0xbc, 0); + loadActorAnim(12, "s0r6d2", 0xa0, 0x92, 0); +} + +void Room::demon5WalkToDoor() { + _vm->_awayMission.disableInput = true; + _roomVar.demon5.movingToDoor = true; + walkCrewman(OBJECT_KIRK, 0xa0, 0x94, 1); +} + +void Room::demon5TouchedDoorOpenTrigger() { + if (!_roomVar.demon5.movingToDoor) + return; + loadActorAnim(12, "s0r6d1", 0xa0, 0x92, 1); + playSoundEffectIndex(0x05); +} + +void Room::demon5DoorOpenedOrReachedDoor() { + // This is invoked when the door opens and when Kirk reaches the door. + // Must wait for both to occur. + _roomVar.demon5.doorCounter++; + if (_roomVar.demon5.doorCounter == 2) + loadRoomIndex(0, 1); +} + +void Room::demon5UseSTricorderOnCrate() { + loadActorAnim(OBJECT_SPOCK, "sscans", -1, -1, 0); + playSoundEffectIndex(0x04); + showText(TX_SPEAKER_SPOCK, TX_DEM5_006); +} + +void Room::demon5UsePhaserOnAnything() { + showText(TX_SPEAKER_SPOCK, TX_DEM5_007); +} + +void Room::demon5UseHandOnStephen() { + if (_vm->_awayMission.demon.field3b) + showText(TX_SPEAKER_STEPHEN, TX_DEM5_036); + else + showText(TX_SPEAKER_STEPHEN, TX_DEM5_039); +} + +void Room::demon5UseBerryOnStephen() { + if (_vm->_awayMission.demon.knowAboutHypoDytoxin) + showText(TX_SPEAKER_STEPHEN, TX_DEM5_033); + else + showText(TX_SPEAKER_STEPHEN, TX_DEM5_037); +} + +void Room::demon5UseHypoDytoxinOnChub() { + walkCrewman(OBJECT_MCCOY, 0xe1, 0xb0, 2); +} + +void Room::demon5MccoyReachedChub() { + loadActorAnim2(OBJECT_MCCOY, "musemn", -1, -1, 2); +} + +void Room::demon5MccoyHealedChub() { + walkCrewman(OBJECT_MCCOY, 0xc8, 0xba, 0); + _vm->_awayMission.crewDirectionsAfterWalk[OBJECT_MCCOY] = DIR_W; + showText(TX_SPEAKER_CHUB, TX_DEM5L027); + loseItem(OBJECT_IDETOXIN); + _vm->_awayMission.demon.curedChub = true; + _vm->_awayMission.missionScore += 2; +} + +void Room::demon5UseHypoDytoxinOnAnything() { + showText(TX_SPEAKER_MCCOY, TX_DEM5_008); +} + +void Room::demon5UseBerryOnChub() { + showText(TX_SPEAKER_MCCOY, TX_DEM5_009); +} + +void Room::demon5LookAtRoberts() { + showText(TX_DEM5N001); +} + +void Room::demon5LookAtGrisnash() { + showText(TX_DEM5N009); +} + +void Room::demon5LookAtStephen() { + showText(TX_DEM5N003); +} + +void Room::demon5LookAtKirk() { + showText(TX_DEM5N006); +} + +void Room::demon5LookAtSpock() { + showText(TX_DEM5N008); +} + +void Room::demon5LookAtMccoy() { + showText(TX_DEM5N007); +} + +void Room::demon5LookAtRedshirt() { + showText(TX_DEM5N005); +} + +void Room::demon5LookAtMountain() { + showText(TX_DEM5N002); +} + +void Room::demon5LookAtCrate() { + showText(TX_DEM5N004); +} + +void Room::demon5LookAnywhere() { + showText(TX_DEM5N000); +} + +void Room::demon5LookAtChub() { + showText(TX_SPEAKER_CHUB, TX_DEM5L028); +} + +void Room::demon5TalkToRoberts() { + if (_vm->_awayMission.demon.curedChub) { + showText(TX_SPEAKER_ROBERTS, TX_DEM5_030); + if (!_roomVar.demon5.talkedToRoberts) { + _roomVar.demon5.talkedToRoberts = true; + _roomVar.demon5.numTalkedTo++; + demon5CheckCompletedStudy(); + } + } + else { + showText(TX_DEM5N010); + } +} + +void Room::demon5TalkToChub() { + if (_vm->_awayMission.demon.curedChub) { + showText(TX_SPEAKER_CHUB, TX_DEM5L029); + showText(TX_SPEAKER_KIRK, TX_DEM5_002); + showText(TX_SPEAKER_CHUB, TX_DEM5L030); + showText(TX_SPEAKER_KIRK, TX_DEM5_005); + showText(TX_SPEAKER_CHUB, TX_DEM5L031); + + if (!_roomVar.demon5.talkedToChub) { + _roomVar.demon5.talkedToChub = true; + _roomVar.demon5.numTalkedTo++; + demon5CheckCompletedStudy(); + } + } + else { + showText(TX_DEM5N013); + } +} + +void Room::demon5TalkToGrisnash() { + if (_vm->_awayMission.demon.curedChub) { + showText(TX_SPEAKER_GRISNASH, TX_DEM5_028); + showText(TX_SPEAKER_SPOCK, TX_DEM5_024); + showText(TX_SPEAKER_GRISNASH, TX_DEM5_029); + showText(TX_SPEAKER_SPOCK, TX_DEM5_025); + + if (!_roomVar.demon5.talkedToGrisnash) { + _roomVar.demon5.talkedToGrisnash = true; + _roomVar.demon5.numTalkedTo++; + demon5CheckCompletedStudy(); + } + } + else { + showText(TX_DEM5N011); + } +} + +void Room::demon5TalkToStephen() { + if (_vm->_awayMission.demon.curedChub) { + showText(TX_SPEAKER_STEPHEN, TX_DEM5_041); + showText(TX_SPEAKER_MCCOY, TX_DEM5_022); + showText(TX_SPEAKER_STEPHEN, TX_DEM5_043); + showText(TX_SPEAKER_ROBERTS, TX_DEM5_031); + showText(TX_SPEAKER_STEPHEN, TX_DEM5_042); + + if (!_roomVar.demon5.talkedToStephen) { + _roomVar.demon5.talkedToStephen = true; + _roomVar.demon5.numTalkedTo++; + demon5CheckCompletedStudy(); + } + } + else if (!_vm->_awayMission.demon.knowAboutHypoDytoxin) { + showText(TX_SPEAKER_ROBERTS, TX_DEM5_034); + } + else if (_vm->_awayMission.demon.madeHypoDytoxin) { + showText(TX_SPEAKER_ROBERTS, TX_DEM5_035); + } + else if (_vm->_awayMission.demon.gotBerries) { + showText(TX_SPEAKER_ROBERTS, TX_DEM5_032); + _vm->_awayMission.demon.field3e = false; + } + else if (_vm->_awayMission.demon.field3e) { + showText(TX_SPEAKER_ROBERTS, TX_DEM5_038); + } + else { + showText(TX_SPEAKER_ROBERTS, TX_DEM5_034); + } +} + +void Room::demon5TalkToKirk() { + showText(TX_SPEAKER_KIRK, TX_DEM5_001); +} + +void Room::demon5TalkToSpock() { + showText(TX_SPEAKER_SPOCK, TX_DEM5_027); + showText(TX_SPEAKER_MCCOY, TX_DEM5_018); +} + +void Room::demon5TalkToRedshirt() { + showText(TX_SPEAKER_EVERTS, TX_DEM5_045); + showText(TX_SPEAKER_MCCOY, TX_DEM5_021); + showText(TX_SPEAKER_KIRK, TX_DEM5_003); +} + +void Room::demon5TalkToMccoy() { + if (_vm->_awayMission.demon.curedChub) { + showText(TX_SPEAKER_MCCOY, TX_DEM5_023); + showText(TX_SPEAKER_KIRK, TX_DEM5_004); + if (!_vm->_awayMission.redshirtDead) { + showText(TX_SPEAKER_EVERTS, TX_DEM5_044); + showText(TX_SPEAKER_MCCOY, TX_DEM5_020); + showText(TX_SPEAKER_SPOCK, TX_DEM5_026); + showText(TX_SPEAKER_MCCOY, TX_DEM5_019); + } + } + else { + showText(TX_SPEAKER_MCCOY, TX_DEM5_017); + } +} + +void Room::demon5UseMTricorderOnRoberts() { + if (_roomVar.demon5.scannedRoberts) + return; + loadActorAnim2(OBJECT_MCCOY, "mscane", -1, -1, 0); + playSoundEffectIndex(0x04); + showText(TX_SPEAKER_MCCOY, TX_DEM5_015); + + _roomVar.demon5.scannedRoberts = true; + _roomVar.demon5.numScanned++; + demon5CheckCompletedStudy(); +} + +void Room::demon5UseMTricorderOnChub() { + loadActorAnim2(OBJECT_MCCOY, "mscane", -1, -1, 0); + playSoundEffectIndex(0x04); + + if (_vm->_awayMission.demon.curedChub) { + if (_roomVar.demon5.scannedChub) + return; + showText(TX_SPEAKER_MCCOY, TX_DEM5_016); + _roomVar.demon5.scannedChub = true; + _roomVar.demon5.numScanned++; + demon5CheckCompletedStudy(); + } + else { + if (_vm->_awayMission.demon.field3e) + showText(TX_SPEAKER_MCCOY, TX_DEM5_010); + else { + showText(TX_SPEAKER_MCCOY, TX_DEM5_012); + showText(TX_SPEAKER_STEPHEN, TX_DEM5_040); + _vm->_awayMission.demon.knowAboutHypoDytoxin = true; + _vm->_awayMission.demon.field3e = true; + } + } +} + + +void Room::demon5UseMTricorderOnGrisnash() { + if (_roomVar.demon5.scannedGrisnash) + return; + loadActorAnim2(OBJECT_MCCOY, "mscane", -1, -1, 0); + playSoundEffectIndex(0x04); + showText(TX_SPEAKER_MCCOY, TX_DEM5_013); + + _roomVar.demon5.scannedGrisnash = true; + _roomVar.demon5.numScanned++; + demon5CheckCompletedStudy(); +} + +void Room::demon5UseMTricorderOnStephen() { + if (_roomVar.demon5.scannedStephen) + return; + loadActorAnim2(OBJECT_MCCOY, "mscanw", -1, -1, 0); + playSoundEffectIndex(0x04); + showText(TX_SPEAKER_MCCOY, TX_DEM5_014); + + _roomVar.demon5.scannedStephen = true; + _roomVar.demon5.numScanned++; + demon5CheckCompletedStudy(); +} + +void Room::demon5CheckCompletedStudy() { + if (_roomVar.demon5.numScanned == 4 && _roomVar.demon5.numTalkedTo == 4) { + showText(TX_SPEAKER_MCCOY, TX_DEM5_011); + _roomVar.demon5.numTalkedTo = 5; + } +} + +void Room::demon5GetCrate() { + showText(TX_DEM5N012); +} + +} diff --git a/engines/startrek/rooms/function_map.h b/engines/startrek/rooms/function_map.h index 1761bda314..d0cbff81df 100644 --- a/engines/startrek/rooms/function_map.h +++ b/engines/startrek/rooms/function_map.h @@ -344,6 +344,61 @@ RoomAction demon4ActionList[] = { { Action(ACTION_FINISHED_WALKING, 3, 0, 0), &Room::demon4CrewmanReachedPanel }, }; +RoomAction demon5ActionList[] = { + { Action(ACTION_TICK, 1, 0, 0), &Room::demon5Tick1 }, + { Action(ACTION_WALK, 0x22, 0, 0), &Room::demon5WalkToDoor }, + { Action(ACTION_WALK, 12, 0, 0), &Room::demon5WalkToDoor }, + { Action(ACTION_TOUCHED_HOTSPOT, 0, 0, 0), &Room::demon5TouchedDoorOpenTrigger }, + { Action(ACTION_FINISHED_WALKING, 1, 0, 0), &Room::demon5DoorOpenedOrReachedDoor }, + { Action(ACTION_FINISHED_ANIMATION, 1, 0, 0), &Room::demon5DoorOpenedOrReachedDoor }, + + { Action(ACTION_USE, OBJECT_ISTRICOR, 0x21, 0), &Room::demon5UseSTricorderOnCrate }, + { Action(ACTION_USE, OBJECT_IPHASERK, -1, 0), &Room::demon5UsePhaserOnAnything }, + { Action(ACTION_USE, OBJECT_IPHASERS, -1, 0), &Room::demon5UsePhaserOnAnything }, + + { Action(ACTION_USE, OBJECT_IHAND, 11, 0), &Room::demon5UseHandOnStephen }, + { Action(ACTION_USE, OBJECT_IBERRY, 11, 0), &Room::demon5UseBerryOnStephen }, + { Action(ACTION_USE, OBJECT_IDETOXIN, 9, 0), &Room::demon5UseHypoDytoxinOnChub }, + { Action(ACTION_FINISHED_WALKING, 2, 0, 0), &Room::demon5MccoyReachedChub }, + { Action(ACTION_FINISHED_ANIMATION, 2, 0, 0), &Room::demon5MccoyHealedChub }, + + { Action(ACTION_USE, OBJECT_IDETOXIN, -1, 0), &Room::demon5UseHypoDytoxinOnAnything }, + { Action(ACTION_USE, OBJECT_IBERRY, 9, 0), &Room::demon5UseBerryOnChub }, + + { Action(ACTION_LOOK, 8, 0, 0), &Room::demon5LookAtRoberts }, + { Action(ACTION_LOOK, 10, 0, 0), &Room::demon5LookAtGrisnash }, + { Action(ACTION_LOOK, 11, 0, 0), &Room::demon5LookAtStephen }, + + { Action(ACTION_LOOK, OBJECT_KIRK, 0, 0), &Room::demon5LookAtKirk }, + { Action(ACTION_LOOK, OBJECT_SPOCK, 0, 0), &Room::demon5LookAtSpock }, + { Action(ACTION_LOOK, OBJECT_MCCOY, 0, 0), &Room::demon5LookAtMccoy }, + { Action(ACTION_LOOK, OBJECT_REDSHIRT, 0, 0), &Room::demon5LookAtRedshirt }, + + { Action(ACTION_LOOK, 0x20, 0, 0), &Room::demon5LookAtMountain }, + { Action(ACTION_LOOK, 0x21, 0, 0), &Room::demon5LookAtCrate }, + { Action(ACTION_LOOK, -1, 0, 0), &Room::demon5LookAnywhere }, + { Action(ACTION_LOOK, 9, 0, 0), &Room::demon5LookAtChub }, + + { Action(ACTION_TALK, 8, 0, 0), &Room::demon5TalkToRoberts }, + { Action(ACTION_TALK, 9, 0, 0), &Room::demon5TalkToChub }, + { Action(ACTION_TALK, 10, 0, 0), &Room::demon5TalkToGrisnash }, + { Action(ACTION_TALK, 11, 0, 0), &Room::demon5TalkToStephen }, + + { Action(ACTION_TALK, OBJECT_KIRK, 0, 0), &Room::demon5TalkToKirk }, + { Action(ACTION_TALK, OBJECT_SPOCK, 0, 0), &Room::demon5TalkToSpock }, + { Action(ACTION_TALK, OBJECT_REDSHIRT, 0, 0), &Room::demon5TalkToRedshirt }, + { Action(ACTION_TALK, OBJECT_MCCOY, 0, 0), &Room::demon5TalkToMccoy }, + + { Action(ACTION_USE, OBJECT_IMTRICOR, 8, 0), &Room::demon5UseMTricorderOnRoberts }, + { Action(ACTION_USE, OBJECT_IMEDKIT, 9, 0), &Room::demon5UseMTricorderOnChub }, + { Action(ACTION_USE, OBJECT_MCCOY, 9, 0), &Room::demon5UseMTricorderOnChub }, + { Action(ACTION_USE, OBJECT_IMTRICOR, 9, 0), &Room::demon5UseMTricorderOnChub }, + { Action(ACTION_USE, OBJECT_IMTRICOR, 10, 0), &Room::demon5UseMTricorderOnGrisnash }, + { Action(ACTION_USE, OBJECT_IMTRICOR, 11, 0), &Room::demon5UseMTricorderOnStephen }, + + { Action(ACTION_GET, 0x21, 0, 0), &Room::demon5GetCrate }, +}; + } #endif diff --git a/engines/startrek/text.h b/engines/startrek/text.h index e352bad8c5..a8e75529c7 100644 --- a/engines/startrek/text.h +++ b/engines/startrek/text.h @@ -38,6 +38,10 @@ enum GameStringIDs { TX_SPEAKER_SIGN, TX_SPEAKER_KLINGON, TX_SPEAKER_KANDREY, + TX_SPEAKER_STEPHEN, + TX_SPEAKER_CHUB, + TX_SPEAKER_ROBERTS, + TX_SPEAKER_GRISNASH, TX_DEM0_001, TX_DEM0_002, @@ -308,6 +312,72 @@ enum GameStringIDs { TX_DEM4N014, + TX_DEM5_001, + TX_DEM5_002, + TX_DEM5_003, + TX_DEM5_004, + TX_DEM5_005, + TX_DEM5_006, + TX_DEM5_007, + TX_DEM5_008, + TX_DEM5_009, + TX_DEM5_010, + TX_DEM5_011, + TX_DEM5_012, + TX_DEM5_013, + TX_DEM5_014, + TX_DEM5_015, + TX_DEM5_016, + TX_DEM5_017, + TX_DEM5_018, + TX_DEM5_019, + TX_DEM5_020, + TX_DEM5_021, + TX_DEM5_022, + TX_DEM5_023, + TX_DEM5_024, + TX_DEM5_025, + TX_DEM5_026, + TX_DEM5_027, + TX_DEM5_028, + TX_DEM5_029, + TX_DEM5_030, + TX_DEM5_031, + TX_DEM5_032, + TX_DEM5_033, + TX_DEM5_034, + TX_DEM5_035, + TX_DEM5_036, + TX_DEM5_037, + TX_DEM5_038, + TX_DEM5_039, + TX_DEM5_040, + TX_DEM5_041, + TX_DEM5_042, + TX_DEM5_043, + TX_DEM5_044, + TX_DEM5_045, + TX_DEM5L027, + TX_DEM5L028, + TX_DEM5L029, + TX_DEM5L030, + TX_DEM5L031, + TX_DEM5N000, + TX_DEM5N001, + TX_DEM5N002, + TX_DEM5N003, + TX_DEM5N004, + TX_DEM5N005, + TX_DEM5N006, + TX_DEM5N007, + TX_DEM5N008, + TX_DEM5N009, + TX_DEM5N010, + TX_DEM5N011, + TX_DEM5N012, + TX_DEM5N013, + + TX_END }; @@ -324,6 +394,10 @@ const char * const g_gameStrings[] = { "Sign", "Klingon", "Brother Kandrey", + "Brother Stephen", + "Brother Chub", + "Brother Roberts", + "Brother Grisnash", "#DEM0\\DEM0_001#Doctor, you need to investigate the possibility of disease, mental or physical, among these people, before we go chasing up the mountains. Prelate Angiven, may we see those who have encountered the demons?", "#DEM0\\DEM0_002#Aside from seeing demons, has any hard data been collected? Any evidence I could see?", @@ -592,6 +666,72 @@ const char * const g_gameStrings[] = { "#DEM4\\DEM4N012#It looks like a control panel with slide switches.", "#DEM4\\DEM4N013#Nothing Happens.", "#DEM4\\DEM4N014#You fit the key into the slot, but you cannot find a way to turn it.", + + + "#DEM5\\DEM5_001#Just thinking to myself. Don't mind me.", + "#DEM5\\DEM5_002#Can you tell us what they looked like?", + "#DEM5\\DEM5_003#It will be good to help them for a change.", + "#DEM5\\DEM5_004#Not the good ones, that's for sure.", + "#DEM5\\DEM5_005#The demons didn't follow you?", + "#DEM5\\DEM5_006#I detect various pieces of mining equipment but nothing of note.", + "#DEM5\\DEM5_007#May I suggest using a more diplomatic approach to questioning the colonists. Force will gain us little, if anything.", + "#DEM5\\DEM5_008#Jim, that wouldn't be wise.", + "#DEM5\\DEM5_009#Jim, these need to be processed first!", + "#DEM5\\DEM5_010#This man is getting worse. We've got to find those berries before he dies.", + "#DEM5\\DEM5_011#Jim, I've completed my study. I find no evidence for physical or mental disturbances among the colonists, causing them to see hallucinations. There must be other reasons for what these people are seeing.", + "#DEM5\\DEM5_012#Jim, this man has suffered severe physical injuries to his head and arm. The wounds have been adequately cared for; however, he has developed the Nugaireyn infection. If not treated swiftly, the effects can be fatal. The infection can normally be treated with Hypo-Dytoxin, but there's none on the Enterprise.", + "#DEM5\\DEM5_013#The alien's lifesigns seem stress-elevated. Otherwise he appears fundamentally healthy.", + "#DEM5\\DEM5_014#The man is suffering moderately from the effects of his age, but seems healthy, alert, and in fine spirits.", + "#DEM5\\DEM5_015#The man seems worried and stressed, but all body functions appear within normal limits.", + "#DEM5\\DEM5_016#This man has recently suffered a nasty but non-life-threatening wound. The damage has been adequately cared for. The man's vital effects are attributable to shock and stress.", + "#DEM5\\DEM5_017#This man needs help, Jim, and I wouldn't want to put it off for too long.", + "#DEM5\\DEM5_018#By our standards yes. Here the Acolytes prefer a simpler life style; unfortunately, this is one of the consequences.", + "#DEM5\\DEM5_019#Neither were some of my professors.", + "#DEM5\\DEM5_020#So did I, but I became one anyway.", + "#DEM5\\DEM5_021#The Acolytes did a lot of good work for the needy in this quadrant.", + "#DEM5\\DEM5_022#Why, Spock, you two should get along fine, he sounds just like you.", + "#DEM5\\DEM5_023#You know Jim, they can take a captain out of a starship, and a science officer out of his lab, but you can never retire a doctor.", + "#DEM5\\DEM5_024#Captain, a Krognik-demon has a decidedly wolfish appearance. Brother Grisnash, is this not the traditional shape of the Evil One and his minions among Tellarites?", + "#DEM5\\DEM5_025#I believe this may be significant, Captain.", + "#DEM5\\DEM5_026#That is not logical, doctor.", + "#DEM5\\DEM5_027#The medical methods of these people seem primitive to me, doctor.", + "#DEM5\\DEM5_028#I am Brother Grisnash. I went up the mountainside in solitary prayer, seeking to face my fears. Indeed I found them. A bellowing Krognik-demon with sharp teeth and a long snout descended upon me in a rush of wind.", + "#DEM5\\DEM5_029#It is.", + "#DEM5\\DEM5_030#Brother Kandrey was -- is -- my partner. I was on the communications link when the demons caused the rockfall and silenced him. He said he'd found a strange door with devilish writing. Truly he came upon the Gate of Hell itself.", + "#DEM5\\DEM5_031#You tread close to unholy knowledge, Brother Stephen!", + "#DEM5\\DEM5_032#Ahh, I see you found the berries. Meet me in my lab.", + "#DEM5\\DEM5_033#Good, you have found the berries. Bring them to my lab quickly.", + "#DEM5\\DEM5_034#I am worried about Brother Chub. Can you examine him, Doctor?", + "#DEM5\\DEM5_035#Please hurry Doctor. Brother Chub is looking worse.", + "#DEM5\\DEM5_036#That's very nice, but I'm busy now.", + "#DEM5\\DEM5_037#Those are Laraxian berries. They grow wild by the mine entrance.", + "#DEM5\\DEM5_038#Time is of the essence, you must hurry and retrieve the berry.", + "#DEM5\\DEM5_039#What an interesting artifact. Hmmm... It appears to have been damaged. When you have a chance, take it to my lab and we'll see if it can be repaired.", + "#DEM5\\DEM5_040#I may be of some assistance. The Laraxian Berry grows near the mouth of the cave. If I could acquire it, I would be able to synthesize the Hypo-Dytoxin from the berry. Unfortunately, the demons prevent us from approaching the cave entrance. perhaps you could retrieve it for me.", + "#DEM5\\DEM5_041#I am Brother Stephen, an Ignaciate, following the holy teachings with mind and soul alike. I believe the anomalous mineral readings, in combination with evidence of ancient disturbances in this otherwise highly stable geologic location indicates previous habitation of the region, eons ago.", + "#DEM5\\DEM5_042#I appreciate your prayers, Brother Roberts. Captain, if you and your people go up the mountain, I hope afterward you will visit me in my study, which is next door. I am too old to make the trek myself, but I am eager for knowledge. In return, I will offer you what insights our God grants these old eyes.", + "#DEM5\\DEM5_043#I would be equally honored to discuss medicine with you, Doctor, as science with your Vulcan associate. Let me continue. I believe our God made humans, aliens -- and demons all. If I could get a real demon into my study, I would bless our God for the opportunity, as I thank Him for everything in this life.", + "#DEM5\\DEM5_044#My mom wanted me to become a doctor. Honest. But I hated my biology classes.", + "#DEM5\\DEM5_045#My uncle John lived with the Acolytes a long time ago. He died in their service, helping plague victims on New Ontario VI twenty years ago.", + "#DEM5\\DEM5L027#Thank you. You are most kind.", + "#DEM5\\DEM5L028#You'll understand if I don't stand up, I hope. I am not well.", + "#DEM5\\DEM5L029#I headed up the party that sought to rescue Brother Kandrey. Without warning, the demons appeared and attacked us as we approached the mine!", + "#DEM5\\DEM5L030#Like the demons that have plagued devout folk since before our people left the Earth. Huge muscular demons, with ruddy skin. Truly the manifestation of Evil, with batwings, horns and talons, and a pointed tail. God preserve us all. One tore open my arm and I surely would have perished -- but for my companions who bore me back down the mountain.", + "#DEM5\\DEM5L031#No.", + "#DEM5\\DEM5N000#A chapel typical of the Acolytes of the Stars.", + "#DEM5\\DEM5N001#A grim-faced miner-colonist nods curtly at you.", + "#DEM5\\DEM5N002#A majestic view of Mt. Idyll can be seen through the skylight.", + "#DEM5\\DEM5N003#A sturdy man of advanced years, whose blue eyes meet yours with clarity, curiosity, and directness.", + "#DEM5\\DEM5N004#Boxes of supplies and mining equipment litter the floor.", + "#DEM5\\DEM5N005#Ensign Everts cannot take his eyes off the sight of Mount Idyll.", + "#DEM5\\DEM5N006#James Kirk takes time to rest and ponder the remainder of the mission.", + "#DEM5\\DEM5N007#McCoy looks anxiously about the room.", + "#DEM5\\DEM5N008#Spock waits for your command, patient as ever.", + "#DEM5\\DEM5N009#The Tellarite appears completely at home surrounded by humans, but the wrinkling on his brow indicates a great deal of worry.", + "#DEM5\\DEM5N010#He is too busy consoling the wounded man.", + "#DEM5\\DEM5N011#He is too busy consoling the wounded man.", + "#DEM5\\DEM5N012#They are too heavy to move.", + "#DEM5\\DEM5N013#This man is in no condition to talk.", }; } |