Permalink
Browse files

STARTREK: MUDD2

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

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

void StarTrekEngine::runAwayMission() {
@@ -192,14 +192,21 @@ struct AwayMission {
byte field29; // 0x29
bool torpedoLoaded; // 0x33
bool knowAboutTorpedo; // 0x34
bool field36; // 0x36
bool muddDroppedCapsule; // 0x39

// 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 gotMemoryDisk; // 0x48
bool gotLense; // 0x49
bool gotDegrimer; // 0x4a
bool field4c; // 0x4c
bool muddUnconscious; // 0x4d
byte field4e; // 0x4e
bool muddInhaledGas; // 0x4f

bool enteredRoom0ForFirstTime; // 0x54
bool gotPointsForLoadingTorpedo; // 0x55
@@ -1207,7 +1207,53 @@ class Room {
void mudd1TouchedHotspot0();

// MUDD2
void mudd2WalkToNorthDoor();
void mudd2TouchedHotspot0();
void mudd2WalkToSouthDoor();
void mudd2TouchedHotspot1();
void mudd2Tick1();
void mudd2Timer1Expired();
void mudd2UseSTricorderAnywhere();
void mudd2UseSpockOnCapsules();
void mudd2GetCapsules();
void mudd2MccoyReachedCapsules();
void mudd2MccoyPickedUpCapsules();
void mudd2UseCommunicator();
void mudd2LookAtCapsules();
void mudd2UseMTricorderOnCapsules();
void mudd2UseCapsuleOnControlPanel();
void mudd2MccoyReachedControlPanel();
void mudd2MccoyPutCapsuleInControlPanel();
void mudd2UseKirkOnBed();
void mudd2KirkReachedBed();
void mudd2MuddNoticedKirk();
void mudd2MuddDroppedCapsule();
void mudd2UsePhaserOnMudd();
void mudd2UseSpockOnMudd();
void mudd2SpockReachedMudd();
void mudd2SpockPinchedMudd();
void mudd2UseKirkOnMudd();
void mudd2UseRedshirtOnMudd();
void mudd2RedshirtReachedMudd();
void mudd2Timer2Expired();
void mudd2MuddFinishedPushingRedshirt();
void mudd2RedshirtPushedAway();
void mudd2UseMTricorderOnMudd();
void mudd2UseMedkitOnMudd();
void mudd2MccoyReachedMudd();
void mudd2MccoyCuredMudd();
void mudd2LookAtKirk();
void mudd2LookAtSpock();
void mudd2LookAtMccoy();
void mudd2LookAtRedshirt();
void mudd2LookAtMudd();
void mudd2LookAtControlPanel();
void mudd2LookAtBed();
void mudd2TalkToKirk();
void mudd2TalkToSpock();
void mudd2TalkToMccoy();
void mudd2TalkToRedshirt();
void mudd2TalkToMudd();

// MUDD3
void mudd3Tick1();
@@ -1460,10 +1460,10 @@ RoomAction mudd1ActionList[] = {
{ Action(ACTION_FINISHED_ANIMATION, 4, 0, 0), &Room::mudd1SpockPressedRedButton },

// 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_USE, OBJECT_IDEGRIME, -1, 0), &Room::mudd0UseDegrimer },

{ Action(ACTION_GET, 9, 0, 0), &Room::mudd1GetTorpedo },
{ Action(ACTION_GET, 0x21, 0, 0), &Room::mudd1GetTorpedo },
@@ -1504,8 +1504,69 @@ RoomAction mudd1ActionList[] = {
};

RoomAction mudd2ActionList[] = {
{ Action(ACTION_WALK, 0x21, 0, 0), &Room::mudd2WalkToNorthDoor },
{ Action(ACTION_TOUCHED_HOTSPOT, 0, 0, 0), &Room::mudd2TouchedHotspot0 },
{ Action(ACTION_WALK, 0x22, 0, 0), &Room::mudd2WalkToSouthDoor },
{ Action(ACTION_TOUCHED_HOTSPOT, 1, 0, 0), &Room::mudd2TouchedHotspot1 },
{ Action(ACTION_TICK, 1, 0, 0), &Room::mudd2Tick1 },
{ Action(ACTION_TIMER_EXPIRED, 1, 0, 0), &Room::mudd2Timer1Expired },
{ Action(ACTION_USE, OBJECT_ISTRICOR, -1, 0), &Room::mudd2UseSTricorderAnywhere },
{ Action(ACTION_USE, OBJECT_SPOCK, 0x20, 0), &Room::mudd2UseSpockOnCapsules },
{ Action(ACTION_GET, 0x20, 0, 0), &Room::mudd2GetCapsules },
{ Action(ACTION_FINISHED_WALKING, 12, 0, 0), &Room::mudd2MccoyReachedCapsules },
{ Action(ACTION_FINISHED_ANIMATION, 13, 0, 0), &Room::mudd2MccoyPickedUpCapsules },
{ Action(ACTION_USE, OBJECT_ICOMM, -1, 0), &Room::mudd2UseCommunicator },

// 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, 18, 0, 0), &Room::mudd0FiredAlienDevice },

{ Action(ACTION_LOOK, 0x20, 0, 0), &Room::mudd2LookAtCapsules },
{ Action(ACTION_USE, OBJECT_IMTRICOR, 0x20, 0), &Room::mudd2UseMTricorderOnCapsules },
{ Action(ACTION_USE, OBJECT_ICAPSULE, 0x23, 0), &Room::mudd2UseCapsuleOnControlPanel },
{ Action(ACTION_FINISHED_WALKING, 15, 0, 0), &Room::mudd2MccoyReachedControlPanel },
{ Action(ACTION_FINISHED_ANIMATION, 15, 0, 0), &Room::mudd2MccoyPutCapsuleInControlPanel },
{ Action(ACTION_USE, OBJECT_KIRK, 0x24, 0), &Room::mudd2UseKirkOnBed },
{ Action(ACTION_USE, OBJECT_KIRK, 0x25, 0), &Room::mudd2UseKirkOnBed },
{ Action(ACTION_FINISHED_WALKING, 6, 0, 0), &Room::mudd2KirkReachedBed },
{ Action(ACTION_FINISHED_ANIMATION, 1, 0, 0), &Room::mudd2MuddNoticedKirk },
{ Action(ACTION_FINISHED_ANIMATION, 2, 0, 0), &Room::mudd2MuddDroppedCapsule },
{ Action(ACTION_USE, OBJECT_IPHASERS, 8, 0), &Room::mudd2UsePhaserOnMudd },
{ Action(ACTION_USE, OBJECT_IPHASERK, 8, 0), &Room::mudd2UsePhaserOnMudd },

{ Action(ACTION_USE, OBJECT_SPOCK, 8, 0), &Room::mudd2UseSpockOnMudd },
{ Action(ACTION_FINISHED_WALKING, 4, 0, 0), &Room::mudd2SpockReachedMudd },
{ Action(ACTION_FINISHED_ANIMATION, 5, 0, 0), &Room::mudd2SpockPinchedMudd },
{ Action(ACTION_USE, OBJECT_KIRK, 8, 0), &Room::mudd2UseKirkOnMudd },

{ Action(ACTION_USE, OBJECT_REDSHIRT, 8, 0), &Room::mudd2UseRedshirtOnMudd },
{ Action(ACTION_FINISHED_WALKING, 16, 0, 0), &Room::mudd2RedshirtReachedMudd },
{ Action(ACTION_TIMER_EXPIRED, 2, 0, 0), &Room::mudd2Timer2Expired },
{ Action(ACTION_FINISHED_ANIMATION, 17, 0, 0), &Room::mudd2MuddFinishedPushingRedshirt },
{ Action(ACTION_FINISHED_ANIMATION, 16, 0, 0), &Room::mudd2RedshirtPushedAway },
{ Action(ACTION_USE, OBJECT_IMTRICOR, 8, 0), &Room::mudd2UseMTricorderOnMudd },
{ Action(ACTION_USE, OBJECT_IMEDKIT, 8, 0), &Room::mudd2UseMedkitOnMudd },
{ Action(ACTION_USE, OBJECT_MCCOY, 8, 0), &Room::mudd2UseMedkitOnMudd },
{ Action(ACTION_FINISHED_WALKING, 10, 0, 0), &Room::mudd2MccoyReachedMudd },
{ Action(ACTION_FINISHED_ANIMATION, 11, 0, 0), &Room::mudd2MccoyCuredMudd },
{ Action(ACTION_LOOK, OBJECT_KIRK, 0, 0), &Room::mudd2LookAtKirk },
{ Action(ACTION_LOOK, OBJECT_SPOCK, 0, 0), &Room::mudd2LookAtSpock },
{ Action(ACTION_LOOK, OBJECT_MCCOY, 0, 0), &Room::mudd2LookAtMccoy },
{ Action(ACTION_LOOK, OBJECT_REDSHIRT, 0, 0), &Room::mudd2LookAtRedshirt },
{ Action(ACTION_LOOK, 8, 0, 0), &Room::mudd2LookAtMudd },
{ Action(ACTION_LOOK, 0x23, 0, 0), &Room::mudd2LookAtControlPanel },
{ Action(ACTION_LOOK, 0x25, 0, 0), &Room::mudd2LookAtBed },
{ Action(ACTION_LOOK, 0x24, 0, 0), &Room::mudd2LookAtBed },
{ Action(ACTION_TALK, OBJECT_KIRK, 0, 0), &Room::mudd2TalkToKirk },
{ Action(ACTION_TALK, OBJECT_SPOCK, 0, 0), &Room::mudd2TalkToSpock },
{ Action(ACTION_TALK, OBJECT_MCCOY, 0, 0), &Room::mudd2TalkToMccoy },
{ Action(ACTION_TALK, OBJECT_REDSHIRT, 0, 0), &Room::mudd2TalkToRedshirt },
{ Action(ACTION_TALK, 8, 0, 0), &Room::mudd2TalkToMudd },
// TODO: remainder? something about losing atmosphere?
};

RoomAction mudd3ActionList[] = {
{ Action(ACTION_TICK, 1, 0, 0), &Room::mudd3Tick1 },
};
@@ -165,17 +165,23 @@ void Room::mudd0UseLenseOnDegrimer() {

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


void Room::mudd0UseAlienDevice() {
const int deviceObjectIndices[] = {
9, // MUDD0
13, // MUDD1
11, // MUDD2
};

_vm->_awayMission.disableInput = true;

_vm->_awayMission.crewDirectionsAfterWalk[OBJECT_KIRK] = DIR_S;
loadActorStandAnim(OBJECT_KIRK);
Common::Point pos = getActorPos(OBJECT_KIRK);
loadActorAnimC(OBJECT_ALIENDV, "s4cbxp", pos.x, 10, &Room::mudd0FiredAlienDevice);
loadActorAnimC(deviceObjectIndices[_roomIndex], "s4cbxp", pos.x, 10, &Room::mudd0FiredAlienDevice);
playVoc("EXPLO3");
}

@@ -191,7 +197,7 @@ void Room::mudd0FiredAlienDevice() {


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

@@ -156,7 +156,7 @@ void Room::mudd1SpockPressedRedButton() {
const int choices[] = {
TX_SPEAKER_KIRK,
TX_MUD1_004,
TX_MUD1_003,
TX_MUD1_003,
TX_MUD1_007,
TX_BLANK
};
@@ -313,7 +313,7 @@ void Room::mudd1WalkToWestDoor() {
walkCrewman(OBJECT_KIRK, 0x35, 0x71);
}

void Room::mudd1TouchedHotspot0() {
void Room::mudd1TouchedHotspot0() { // Trigger door at west of room
if (_roomVar.mudd.walkingToDoor == 2) {
playVoc("SMADOOR3");
loadActorAnim(OBJECT_WEST_DOOR, "s4wbd2", 0x37, 0x73);
Oops, something went wrong.

0 comments on commit c471503

Please sign in to comment.