Permalink
Browse files

STARTREK: MUDD4

  • Loading branch information...
Drenn1 authored and sev- committed Jun 29, 2018
1 parent 0879985 commit a636aacf5161161180bd948c7f72bc8acd0113db
@@ -41,7 +41,7 @@ void StarTrekEngine::initAwayMission() {
_roomIndexToLoad = -1;

// Load crew positions for beaming in
initAwayCrewPositions(1);
initAwayCrewPositions(2);
}

void StarTrekEngine::runAwayMission() {
@@ -203,12 +203,14 @@ struct AwayMission {
// True if you've combined the lense + degrimer and fired it off, discovering
// it's a weapon
bool discoveredLenseAndDegrimerFunction; // 0x3c
byte torpedoStatus; // 0x3d
int16 torpedoStatus; // 0x3d
bool muddCurrentlyInsane; // 0x3f
bool muddVisitedDatabaseRoom; // 0x40
bool accessedAlienDatabase; // 0x41
bool tookRepairToolFromDatabaseRoom; // 0x42
bool tookRepairTool; // 0x42
bool gotPointsForDownloadingData; // 0x43
bool contactedEnterpriseFirstTime; // 0x44
bool viewScreenEnabled; // 0x45
bool gotMemoryDisk; // 0x48
bool gotLense; // 0x49
bool gotDegrimer; // 0x4a
@@ -220,6 +222,7 @@ struct AwayMission {
bool enteredRoom0ForFirstTime; // 0x54
bool gotPointsForLoadingTorpedo; // 0x55
bool gotPointsForPressingRedButton; // 0x56
bool gotPointsForEnablingViewscreen; // 0x57
bool enteredRoom1ForFirstTime; // 0x58
bool field58; // 0x58
int16 missionScore; // 0x5a
@@ -1294,6 +1294,53 @@ class Room {

// MUDD4
void mudd4Tick1();
void mudd4UseCommunicator();
void mudd4Timer2Expired();
void mudd4Timer3Expired();
void mudd4UseSpockOnLeftConsole();
void mudd4UseSpockOnRightConsole();
void mudd4UseSpockOnConsole();
void mudd4SpockReachedChair();
void mudd4SpockSatInChair();
void mudd4ShowLeftConsoleMenu();
void mudd4SpockUsedSensors();
void mudd4SpockUsedEngineering();
void mudd4SpockUsedNavigation();
void mudd4FinishedWalking3();
void mudd4UseKirkOnRightConsole();
void mudd4UseKirkOnLeftConsole();
void mudd4UseKirkOnConsole();
void mudd4KirkReachedRightConsole();
void mudd4KirkSatInChair();
void mudd4ShowRightConsoleMenu();
void mudd4KirkUsedViewScreen();
void mudd4Timer1Expired();
void mudd4KirkUsedCommunications();
void mudd4TalkWithMuddAtMissionEnd();
void mudd4KirkReachedPositionToTalkToMudd();
void mudd4UseMccoyOnConsole();
void mudd4UseRedshirtOnConsole();
void mudd4UseSTricorderOnRepairTool();
void mudd4UseSTricorderOnConsole();
void mudd4UseSTricorderOnViewscreen();
void mudd4UseMedkit();
void mudd4GetRepairTool();
void mudd4ReachedRepairTool();
void mudd4PickedUpRepairTool();
void mudd4LookAtConsole();
void mudd4LookAtViewscreen();
void mudd4LookAtKirk();
void mudd4LookAtSpock();
void mudd4LookAtMccoy();
void mudd4LookAtRedshirt();
void mudd4LookAtRepairTool();
void mudd4TalkToKirk();
void mudd4TalkToSpock();
void mudd4TalkToMccoy();
void mudd4TalkToRedshirt();
void mudd4WalkToEastDoor();
void mudd4WalkToWestDoor();
void mudd4TouchedHotspot0();

// MUDD5
void mudd5Tick1();
@@ -1411,6 +1458,10 @@ class Room {
bool suggestedUsingTricorders; // 0xca
bool tricordersUnavailable; // 0xcb

// mudd4
bool usingLeftConsole; // 0xca
bool kirkUsingRightConsole; // 0xcb

// common
byte walkingToDoor;
} mudd;
@@ -1615,7 +1615,81 @@ RoomAction mudd3ActionList[] = {

RoomAction mudd4ActionList[] = {
{ Action(ACTION_TICK, 1, 0, 0), &Room::mudd4Tick1 },
{ Action(ACTION_USE, OBJECT_ICOMM, -1, 0), &Room::mudd4UseCommunicator },
{ Action(ACTION_TIMER_EXPIRED, 2, 0, 0), &Room::mudd4Timer2Expired },
{ Action(ACTION_TIMER_EXPIRED, 3, 0, 0), &Room::mudd4Timer3Expired },
{ Action(ACTION_USE, OBJECT_SPOCK, 0x21, 0), &Room::mudd4UseSpockOnLeftConsole },
{ Action(ACTION_USE, OBJECT_SPOCK, 0x22, 0), &Room::mudd4UseSpockOnLeftConsole },
{ Action(ACTION_USE, OBJECT_SPOCK, 0x23, 0), &Room::mudd4UseSpockOnRightConsole },
{ Action(ACTION_FINISHED_WALKING, 1, 0, 0), &Room::mudd4SpockReachedChair },
{ Action(ACTION_FINISHED_ANIMATION, 1, 0, 0), &Room::mudd4SpockSatInChair },
{ Action(ACTION_FINISHED_ANIMATION, 2, 0, 0), &Room::mudd4SpockUsedSensors },
{ Action(ACTION_FINISHED_ANIMATION, 3, 0, 0), &Room::mudd4SpockUsedEngineering },
{ Action(ACTION_FINISHED_ANIMATION, 4, 0, 0), &Room::mudd4SpockUsedNavigation },
{ Action(ACTION_FINISHED_WALKING, 3, 0, 0), &Room::mudd4FinishedWalking3 },
{ Action(ACTION_USE, OBJECT_KIRK, 0x21, 0), &Room::mudd4UseKirkOnRightConsole },
{ Action(ACTION_USE, OBJECT_KIRK, 0x23, 0), &Room::mudd4UseKirkOnRightConsole },
{ Action(ACTION_USE, OBJECT_KIRK, 0x22, 0), &Room::mudd4UseKirkOnLeftConsole },
{ Action(ACTION_FINISHED_WALKING, 2, 0, 0), &Room::mudd4KirkReachedRightConsole },
{ Action(ACTION_FINISHED_ANIMATION, 5, 0, 0), &Room::mudd4KirkSatInChair },
{ Action(ACTION_FINISHED_ANIMATION, 6, 0, 0), &Room::mudd4KirkUsedViewScreen },
{ Action(ACTION_TIMER_EXPIRED, 1, 0, 0), &Room::mudd4Timer1Expired },
{ Action(ACTION_FINISHED_ANIMATION, 7, 0, 0), &Room::mudd4KirkUsedCommunications },
{ Action(ACTION_FINISHED_WALKING, 4, 0, 0), &Room::mudd4KirkReachedPositionToTalkToMudd },
{ Action(ACTION_USE, OBJECT_MCCOY, 0x21, 0), &Room::mudd4UseMccoyOnConsole },
{ Action(ACTION_USE, OBJECT_MCCOY, 0x22, 0), &Room::mudd4UseMccoyOnConsole },
{ Action(ACTION_USE, OBJECT_MCCOY, 0x23, 0), &Room::mudd4UseMccoyOnConsole },
{ Action(ACTION_USE, OBJECT_REDSHIRT, 0x21, 0), &Room::mudd4UseRedshirtOnConsole },
{ Action(ACTION_USE, OBJECT_REDSHIRT, 0x22, 0), &Room::mudd4UseRedshirtOnConsole },
{ Action(ACTION_USE, OBJECT_REDSHIRT, 0x23, 0), &Room::mudd4UseRedshirtOnConsole },
{ Action(ACTION_USE, OBJECT_ISTRICOR, 10, 0), &Room::mudd4UseSTricorderOnRepairTool },
{ Action(ACTION_USE, OBJECT_ISTRICOR, 0x21, 0), &Room::mudd4UseSTricorderOnConsole },

// ENHANCEMENT: Allow scanning the console to work when scanning the specific stations
// as well
{ Action(ACTION_USE, OBJECT_ISTRICOR, 0x22, 0), &Room::mudd4UseSTricorderOnConsole },
{ Action(ACTION_USE, OBJECT_ISTRICOR, 0x23, 0), &Room::mudd4UseSTricorderOnConsole },

{ Action(ACTION_USE, OBJECT_ISTRICOR, 0x20, 0), &Room::mudd4UseSTricorderOnViewscreen },

// ENHANCEMENT: Allow scanning the viewscreen when it's on, not just when off
{ Action(ACTION_USE, OBJECT_ISTRICOR, 8, 0), &Room::mudd4UseSTricorderOnViewscreen },

// Common code
{ Action(ACTION_USE, OBJECT_ILENSES, OBJECT_IDEGRIME, 0), &Room::mudd0UseLenseOnDegrimer },
{ Action(ACTION_USE, OBJECT_IALIENDV, -1, 0), &Room::mudd0UseAlienDevice },
{ Action(ACTION_FINISHED_ANIMATION, 9, 0, 0), &Room::mudd0FiredAlienDevice },
{ Action(ACTION_USE, OBJECT_IDEGRIME, -1, 0), &Room::mudd0UseDegrimer },

{ Action(ACTION_USE, OBJECT_IMEDKIT, -1, 0), &Room::mudd4UseMedkit },
{ Action(ACTION_GET, 10, 0, 0), &Room::mudd4GetRepairTool },
{ Action(ACTION_FINISHED_WALKING, 5, 0, 0), &Room::mudd4ReachedRepairTool },
{ Action(ACTION_FINISHED_ANIMATION, 10, 0, 0), &Room::mudd4PickedUpRepairTool },

{ Action(ACTION_LOOK, 0x21, 0, 0), &Room::mudd4LookAtConsole },
// ENHANCEMENT: Allow look action work with the specific stations as well
{ Action(ACTION_LOOK, 0x22, 0, 0), &Room::mudd4LookAtConsole },
{ Action(ACTION_LOOK, 0x23, 0, 0), &Room::mudd4LookAtConsole },

{ Action(ACTION_LOOK, 0x20, 0, 0), &Room::mudd4LookAtViewscreen },
// ENHANCEMENT: Allow look action work when viewscreen is on, not just when off
{ Action(ACTION_LOOK, 8, 0, 0), &Room::mudd4LookAtViewscreen },

{ Action(ACTION_LOOK, OBJECT_KIRK, 0, 0), &Room::mudd4LookAtKirk },
{ Action(ACTION_LOOK, OBJECT_SPOCK, 0, 0), &Room::mudd4LookAtSpock },
{ Action(ACTION_LOOK, OBJECT_MCCOY, 0, 0), &Room::mudd4LookAtMccoy },
{ Action(ACTION_LOOK, OBJECT_REDSHIRT, 0, 0), &Room::mudd4LookAtRedshirt },
{ Action(ACTION_LOOK, 10, 0, 0), &Room::mudd4LookAtRepairTool },
{ Action(ACTION_TALK, OBJECT_KIRK, 0, 0), &Room::mudd4TalkToKirk },
{ Action(ACTION_TALK, OBJECT_SPOCK, 0, 0), &Room::mudd4TalkToSpock },
{ Action(ACTION_TALK, OBJECT_MCCOY, 0, 0), &Room::mudd4TalkToMccoy },
{ Action(ACTION_TALK, OBJECT_REDSHIRT, 0, 0), &Room::mudd4TalkToRedshirt },
{ Action(ACTION_WALK, 0x24, 0, 0), &Room::mudd4WalkToEastDoor },
{ Action(ACTION_WALK, 0x25, 0, 0), &Room::mudd4WalkToWestDoor },
{ Action(ACTION_TOUCHED_HOTSPOT, 0, 0, 0), &Room::mudd4TouchedHotspot0 },
// TODO: remainder? something about losing atmosphere?
};

RoomAction mudd5ActionList[] = {
{ Action(ACTION_TICK, 1, 0, 0), &Room::mudd5Tick1 },
};
@@ -165,7 +165,8 @@ void Room::mudd0UseLenseOnDegrimer() {

_vm->_awayMission.mudd.missionScore++;
showText(TX_MUD0N011);
// Identical (?) audio files: TX_MUD0N011, TX_MUD1N013, TX_MUD2N010, TX_MUD3N016
// TODO: Identical (?) audio files: TX_MUD0N011, TX_MUD1N013, TX_MUD2N010, TX_MUD3N016,
// TX_MUD4009
}


@@ -175,6 +176,7 @@ void Room::mudd0UseAlienDevice() {
13, // MUDD1
11, // MUDD2
11, // MUDD3
9, // MUDD4
};

_vm->_awayMission.disableInput = true;
@@ -192,13 +194,14 @@ void Room::mudd0FiredAlienDevice() {
_vm->_awayMission.mudd.discoveredLenseAndDegrimerFunction = true;
_vm->_awayMission.mudd.missionScore += 5;
showText(TX_SPEAKER_KIRK, TX_MUD0_002);
// Identical (?) audio files: TX_MUD0_002, TX_MUD1_002, TX_MUD2_002
// TODO: Identical (?) audio files: TX_MUD0_002, TX_MUD1_002, TX_MUD2_002
}
}


void Room::mudd0UseDegrimer() {
// Identical (?) audio files: TX_MUD0N002, TX_MUD1N004, TX_MUD2N001, TX_MUD3N001...
// TODO: Identical (?) audio files: TX_MUD0N002, TX_MUD1N004, TX_MUD2N001,
// TX_MUD3N001, TX_MUD4N002
showText(TX_MUD0N002);
}

@@ -165,7 +165,7 @@ void Room::mudd1SpockPressedRedButton() {

switch (choice) {
case 0:
_vm->_awayMission.mudd.torpedoStatus = false;
_vm->_awayMission.mudd.torpedoStatus = 0;

// ENHANCEMENT: Original text was just "(Spock raises eyebrow)" without any audio.
// This changes it to a narration to make it flow better.
@@ -177,7 +177,7 @@ void Room::mudd1SpockPressedRedButton() {
// fall through

case 2:
_vm->_awayMission.mudd.torpedoStatus = true;
_vm->_awayMission.mudd.torpedoStatus = 1;
showText(TX_SPEAKER_UHURA, TX_STATICU1);
break;
}
@@ -36,6 +36,9 @@

namespace StarTrek {

// BUG-ish: trying to scan the sphere while someone is behind it causes it to scan that
// object instead.

void Room::mudd3Tick1() {
playVoc("MUD3LOOP");

@@ -45,7 +48,7 @@ void Room::mudd3Tick1() {
loadActorAnim(OBJECT_9, "s4lbpb", 0xa2, 0x9f);

// FIXME: is this supposed to be in this if statement?
if (!_vm->_awayMission.mudd.tookRepairToolFromDatabaseRoom)
if (!_vm->_awayMission.mudd.tookRepairTool)
loadActorAnim(OBJECT_REPAIR_TOOL, "s4lbdv", 0xb7, 0xa8);
}

@@ -292,7 +295,7 @@ void Room::mudd3UseMemoryDiskOnSphere() {


void Room::mudd3GetRepairTool() {
if (_vm->_awayMission.mudd.tookRepairToolFromDatabaseRoom)
if (_vm->_awayMission.mudd.tookRepairTool)
showText(TX_MUD3N018); // NOTE: unused, since the object disappears, can't be selected again
else {
_vm->_awayMission.disableInput = true;
@@ -309,7 +312,7 @@ void Room::mudd3ReachedRepairTool() {
void Room::mudd3PickedUpRepairTool() {
_vm->_awayMission.disableInput = false;
loadActorStandAnim(OBJECT_REPAIR_TOOL);
_vm->_awayMission.mudd.tookRepairToolFromDatabaseRoom = true;
_vm->_awayMission.mudd.tookRepairTool = true;
_vm->_awayMission.mudd.missionScore++;
giveItem(OBJECT_IDOOVER);
}
Oops, something went wrong.

0 comments on commit a636aac

Please sign in to comment.