diff options
Diffstat (limited to 'engines/startrek/rooms')
-rw-r--r-- | engines/startrek/rooms/function_map.h | 67 | ||||
-rw-r--r-- | engines/startrek/rooms/tug0.cpp | 4 | ||||
-rw-r--r-- | engines/startrek/rooms/tug1.cpp | 311 |
3 files changed, 380 insertions, 2 deletions
diff --git a/engines/startrek/rooms/function_map.h b/engines/startrek/rooms/function_map.h index 1b52b0537f..7ea01393c8 100644 --- a/engines/startrek/rooms/function_map.h +++ b/engines/startrek/rooms/function_map.h @@ -544,8 +544,8 @@ RoomAction tug0ActionList[] = { { Action(ACTION_USE, OBJECT_IPHASERS, OBJECT_IPWE, 0), &Room::tug0UsePhaserOnWelder }, { Action(ACTION_USE, OBJECT_IPHASERK, OBJECT_IPWE, 0), &Room::tug0UsePhaserOnWelder }, - { Action(ACTION_USE, OBJECT_IPWE, OBJECT_IWIRSCRP, 0), &Room::tug0UseWelderOnWireScraps }, - { Action(ACTION_USE, OBJECT_IPWE, OBJECT_IJNKMETL, 0), &Room::tug0UseWelderOnMetalScraps }, + { Action(ACTION_USE, OBJECT_IPWF, OBJECT_IWIRSCRP, 0), &Room::tug0UseWelderOnWireScraps }, + { Action(ACTION_USE, OBJECT_IPWF, OBJECT_IJNKMETL, 0), &Room::tug0UseWelderOnMetalScraps }, { Action(ACTION_USE, OBJECT_ICOMBBIT, OBJECT_IRT, 0), &Room::tug0UseCombBitOnTransmogrifier }, { Action(ACTION_USE, OBJECT_SPOCK, 11, 0), &Room::tug0UseTransporter }, @@ -589,6 +589,69 @@ RoomAction tug0ActionList[] = { { Action(ACTION_USE, OBJECT_IMTRICOR, -1, 0), &Room::tug0UseMTricorderAnywhere }, }; + +// TUG1 +RoomAction tug1ActionList[] = { + { Action(ACTION_TICK, 1, 0, 0), &Room::tug1Tick1 }, + { Action(ACTION_USE, OBJECT_ISTRICOR, -1, 0), &Room::tug1UseSTricorderOnAnything }, + { Action(ACTION_LOOK, 0x21, 0, 0), &Room::tug1LookAtBridgeDoor }, + { Action(ACTION_USE, OBJECT_ISTRICOR, 0x21, 0), &Room::tug1UseSTricorderOnBridgeDoor }, + { Action(ACTION_USE, OBJECT_IPHASERS, 0x21, 0), &Room::tug1UsePhaserOnBridgeDoor }, + { Action(ACTION_USE, OBJECT_IPHASERK, 0x21, 0), &Room::tug1UsePhaserOnBridgeDoor }, + { Action(ACTION_FINISHED_WALKING, 3, 0, 0), &Room::tug1KirkReachedFiringPosition }, + { Action(ACTION_FINISHED_ANIMATION, 4, 0, 0), &Room::tug1KirkPulledOutPhaser }, + { Action(ACTION_FINISHED_ANIMATION, 5, 0, 0), &Room::tug1KirkFinishedFiringPhaser }, + { Action(ACTION_TALK, OBJECT_SPOCK, 0, 0), &Room::tug1TalkToSpock }, + { Action(ACTION_USE, OBJECT_ISTRICOR, 8, 0), &Room::tug1UseSTricorderOnJunkPile }, + { Action(ACTION_LOOK, 8, 0, 0), &Room::tug1LookAtJunkPile }, + { Action(ACTION_GET, 8, 0, 0), &Room::tug1GetJunkPile }, + { Action(ACTION_FINISHED_WALKING, 1, 0, 0), &Room::tug1KirkReachedJunkPile }, + { Action(ACTION_FINISHED_ANIMATION, 2, 0, 0), &Room::tug1KirkFinishedTakingJunkPile }, + { Action(ACTION_USE, OBJECT_IPHASERS, OBJECT_IPWE, 0), &Room::tug1UsePhaserOnWelder }, + { Action(ACTION_USE, OBJECT_IPHASERK, OBJECT_IPWE, 0), &Room::tug1UsePhaserOnWelder }, + { Action(ACTION_USE, OBJECT_IPWF, OBJECT_IWIRSCRP, 0), &Room::tug1UseWelderOnWireScraps }, + { Action(ACTION_USE, OBJECT_IPWF, OBJECT_IJNKMETL, 0), &Room::tug1UseWelderOnMetalScraps }, + { Action(ACTION_USE, OBJECT_ICOMBBIT, OBJECT_IRT, 0), &Room::tug1UseCombBitOnTransmogrifier }, + { Action(ACTION_USE, OBJECT_IPWF, 0x22, 0), &Room::tug1UsePhaserWelderOnBridgeDoor }, + { Action(ACTION_USE, OBJECT_IPWF, 0x21, 0), &Room::tug1UsePhaserWelderOnBridgeDoor }, + { Action(ACTION_USE, OBJECT_IPWF, 0x20, 0), &Room::tug1UsePhaserWelderOnBridgeDoorInLeftSpot }, + { Action(ACTION_FINISHED_WALKING, 6, 0, 0), &Room::tug1KirkReachedBridgeDoorWithWelder }, + { Action(ACTION_FINISHED_ANIMATION, 7, 0, 0), &Room::tug1KirkFinishedUsingWelder }, + { Action(ACTION_FINISHED_WALKING, 8, 0, 0), &Room::tug1KirkReachedBridgeDoorWithWelderInLeftSpot }, + { Action(ACTION_FINISHED_ANIMATION, 9, 0, 0), &Room::tug1KirkFinishedUsingWelderInLeftSpot }, + { Action(ACTION_LOOK, -1, 0, 0), &Room::tug1LookAnywhere }, + { Action(ACTION_LOOK, OBJECT_MCCOY, 0, 0), &Room::tug1LookAtMccoy }, + { Action(ACTION_LOOK, OBJECT_SPOCK, 0, 0), &Room::tug1LookAtSpock }, + { Action(ACTION_LOOK, OBJECT_REDSHIRT, 0, 0), &Room::tug1LookAtRedshirt }, + { Action(ACTION_TALK, OBJECT_MCCOY, 0, 0), &Room::tug1TalkToMccoy }, + { Action(ACTION_TALK, OBJECT_REDSHIRT, 0, 0), &Room::tug1TalkToRedshirt }, + { Action(ACTION_LOOK, 0x23, 0, 0), &Room::tug1LookAtTerminal }, + { Action(ACTION_LOOK, 0x24, 0, 0), &Room::tug1LookAtDebris }, + { Action(ACTION_LOOK, 0x25, 0, 0), &Room::tug1LookAtBrigDoor }, + { Action(ACTION_USE, OBJECT_ISTRICOR, 0x25, 0), &Room::tug1UseSTricorderOnBrigDoor }, + { Action(ACTION_TALK, OBJECT_KIRK, 0, 0), &Room::tug1TalkToKirk }, + { Action(ACTION_USE, OBJECT_ICOMM, -1, 0), &Room::tug1UseCommunicator }, + { Action(ACTION_WALK, 0x21, 0, 0), &Room::tug1WalkToBridgeDoor }, + { Action(ACTION_FINISHED_WALKING, 10, 0, 0), &Room::tug1KirkReachedBridgeDoor }, + { Action(ACTION_FINISHED_ANIMATION, 11, 0, 0), &Room::tug1BridgeDoorOpened }, + { Action(ACTION_WALK, 0x25, 0, 0), &Room::tug1WalkToBrigDoor }, + { Action(ACTION_USE, OBJECT_IMTRICOR, -1, 0), &Room::tug1UseMTricorderAnywhere }, + { Action(ACTION_USE, OBJECT_IMTRICOR, 0x21, 0), &Room::tug1UseMTricorderOnBridgeDoor }, + { Action(ACTION_USE, OBJECT_IMTRICOR, 0x20, 0), &Room::tug1UseMTricorderOnBridgeDoor }, + { Action(ACTION_USE, OBJECT_IMTRICOR, 0x22, 0), &Room::tug1UseMTricorderOnBridgeDoor }, + { Action(ACTION_USE, OBJECT_IMTRICOR, 0x25, 0), &Room::tug1UseMTricorderOnBrigDoor }, + { Action(ACTION_USE, OBJECT_SPOCK, 0x20, 0), &Room::tug1UseSpockOnBridgeDoor }, + { Action(ACTION_USE, OBJECT_SPOCK, 0x21, 0), &Room::tug1UseSpockOnBridgeDoor }, + { Action(ACTION_USE, OBJECT_SPOCK, 0x22, 0), &Room::tug1UseSpockOnBridgeDoor }, + { Action(ACTION_USE, OBJECT_REDSHIRT, 0x20, 0), &Room::tug1UseRedshirtOnBridgeDoor }, + { Action(ACTION_USE, OBJECT_REDSHIRT, 0x21, 0), &Room::tug1UseRedshirtOnBridgeDoor }, + { Action(ACTION_USE, OBJECT_REDSHIRT, 0x22, 0), &Room::tug1UseRedshirtOnBridgeDoor }, + { Action(ACTION_USE, OBJECT_IMEDKIT, 0x20, 0), &Room::tug1UseMedkitOnBridgeDoor }, + { Action(ACTION_USE, OBJECT_IMEDKIT, 0x21, 0), &Room::tug1UseMedkitOnBridgeDoor }, + { Action(ACTION_USE, OBJECT_IMEDKIT, 0x22, 0), &Room::tug1UseMedkitOnBridgeDoor }, + +}; + } #endif diff --git a/engines/startrek/rooms/tug0.cpp b/engines/startrek/rooms/tug0.cpp index 016bbbbef2..e90544d57e 100644 --- a/engines/startrek/rooms/tug0.cpp +++ b/engines/startrek/rooms/tug0.cpp @@ -212,6 +212,10 @@ void Room::tug0UsePhaserOnWelder() { loseItem(OBJECT_IPWE); giveItem(OBJECT_IPWF); showText(TX_TUG0N006); + + // BUGFIX: this following line didn't exist, despite it existing in TUG1; meaning this + // was supposed to give points, but it only did in a specific room. + _vm->_awayMission.tug.missionScore += 3; } void Room::tug0UseWelderOnWireScraps() { diff --git a/engines/startrek/rooms/tug1.cpp b/engines/startrek/rooms/tug1.cpp new file mode 100644 index 0000000000..467d496646 --- /dev/null +++ b/engines/startrek/rooms/tug1.cpp @@ -0,0 +1,311 @@ +/* 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 { + +#define OBJECT_JUNKPILE 8 +#define OBJECT_PHASERSHOT 9 + +#define HOTSPOT_BRIDGEDOOR 0x21 +#define HOTSPOT_BRIDGEARCH 0x22 +#define HOTSPOT_TERMINAL 0x23 +#define HOTSPOT_DEBRIS 0x24 +#define HOTSPOT_BRIGDOOR 0x25 + +void Room::tug1Tick1() { + playVoc("TUG1LOOP"); + + if (!_vm->_awayMission.tug.gotJunkPile) + loadActorAnim2(OBJECT_JUNKPILE, "jnkpil", 0xfd, 0xa0, 0); +} + +void Room::tug1UseSTricorderOnAnything() { + _vm->_awayMission.crewDirectionsAfterWalk[OBJECT_SPOCK] = DIR_N; + loadActorAnim2(OBJECT_SPOCK, "sscann", -1, -1, 0); + playSoundEffectIndex(SND_TRICORDER); + showText(TX_SPEAKER_SPOCK, TX_TUG1_014); + + // NOTE: this action has a second implementation (which is never called). It displayed + // TX_TUG1_006. Was this meant to be displayed after the force field is down? +} + +void Room::tug1LookAtBridgeDoor() { + if (_vm->_awayMission.tug.forceFieldDown) + return; + showText(TX_TUG1N005); +} + +void Room::tug1UseSTricorderOnBridgeDoor() { + if (_vm->_awayMission.tug.forceFieldDown) + return; + + _vm->_awayMission.crewDirectionsAfterWalk[OBJECT_SPOCK] = DIR_N; + loadActorAnim2(OBJECT_SPOCK, "sscann", -1, -1, 0); + playSoundEffectIndex(SND_TRICORDER); + showText(TX_SPEAKER_SPOCK, TX_TUG1_002); +} + +void Room::tug1UsePhaserOnBridgeDoor() { + if (_vm->_awayMission.tug.forceFieldDown) + showText(TX_TUG1N007); + else { + _vm->_awayMission.disableInput = true; + _vm->_awayMission.crewDirectionsAfterWalk[OBJECT_KIRK] = DIR_N; + walkCrewman(OBJECT_KIRK, 0xbe, 0x78, 3); + } +} + +void Room::tug1KirkReachedFiringPosition() { + loadActorAnim2(OBJECT_KIRK, "kfiren", -1, -1, 4); +} + +void Room::tug1KirkPulledOutPhaser() { + loadActorAnim2(OBJECT_PHASERSHOT, "t1phas", 0, 0, 5); + playSoundEffectIndex(SND_PHASSHOT); +} + +void Room::tug1KirkFinishedFiringPhaser() { + _vm->_awayMission.disableInput = false; + loadActorStandAnim(OBJECT_KIRK); + loadActorStandAnim(OBJECT_PHASERSHOT); +} + +void Room::tug1TalkToSpock() { + if (!_vm->_awayMission.tug.forceFieldDown) + showText(TX_SPEAKER_SPOCK, TX_TUG1_010); +} + +void Room::tug1UseSTricorderOnJunkPile() { + _vm->_awayMission.crewDirectionsAfterWalk[OBJECT_SPOCK] = DIR_N; + loadActorAnim2(OBJECT_SPOCK, "sscann", -1, -1, 0); + playSoundEffectIndex(SND_TRICORDER); + showText(TX_SPEAKER_SPOCK, TX_TUG1_009); +} + +void Room::tug1LookAtJunkPile() { + showText(TX_TUG1N000); +} + +void Room::tug1GetJunkPile() { + walkCrewman(OBJECT_KIRK, 0xe1, 0xaa, 1); +} + +void Room::tug1KirkReachedJunkPile() { + loadActorAnim2(OBJECT_KIRK, "kpicke", 0xe1, 0xaa, 2); +} + +void Room::tug1KirkFinishedTakingJunkPile() { + _vm->_awayMission.tug.gotJunkPile = true; + giveItem(OBJECT_IDEADPH); + giveItem(OBJECT_IPWE); + _vm->_awayMission.tug.missionScore++; + giveItem(OBJECT_IWIRSCRP); + giveItem(OBJECT_IJNKMETL); + + loadActorStandAnim(OBJECT_JUNKPILE); + loadActorStandAnim(OBJECT_KIRK); +} + +void Room::tug1UsePhaserOnWelder() { + loseItem(OBJECT_IPWE); + giveItem(OBJECT_IPWF); + showText(TX_TUG1N004); + + _vm->_awayMission.tug.missionScore += 3; +} + +void Room::tug1UseWelderOnWireScraps() { + showText(TX_TUG1N009); + loseItem(OBJECT_IWIRSCRP); +} + +void Room::tug1UseWelderOnMetalScraps() { + showText(TX_SPEAKER_SPOCK, TX_TUG1_012); + loseItem(OBJECT_IJNKMETL); + giveItem(OBJECT_ICOMBBIT); +} + +void Room::tug1UseCombBitOnTransmogrifier() { + showText(TX_SPEAKER_SPOCK, TX_TUG1_017); + loseItem(OBJECT_ICOMBBIT); + loseItem(OBJECT_IRT); + giveItem(OBJECT_IRTWB); +} + +void Room::tug1UsePhaserWelderOnBridgeDoor() { + if (_vm->_awayMission.tug.forceFieldDown) + showText(TX_TUG1N008); + else { + _vm->_awayMission.disableInput = true; + _vm->_awayMission.crewDirectionsAfterWalk[OBJECT_KIRK] = DIR_N; + walkCrewman(OBJECT_KIRK, 0xc2, 0x6a, 6); + } +} + +void Room::tug1UsePhaserWelderOnBridgeDoorInLeftSpot() { + if (_vm->_awayMission.tug.forceFieldDown) + showText(TX_TUG1N007); + else { + _vm->_awayMission.disableInput = true; + _vm->_awayMission.crewDirectionsAfterWalk[OBJECT_KIRK] = DIR_N; + walkCrewman(OBJECT_KIRK, 0xb1, 0x6a, 8); + } +} + +void Room::tug1KirkReachedBridgeDoorWithWelder() { + playVoc("MUR4E9S"); + loadActorAnim2(OBJECT_KIRK, "kusemn", -1, -1, 0); + loadActorAnim2(OBJECT_PHASERSHOT, "t1weld", 0, 0, 7); +} + +void Room::tug1KirkFinishedUsingWelder() { + loadActorStandAnim(OBJECT_PHASERSHOT); + showText(TX_SPEAKER_SPOCK, TX_TUG1_016); + _vm->_awayMission.disableInput = false; +} + +void Room::tug1KirkReachedBridgeDoorWithWelderInLeftSpot() { + playVoc("MUR4E9S"); + loadActorAnim2(OBJECT_KIRK, "kuseln", -1, -1, 0); + loadActorAnim2(OBJECT_PHASERSHOT, "t1weld", 0, 0, 9); +} + +void Room::tug1KirkFinishedUsingWelderInLeftSpot() { + loadActorStandAnim(OBJECT_PHASERSHOT); + showText(TX_SPEAKER_SPOCK, TX_TUG1_015); + _vm->_awayMission.tug.forceFieldDown = true; + _vm->_awayMission.disableInput = false; + _vm->_awayMission.tug.missionScore++; +} + +void Room::tug1LookAnywhere() { + showText(TX_TUG1N013); +} + +void Room::tug1LookAtMccoy() { + showText(TX_TUG1N003); +} + +void Room::tug1LookAtSpock() { + showText(TX_TUG1N006); +} + +void Room::tug1LookAtRedshirt() { + showText(TX_TUG1N002); +} + +void Room::tug1TalkToMccoy() { + showText(TX_SPEAKER_MCCOY, TX_SIN3_012); // NOTE: uses "SIN3" text? +} + +void Room::tug1TalkToRedshirt() { + showText(TX_SPEAKER_CHRISTENSEN, TX_TUG1L005); +} + +void Room::tug1LookAtTerminal() { + showText(TX_TUG1N010); +} + +void Room::tug1LookAtDebris() { + showText(TX_TUG1N011); +} + +void Room::tug1LookAtBrigDoor() { + showText(TX_TUG1N001); +} + +void Room::tug1UseSTricorderOnBrigDoor() { + _vm->_awayMission.crewDirectionsAfterWalk[OBJECT_SPOCK] = DIR_N; + loadActorAnim2(OBJECT_SPOCK, "sscann", -1, -1, 0); + playSoundEffectIndex(SND_TRICORDER); + showText(TX_SPEAKER_SPOCK, TX_TUG1_018); +} + +void Room::tug1TalkToKirk() { + showText(TX_SPEAKER_KIRK, TX_TUG1_001); + showText(TX_SPEAKER_MCCOY, TX_TUG1_008); +} + +// FIXME: not working +void Room::tug1UseCommunicator() { + showText(TX_SPEAKER_SPOCK, TX_TUG1_011); +} + +void Room::tug1WalkToBridgeDoor() { + if (!_vm->_awayMission.tug.forceFieldDown) + return; + _vm->_awayMission.crewDirectionsAfterWalk[OBJECT_KIRK] = DIR_N; + walkCrewman(OBJECT_KIRK, 0xc2, 0x6e, 10); +} + +void Room::tug1KirkReachedBridgeDoor() { + _vm->_awayMission.disableInput = true; + loadActorAnim2(OBJECT_PHASERSHOT, "h1do", 0, 0, 11); +} + +void Room::tug1BridgeDoorOpened() { + walkCrewman(OBJECT_KIRK, 0xc2, 0x63, 0); +} + +void Room::tug1WalkToBrigDoor() { + walkCrewman(OBJECT_KIRK, 0xe9, 0x81, 0); +} + +void Room::tug1UseMTricorderAnywhere() { + _vm->_awayMission.crewDirectionsAfterWalk[OBJECT_MCCOY] = DIR_N; + loadActorAnim2(OBJECT_MCCOY, "mscann", -1, -1, 0); + playSoundEffectIndex(SND_TRICORDER); + showText(TX_SPEAKER_MCCOY, TX_TUG1_003); +} + +void Room::tug1UseMTricorderOnBridgeDoor() { + _vm->_awayMission.crewDirectionsAfterWalk[OBJECT_MCCOY] = DIR_N; + loadActorAnim2(OBJECT_MCCOY, "mscann", -1, -1, 0); + playSoundEffectIndex(SND_TRICORDER); + showText(TX_SPEAKER_MCCOY, TX_TUG1_007); +} + +void Room::tug1UseMTricorderOnBrigDoor() { + _vm->_awayMission.crewDirectionsAfterWalk[OBJECT_MCCOY] = DIR_N; + loadActorAnim2(OBJECT_MCCOY, "mscann", -1, -1, 0); + playSoundEffectIndex(SND_TRICORDER); + showText(TX_SPEAKER_MCCOY, TX_TUG1_005); +} + +void Room::tug1UseSpockOnBridgeDoor() { + if (!_vm->_awayMission.tug.forceFieldDown) + showText(TX_SPEAKER_SPOCK, TX_TUG1_013); +} + +void Room::tug1UseRedshirtOnBridgeDoor() { + if (!_vm->_awayMission.tug.forceFieldDown) + showText(TX_SPEAKER_CHRISTENSEN, TX_TUG1L000); +} + +void Room::tug1UseMedkitOnBridgeDoor() { + if (!_vm->_awayMission.tug.forceFieldDown) + showText(TX_SPEAKER_MCCOY, TX_TUG1_004); +} + +} |