Permalink
Browse files

STARTREK: MUDD3

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

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

void StarTrekEngine::runAwayMission() {
@@ -192,20 +192,29 @@ struct AwayMission {
byte field29; // 0x29
bool torpedoLoaded; // 0x33
bool knowAboutTorpedo; // 0x34
bool field36; // 0x36
bool discoveredBase3System; // 0x35
bool translatedAlienLanguage; // 0x36
bool databaseDestroyed; // 0x37
bool muddInDatabaseRoom; // 0x38
bool muddDroppedCapsule; // 0x39
bool computerDataErased; // 0x3a
bool gaveMuddDatabaseAccess; // 0x3b

// True if you've combined the lense + degrimer and fired it off, discovering
// it's a weapon
bool discoveredLenseAndDegrimerFunction; // 0x3c
byte torpedoStatus; // 0x3d
bool field3f; // 0x3f
bool muddCurrentlyInsane; // 0x3f
bool muddVisitedDatabaseRoom; // 0x40
bool accessedAlienDatabase; // 0x41
bool tookRepairToolFromDatabaseRoom; // 0x42
bool gotPointsForDownloadingData; // 0x43
bool gotMemoryDisk; // 0x48
bool gotLense; // 0x49
bool gotDegrimer; // 0x4a
bool field4c; // 0x4c
bool putCapsuleInMedicalMachine; // 0x4c
bool muddUnconscious; // 0x4d
byte field4e; // 0x4e
byte muddState; // 0x4e
bool muddInhaledGas; // 0x4f

bool enteredRoom0ForFirstTime; // 0x54
@@ -1257,6 +1257,40 @@ class Room {

// MUDD3
void mudd3Tick1();
void mudd3UseCommunicator();
void mudd3LookAtScreen();
void mudd3UseSTricorderOnScreen();
void mudd3UseKirkOnScreen();
void mudd3UseSpockOnSphere();
void mudd3Timer3Expired();
void mudd3UseMccoyOnSphere();
void mudd3UseRedshirtOnSphere();
void mudd3UseMTricorderOnSphere();
void mudd3UseSTricorderOnSphere();
void mudd3ReadyToHookUpTricorders();
void mudd3Timer1Expired();
void mudd3Timer2Expired();
void mudd3Timer4Expired();
void mudd3UseMemoryDiskOnSphere();
void mudd3GetRepairTool();
void mudd3ReachedRepairTool();
void mudd3PickedUpRepairTool();
void mudd3LookAtSphere();
void mudd3WalkToNorthDoor();
void mudd3TouchedHotspot0();
void mudd3WalkToEastDoor();
void mudd3TouchedHotspot1();
void mudd3LookAtKirk();
void mudd3LookAtSpock();
void mudd3LookAtMccoy();
void mudd3LookAtRedshirt();
void mudd3LookAtMudd();
void mudd3TalkToKirk();
void mudd3TalkToSpock();
void mudd3TalkToMccoy();
void mudd3TalkToRedshirt();
void mudd3TalkToMudd();
void mudd3UseMedkit();

// MUDD4
void mudd4Tick1();
@@ -1373,6 +1407,10 @@ class Room {
} love;

struct {
// mudd3
bool suggestedUsingTricorders; // 0xca
bool tricordersUnavailable; // 0xcb

// common
byte walkingToDoor;
} mudd;
@@ -1569,7 +1569,50 @@ RoomAction mudd2ActionList[] = {

RoomAction mudd3ActionList[] = {
{ Action(ACTION_TICK, 1, 0, 0), &Room::mudd3Tick1 },
{ Action(ACTION_USE, OBJECT_ICOMM, -1, 0), &Room::mudd3UseCommunicator },
{ Action(ACTION_LOOK, 0x20, 0, 0), &Room::mudd3LookAtScreen },
{ Action(ACTION_USE, OBJECT_ISTRICOR, 0x20, 0), &Room::mudd3UseSTricorderOnScreen },
{ Action(ACTION_USE, OBJECT_KIRK, 0x20, 0), &Room::mudd3UseKirkOnScreen },
{ Action(ACTION_USE, OBJECT_SPOCK, 0x21, 0), &Room::mudd3UseSpockOnSphere },
{ Action(ACTION_TIMER_EXPIRED, 3, 0, 0), &Room::mudd3Timer3Expired },
{ Action(ACTION_USE, OBJECT_MCCOY, 0x21, 0), &Room::mudd3UseMccoyOnSphere },
{ Action(ACTION_USE, OBJECT_REDSHIRT, 0x21, 0), &Room::mudd3UseRedshirtOnSphere },
{ Action(ACTION_USE, OBJECT_IMTRICOR, 0x21, 0), &Room::mudd3UseMTricorderOnSphere },
{ Action(ACTION_USE, OBJECT_ISTRICOR, 0x21, 0), &Room::mudd3UseSTricorderOnSphere },
{ Action(ACTION_FINISHED_WALKING, 2, 0, 0), &Room::mudd3ReadyToHookUpTricorders },
{ Action(ACTION_TIMER_EXPIRED, 1, 0, 0), &Room::mudd3Timer1Expired },
{ Action(ACTION_TIMER_EXPIRED, 2, 0, 0), &Room::mudd3Timer2Expired },
{ Action(ACTION_TIMER_EXPIRED, 4, 0, 0), &Room::mudd3Timer4Expired },
{ Action(ACTION_USE, OBJECT_IDISKS, 0x21, 0), &Room::mudd3UseMemoryDiskOnSphere },

// Common code
{ Action(ACTION_USE, OBJECT_IDEGRIME, -1, 0), &Room::mudd0UseDegrimer },
{ 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_GET, 13, 0, 0), &Room::mudd3GetRepairTool },
{ Action(ACTION_FINISHED_WALKING, 3, 0, 0), &Room::mudd3ReachedRepairTool },
{ Action(ACTION_FINISHED_ANIMATION, 1, 0, 0), &Room::mudd3PickedUpRepairTool },
{ Action(ACTION_LOOK, 0x21, 0, 0), &Room::mudd3LookAtSphere },
{ Action(ACTION_WALK, 0x22, 0, 0), &Room::mudd3WalkToNorthDoor },
{ Action(ACTION_TOUCHED_HOTSPOT, 0, 0, 0), &Room::mudd3TouchedHotspot0 },
{ Action(ACTION_WALK, 0x23, 0, 0), &Room::mudd3WalkToEastDoor },
{ Action(ACTION_TOUCHED_HOTSPOT, 1, 0, 0), &Room::mudd3TouchedHotspot1 },
{ Action(ACTION_LOOK, OBJECT_KIRK, 0, 0), &Room::mudd3LookAtKirk },
{ Action(ACTION_LOOK, OBJECT_SPOCK, 0, 0), &Room::mudd3LookAtSpock },
{ Action(ACTION_LOOK, OBJECT_MCCOY, 0, 0), &Room::mudd3LookAtMccoy },
{ Action(ACTION_LOOK, OBJECT_REDSHIRT, 0, 0), &Room::mudd3LookAtRedshirt },
{ Action(ACTION_LOOK, 8, 0, 0), &Room::mudd3LookAtMudd },
{ Action(ACTION_TALK, OBJECT_KIRK, 0, 0), &Room::mudd3TalkToKirk },
{ Action(ACTION_TALK, OBJECT_SPOCK, 0, 0), &Room::mudd3TalkToSpock },
{ Action(ACTION_TALK, OBJECT_MCCOY, 0, 0), &Room::mudd3TalkToMccoy },
{ Action(ACTION_TALK, OBJECT_REDSHIRT, 0, 0), &Room::mudd3TalkToRedshirt },
{ Action(ACTION_TALK, 8, 0, 0), &Room::mudd3TalkToMudd },
{ Action(ACTION_USE, OBJECT_IMEDKIT, -1, 0), &Room::mudd3UseMedkit },
// TODO: remainder? something about losing atmosphere?
};

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

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


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

_vm->_awayMission.disableInput = true;
@@ -191,13 +192,13 @@ 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
// Identical (?) audio files: TX_MUD0_002, TX_MUD1_002, TX_MUD2_002
}
}


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

@@ -69,9 +69,9 @@ void Room::mudd2Tick1() {
_vm->_awayMission.crewDirectionsAfterWalk[OBJECT_REDSHIRT] = DIR_W;
_vm->_awayMission.mudd.muddDroppedCapsule = false;

if (_vm->_awayMission.mudd.field4e == 0) {
_vm->_awayMission.mudd.field4e = 0;
} else if (_vm->_awayMission.mudd.field4e == 2) {
if (_vm->_awayMission.mudd.muddState == 0) {
_vm->_awayMission.mudd.muddState = 0;
} else if (_vm->_awayMission.mudd.muddState == 2) {
_vm->_awayMission.mudd.muddDroppedCapsule = true;
if (!_vm->_awayMission.mudd.muddUnconscious) {
_vm->_awayMission.mudd.muddUnconscious = false;
@@ -80,16 +80,16 @@ void Room::mudd2Tick1() {
} else {
loadActorAnim2(OBJECT_MUDD, "s4sbob", 0x9f, 0xba);
}
} else if (_vm->_awayMission.mudd.field3f) {
_vm->_awayMission.mudd.field4e = 0;
} else if (_vm->_awayMission.mudd.field4e == 1) {
} else if (_vm->_awayMission.mudd.muddCurrentlyInsane) {
_vm->_awayMission.mudd.muddState = 0;
} else if (_vm->_awayMission.mudd.muddState == 1) {
playMidiMusicTracks(3);
loadActorAnim2(OBJECT_MUDD, "s4sbhw", 0x99, 0xbf);
_vm->_awayMission.disableInput = 2;
_vm->_awayMission.mudd.muddInhaledGas = true;
_vm->_awayMission.timers[1] = 70;
_vm->_awayMission.mudd.field4e = 2;
_vm->_awayMission.mudd.field3f = true;
_vm->_awayMission.mudd.muddState = 2;
_vm->_awayMission.mudd.muddCurrentlyInsane = true;
}
}

@@ -107,7 +107,7 @@ void Room::mudd2UseSpockOnCapsules() {

void Room::mudd2GetCapsules() {
if (!_vm->_awayMission.mudd.muddInhaledGas || _vm->_awayMission.mudd.muddUnconscious) {
if (!_vm->_awayMission.mudd.field36)
if (!_vm->_awayMission.mudd.translatedAlienLanguage)
showText(TX_SPEAKER_MCCOY, TX_MUD2_024);
else
walkCrewmanC(OBJECT_MCCOY, 0x9f, 0xbf, &Room::mudd2MccoyReachedCapsules);
@@ -149,7 +149,7 @@ void Room::mudd2UseCapsuleOnControlPanel() {
}

void Room::mudd2MccoyReachedControlPanel() {
if (_vm->_awayMission.mudd.field36)
if (_vm->_awayMission.mudd.translatedAlienLanguage)
showText(TX_SPEAKER_MCCOY, TX_MUD2_014);
else
loadActorAnimC(OBJECT_MCCOY, "musehn", -1, -1, &Room::mudd2MccoyPutCapsuleInControlPanel);
@@ -164,15 +164,17 @@ void Room::mudd2MccoyPutCapsuleInControlPanel() {
if (_vm->_awayMission.mudd.muddUnconscious)
showText(TX_SPEAKER_MCCOY, TX_MUD2_034);

_vm->_awayMission.mudd.putCapsuleInMedicalMachine = true;

loseItem(OBJECT_ICAPSULE);
_vm->_awayMission.crewDirectionsAfterWalk[OBJECT_MCCOY] = DIR_W;
walkCrewman(OBJECT_MCCOY, 0xfe, 0xb2);
}

void Room::mudd2UseKirkOnBed() {
if (!_vm->_awayMission.mudd.field4c && !_vm->_awayMission.mudd.field36) {
if (!_vm->_awayMission.mudd.putCapsuleInMedicalMachine && !_vm->_awayMission.mudd.translatedAlienLanguage) {
walkCrewmanC(OBJECT_KIRK, 0xd7, 0xbd, &Room::mudd2KirkReachedBed);
} else if (_vm->_awayMission.mudd.field36) {
} else if (_vm->_awayMission.mudd.translatedAlienLanguage) {
walkCrewman(OBJECT_KIRK, 0xd7, 0xbd, 7); // BUG(?): no continuation?
}
}
@@ -293,9 +295,9 @@ void Room::mudd2UseMedkitOnMudd() {
if (!_vm->_awayMission.mudd.muddInhaledGas)
return;
else if (_vm->_awayMission.mudd.muddUnconscious) {
if (!_vm->_awayMission.mudd.field36)
if (!_vm->_awayMission.mudd.translatedAlienLanguage)
showText(TX_SPEAKER_MCCOY, TX_MUD2_015);
else if (!_vm->_awayMission.mudd.field4c)
else if (!_vm->_awayMission.mudd.putCapsuleInMedicalMachine)
showText(TX_SPEAKER_MCCOY, TX_MUD2_021);
else
walkCrewmanC(OBJECT_MCCOY, 0xde, 0xaf, &Room::mudd2MccoyReachedMudd);
@@ -310,8 +312,8 @@ void Room::mudd2MccoyReachedMudd() {
}

void Room::mudd2MccoyCuredMudd() {
_vm->_awayMission.mudd.field3f = false;
_vm->_awayMission.mudd.field4e = 3;
_vm->_awayMission.mudd.muddCurrentlyInsane = false;
_vm->_awayMission.mudd.muddState = 3;
_vm->_awayMission.mudd.muddDroppedCapsule = false;
_vm->_awayMission.mudd.muddInhaledGas = false;

Oops, something went wrong.

0 comments on commit 0879985

Please sign in to comment.