Permalink
Browse files

STARTREK: MUDD0

  • Loading branch information...
Drenn1 authored and sev- committed Jun 28, 2018
1 parent b332c17 commit 4c0eb3aa67bc5c4381e311c0b37284acb6f7497c
@@ -467,7 +467,9 @@ void StarTrekEngine::handleAwayMissionAction() {
Action action = _actionQueue.pop();

if ((action.type == ACTION_FINISHED_ANIMATION || action.type == ACTION_FINISHED_WALKING) && action.b1 == 0xff) {
_awayMission.disableInput = false;
// Just finished walking or beaming into a room
if (_awayMission.disableInput == 1)
_awayMission.disableInput = false;
_warpHotspotsActive = true;
return;
}
@@ -33,7 +33,12 @@ struct AwayMission {
int16 mouseY; // 0x12
int16 crewGetupTimers[4]; // 0x14
bool disableWalking; // 0x1c
byte disableInput; // 0x1d; Set while beaming in or walking into a room. Disables control?

// 0 / false: input enabled
// 1 / true: input disabled, turns back on after walking or beaming into a room
// 2: input disabled, doesn't turn back on after walking or beaming into room
byte disableInput; // 0x1d

bool redshirtDead; // 0x1e
byte activeAction; // 0x1f
byte activeObject; // 0x20; The item that is going to be used on something
@@ -182,6 +187,20 @@ struct AwayMission {
bool gotPointsForHydratingRomulans; // 0x51
int16 missionScore; // 0x52
} love;

struct {
byte field29; // 0x29

// True if you've combined the lense + degrimer and fired it off, discovering
// it's a weapon
bool discoveredLenseAndDegrimerFunction; // 0x3c
bool gotMemoryDisk; // 0x48
bool gotLense; // 0x49
bool gotDegrimer; // 0x4a

bool enteredRoom0ForFirstTime; // 0x54
int16 missionScore; // 0x5a
} mudd;
};
};
// Size: 0x129 bytes
@@ -37,6 +37,12 @@ MODULE_OBJS = \
rooms/love4.o \
rooms/love5.o \
rooms/lovea.o \
rooms/mudd0.o \
rooms/mudd1.o \
rooms/mudd2.o \
rooms/mudd3.o \
rooms/mudd4.o \
rooms/mudd5.o \



@@ -105,6 +105,30 @@ Room::Room(StarTrekEngine *vm, const Common::String &name) : _vm(vm) {
_roomActionList = love5ActionList;
_numRoomActions = sizeof(love5ActionList) / sizeof(RoomAction);
}
else if (name == "MUDD0") {
_roomActionList = mudd0ActionList;
_numRoomActions = sizeof(mudd0ActionList) / sizeof(RoomAction);
}
else if (name == "MUDD1") {
_roomActionList = mudd1ActionList;
_numRoomActions = sizeof(mudd1ActionList) / sizeof(RoomAction);
}
else if (name == "MUDD2") {
_roomActionList = mudd2ActionList;
_numRoomActions = sizeof(mudd2ActionList) / sizeof(RoomAction);
}
else if (name == "MUDD3") {
_roomActionList = mudd3ActionList;
_numRoomActions = sizeof(mudd3ActionList) / sizeof(RoomAction);
}
else if (name == "MUDD4") {
_roomActionList = mudd4ActionList;
_numRoomActions = sizeof(mudd4ActionList) / sizeof(RoomAction);
}
else if (name == "MUDD5") {
_roomActionList = mudd5ActionList;
_numRoomActions = sizeof(mudd5ActionList) / sizeof(RoomAction);
}
else {
warning("Room \"%s\" unimplemented", name.c_str());
_numRoomActions = 0;
@@ -120,7 +120,7 @@ class Room {
Common::Point getActorPos(int actorIndex); // Cmd 0x0d
int16 getRandomWordInRange(int start, int end); // Cmd 0x0e
void playSoundEffectIndex(int soundEffect); // Cmd 0x0f
void playMidiMusicTracks(int startTrack, int loopTrack); // Cmd 0x10
void playMidiMusicTracks(int startTrack, int loopTrack = -1); // Cmd 0x10
void endMission(int16 score, int16 arg2, int16 arg3); // Cmd 0x11
void showGameOverMenu(); // Cmd 0x12
void playVoc(Common::String filename); // Cmd 0x15
@@ -1118,6 +1118,64 @@ class Room {
void loveaUseAmmonia();
void loveaUseCommunicator();


// MUDD0
void mudd0Tick1();
void mudd0Tick50();
void mudd0Tick60();
void mudd0UsePhaserOnMudd();
void mudd0UseCommunicator();
void mudd0LookAtFoodBox();
void mudd0LookAtComponentBox();
void mudd0LookAnywhere();
void mudd0LookAtMemoryDiskBox();
void mudd0LookAtDegrimerBox();
void mudd0LookAtLense();
void mudd0UseSTricorderAnywhere();
void mudd0UseMTricorderAnywhere();
void mudd0UseSTricorderOnMemoryDiskBox();
void mudd0UseSTricorderOnDegrimerBox();
void mudd0UseMTricorderOnLense();
void mudd0UseLenseOnDegrimer();
void mudd0UseAlienDevice();
void mudd0FiredAlienDevice();
void mudd0UseDegrimer();
void mudd0GetLense();
void mudd0GetMemoryDisk();
void mudd0GetDegrimer();
void mudd0PickedUpLense();
void mudd0PickedUpItem();
void mudd0WalkToSouthDoor();
void mudd0TouchedHotspot1();
void mudd0WalkToNorthDoor();
void mudd0TouchedHotspot0();
void mudd0UseMedkit();
void mudd0LookAtKirk();
void mudd0LookAtSpock();
void mudd0LookAtMccoy();
void mudd0LookAtRedshirt();
void mudd0LookAtMudd();
void mudd0TalkToKirk();
void mudd0TalkToSpock();
void mudd0TalkToMccoy();
void mudd0TalkToRedshirt();
void mudd0TalkToMudd();

// MUDD1
void mudd1Tick1();

// MUDD2
void mudd2Tick1();

// MUDD3
void mudd3Tick1();

// MUDD4
void mudd4Tick1();

// MUDD5
void mudd5Tick1();

private:
// Room-specific variables. This is memset'ed to 0 when the room is initialized.
union {
@@ -1224,6 +1282,11 @@ class Room {
byte cmnYPosToCureSpock;
} love;

struct {
// mudd0
bool walkingToDoor; // 0x22a9
} mudd;


} _roomVar;
};
@@ -28,6 +28,8 @@

namespace StarTrek {

// FIXME: calling a constructor in global scope not allowed in scummvm?

RoomAction demon0ActionList[] = {
{ Action(ACTION_TICK, 1, 0, 0), &Room::demon0Tick1 },
{ Action(ACTION_TICK, 2, 0, 0), &Room::demon0Tick2 },
@@ -1393,6 +1395,66 @@ RoomAction love5ActionList[] = {
{ Action(ACTION_USE, OBJECT_ICOMM, -1, 0), &Room::loveaUseCommunicator },
};

RoomAction mudd0ActionList[] = {
{ Action(ACTION_TICK, 1, 0, 0), &Room::mudd0Tick1 },
{ Action(ACTION_TICK, 50, 0, 0), &Room::mudd0Tick50 },
{ Action(ACTION_TICK, 60, 0, 0), &Room::mudd0Tick60 },
{ Action(ACTION_USE, OBJECT_IPHASERS, 8, 0), &Room::mudd0UsePhaserOnMudd },
{ Action(ACTION_USE, OBJECT_IPHASERK, 8, 0), &Room::mudd0UsePhaserOnMudd },
{ Action(ACTION_USE, OBJECT_ICOMM, -1, 0), &Room::mudd0UseCommunicator },
{ Action(ACTION_LOOK, 0x23, 0, 0), &Room::mudd0LookAtFoodBox },
{ Action(ACTION_LOOK, 0x24, 0, 0), &Room::mudd0LookAtComponentBox },
{ Action(ACTION_LOOK, -1, 0, 0), &Room::mudd0LookAnywhere },
{ Action(ACTION_LOOK, 0x20, 0, 0), &Room::mudd0LookAtMemoryDiskBox },
{ Action(ACTION_LOOK, 0x22, 0, 0), &Room::mudd0LookAtDegrimerBox },
{ Action(ACTION_LOOK, 0x21, 0, 0), &Room::mudd0LookAtLense },
{ Action(ACTION_USE, OBJECT_ISTRICOR, -1, 0), &Room::mudd0UseSTricorderAnywhere },
{ Action(ACTION_USE, OBJECT_IMTRICOR, -1, 0), &Room::mudd0UseMTricorderAnywhere },
{ Action(ACTION_USE, OBJECT_ISTRICOR, 0x20, 0), &Room::mudd0UseSTricorderOnMemoryDiskBox },
{ Action(ACTION_USE, OBJECT_ISTRICOR, 0x22, 0), &Room::mudd0UseSTricorderOnDegrimerBox },
{ Action(ACTION_USE, OBJECT_IMTRICOR, 0x21, 0), &Room::mudd0UseMTricorderOnLense },
{ 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, 0x21, 0, 0), &Room::mudd0GetLense },
{ Action(ACTION_GET, 0x20, 0, 0), &Room::mudd0GetMemoryDisk },
{ Action(ACTION_GET, 0x22, 0, 0), &Room::mudd0GetDegrimer },
{ Action(ACTION_TIMER_EXPIRED, 1, 0, 0), &Room::mudd0PickedUpLense },
{ Action(ACTION_FINISHED_ANIMATION, 1, 0, 0), &Room::mudd0PickedUpItem },
{ Action(ACTION_WALK, 0x26, 0, 0), &Room::mudd0WalkToSouthDoor },
{ Action(ACTION_TOUCHED_HOTSPOT, 1, 0, 0), &Room::mudd0TouchedHotspot1 },
{ Action(ACTION_WALK, 0x25, 0, 0), &Room::mudd0WalkToNorthDoor },
{ Action(ACTION_TOUCHED_HOTSPOT, 0, 0, 0), &Room::mudd0TouchedHotspot0 },
{ Action(ACTION_USE, OBJECT_IMEDKIT, -1, 0), &Room::mudd0UseMedkit },
{ Action(ACTION_LOOK, OBJECT_KIRK, 0, 0), &Room::mudd0LookAtKirk },
{ Action(ACTION_LOOK, OBJECT_SPOCK, 0, 0), &Room::mudd0LookAtSpock },
{ Action(ACTION_LOOK, OBJECT_MCCOY, 0, 0), &Room::mudd0LookAtMccoy },
{ Action(ACTION_LOOK, OBJECT_REDSHIRT, 0, 0), &Room::mudd0LookAtRedshirt },
{ Action(ACTION_LOOK, 8, 0, 0), &Room::mudd0LookAtMudd },
{ Action(ACTION_TALK, OBJECT_KIRK, 0, 0), &Room::mudd0TalkToKirk },
{ Action(ACTION_TALK, OBJECT_SPOCK, 0, 0), &Room::mudd0TalkToSpock },
{ Action(ACTION_TALK, OBJECT_MCCOY, 0, 0), &Room::mudd0TalkToMccoy },
{ Action(ACTION_TALK, OBJECT_REDSHIRT, 0, 0), &Room::mudd0TalkToRedshirt },
{ Action(ACTION_TALK, 8, 0, 0), &Room::mudd0TalkToMudd },
// TODO: remainder? something about losing atmosphere?
};

RoomAction mudd1ActionList[] = {
{ Action(ACTION_TICK, 1, 0, 0), &Room::mudd1Tick1 },
};
RoomAction mudd2ActionList[] = {
{ Action(ACTION_TICK, 1, 0, 0), &Room::mudd2Tick1 },
};
RoomAction mudd3ActionList[] = {
{ Action(ACTION_TICK, 1, 0, 0), &Room::mudd3Tick1 },
};
RoomAction mudd4ActionList[] = {
{ Action(ACTION_TICK, 1, 0, 0), &Room::mudd4Tick1 },
};
RoomAction mudd5ActionList[] = {
{ Action(ACTION_TICK, 1, 0, 0), &Room::mudd5Tick1 },
};

}

Oops, something went wrong.

0 comments on commit 4c0eb3a

Please sign in to comment.