Permalink
Browse files

STARTREK: Most of LOVE2 done

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

// Load crew positions for beaming in
initAwayCrewPositions(4);
initAwayCrewPositions(0);
}

void StarTrekEngine::runAwayMission() {
@@ -149,12 +149,18 @@ struct AwayMission {
bool freezerOpen; // 0x2f
bool chamberHasDish; // 0x30
byte bottleInNozzle; // 0x31
byte field36; // 0x36
byte field37; // 0x37
bool cabinetOpen; // 0x32
bool gasFeedOn; // 0x33
byte synthesizerProduct; // 0x34
byte field35; // 0x35
byte canister1; // 0x36
byte canister2; // 0x37
bool field41; // 0x41
bool spockAccessedConsole; // 0x49
bool mccoyAccessedConsole; // 0x4a
bool gotPolyberylcarbonate; // 0x4b
bool gotTLDH; // 0x4c (Got romulan laughing gas)
bool gotCure; // 0x4f
int16 missionScore; // 0x52
} love;
};
@@ -170,4 +176,12 @@ enum BottleTypes {
BOTTLETYPE_RLG = 4 // Romulan Laughing Gas
};

// Canister types for Love's Labor Jeopardized
enum CanisterTypes {
CANTYPE_NONE = 0,
CANTYPE_O2 = 1,
CANTYPE_H2 = 2,
CANTYPE_N2 = 3
};

#endif
@@ -347,6 +347,10 @@ void Room::showBitmapFor5Ticks(const Common::String &bmpName, int priority) {
_vm->_gfx->delSprite(&sprite);
}

bool Room::haveItem(int item) {
return _vm->_itemList[item - 0x40].have;
}

Common::Point Room::getActorPos(int actorIndex) {
return _vm->_actorList[actorIndex].pos;
}
@@ -112,6 +112,7 @@ class Room {
void loadMapFile(const Common::String &name); // Cmd 0x09
void showBitmapFor5Ticks(const Common::String &bmpName, int priority); // Cmd 0x0a
// Command 0x0c: "demon6ShowCase"
bool haveItem(int item); // Cmd 0x0b
Common::Point getActorPos(int actorIndex); // Cmd 0x0d
int16 getRandomWordInRange(int start, int end); // Cmd 0x0e
void playSoundEffectIndex(int soundEffect); // Cmd 0x0f
@@ -843,6 +844,97 @@ class Room {

// LOVE2
void love2Tick1();
void love2TouchedWarp1();
void love2Timer3Expired();
void love2WalkToDoor();
void love2TouchedHotspot0();
void love2DoorReachedOrOpened();
void love2LookAtCabinet();
void love2LookAtDoor();
void love2LookAtSynthesizer();
void love2LookAtAnywhere();
void love2LookAtAntigrav();
void love2LookAtMccoy();
void love2LookAtSpock();
void love2LookAtRedshirt();
void love2LookAtKirk();
void love2LookAtArdak();
void love2LookAtChamber();
void love2LookAtCan1();
void love2LookAtCan2();
void love2TalkToKirk();
void love2TalkToSpock();
void love2TalkToMccoy();
void love2TalkToRedshirt();
void love2UseMTricorderAnywhere();
void love2UseSTricorderAnywhere();
void love2UseKirkOnCabinet();
void love2UseSpockOnCabinet();
void love2UseMccoyOnCabinet();
void love2UseRedshirtOnCabinet();
void love2CrewmanReachedCabinet();
void love2CrewmanAccessedCabinet();
void love2CrewmanOpenedOrClosedCabinet();
void love2UseWrenchOnGasFeed();
void love2ReachedGasFeed();
void love2ChangedGasFeed();
void love2UseO2GasOnCanisterSlot();
void love2UseH2GasOnCanisterSlot();
void love2UseN2GasOnCanisterSlot();
void love2ReachedCanisterSlot();
void love2PutCanisterInSlot1();
void love2PutCanisterInSlot2();
void love2UseAntigravOnCanister1();
void love2ReachedCanisterSlot1ToGet();
void love2TookCanister1();
void love2UseAntigravOnCanister2();
void love2ReachedCanisterSlot2ToGet();
void love2TookCanister2();
void love2UseKirkOnSynthesizer();
void love2UseSpockOnSynthesizer();
void love2UseMccoyOnSynthesizer();
void love2UseRedshirtOnSynthesizer();
void love2CrewmanReachedSynthesizer();
void love2CrewmanUsedSynthesizer();
void love2SpockReachedGasFeeds();
void love2SpockEnabledGasFeeds();
void love2UseSynthesizer();
void love2SynthesizerDoorClosed();
void love2SynthesizerFinished();
void love2FinishedAnimation27();
void love2UsePolyberylcarbonateOnSynthesizerDoor();
void love2KirkReachedSynthesizerWithPolyberylcarbonate();
void love2SynthesizerDoorOpenedWithPolyberylcarbonate();
void love2PutPolyberylcarbonateInSynthesizer();
void love2UseDishesOnSynthesizerDoor();
void love2KirkReachedSynthesizerWithDishes();
void love2SynthesizerDoorOpenedWithDishes();
void love2PutDishesInSynthesizer();
void love2UseSampleOnSynthesizerDoor();
void love2KirkReachedSynthesizerWithSample();
void love2SynthesizerDoorOpenedWithSample();
void love2PutSampleInSynthesizer();
void love2UseAnythingOnSynthesizerDoor();
void love2UseAnythingOnSynthesizer();
void love2GetCanister();
void love2GetAntigrav();
void love2ReachedAntigrav();
void love2GotAntigrav();
void love2GetPolyberylcarbonate();
void love2ReachedPolyberylcarbonate();
void love2GotPolyberylcarbonate();
void love2GetDishes();
void love2ReachedDishes();
void love2GotDishes();
void love2GetSample();
void love2ReachedSample();
void love2GotSample();
void love2GetSynthesizerOutput();
void love2ReachedSynthesizerOutput();
void love2GotSynthesizerOutput();
void love2GetCure();
void love2ReachedCure();
void love2GotCure();

// LOVE3
void love3Tick1();
@@ -947,6 +1039,21 @@ class Room {
byte _1d2b; // 0x1d2b
} love1;

struct {
byte canisterType; // 0xca
byte cb; // 0xcb
bool walkingToDoor; // 0xcc
byte doorOpenCounter; // 0xcd
int16 canisterItem; // 0xce
char canisterAnim[10]; // 0xd0
int16 d2; // 0xd2
char d6[10]; // 0xd6
char d8[10]; // 0xd8
byte _2966; // 0x2966
byte _2967; // 0x2967
} love2;


} _roomVar;
};

@@ -946,6 +946,119 @@ RoomAction love1ActionList[] = {

RoomAction love2ActionList[] = {
{ Action(ACTION_TICK, 1, 0, 0), &Room::love2Tick1 },
{ Action(ACTION_TOUCHED_WARP, 1, 0, 0), &Room::love2TouchedWarp1 },
{ Action(ACTION_TIMER_EXPIRED, 3, 0, 0), &Room::love2Timer3Expired },
{ Action(ACTION_WALK, 10, 0, 0), &Room::love2WalkToDoor },
{ Action(ACTION_WALK, 0x22, 0, 0), &Room::love2WalkToDoor },
{ Action(ACTION_TOUCHED_HOTSPOT, 0, 0, 0), &Room::love2TouchedHotspot0 },
{ Action(ACTION_FINISHED_WALKING, 14, 0, 0), &Room::love2DoorReachedOrOpened },
{ Action(ACTION_FINISHED_ANIMATION, 1, 0, 0), &Room::love2DoorReachedOrOpened },
{ Action(ACTION_LOOK, 8, 0, 0), &Room::love2LookAtCabinet },
{ Action(ACTION_LOOK, 10, 0, 0), &Room::love2LookAtDoor },
{ Action(ACTION_LOOK, 0x20, 0, 0), &Room::love2LookAtSynthesizer },
{ Action(ACTION_LOOK, -1, 0, 0), &Room::love2LookAtAnywhere },
{ Action(ACTION_LOOK, 14, 0, 0), &Room::love2LookAtAntigrav },
{ Action(ACTION_LOOK, OBJECT_MCCOY, 0, 0), &Room::love2LookAtMccoy },
{ Action(ACTION_LOOK, OBJECT_SPOCK, 0, 0), &Room::love2LookAtSpock },
{ Action(ACTION_LOOK, OBJECT_REDSHIRT, 0, 0), &Room::love2LookAtRedshirt },
{ Action(ACTION_LOOK, OBJECT_KIRK, 0, 0), &Room::love2LookAtKirk },
{ Action(ACTION_LOOK, 0x21, 0, 0), &Room::love2LookAtArdak },
{ Action(ACTION_LOOK, 15, 0, 0), &Room::love2LookAtChamber },
{ Action(ACTION_LOOK, 16, 0, 0), &Room::love2LookAtChamber },
{ Action(ACTION_LOOK, 18, 0, 0), &Room::love2LookAtChamber },
{ Action(ACTION_LOOK, 19, 0, 0), &Room::love2LookAtChamber },
{ Action(ACTION_LOOK, 17, 0, 0), &Room::love2LookAtChamber },
{ Action(ACTION_LOOK, 9, 0, 0), &Room::love2LookAtChamber },
{ Action(ACTION_LOOK, 12, 0, 0), &Room::love2LookAtCan1 },
{ Action(ACTION_LOOK, 13, 0, 0), &Room::love2LookAtCan2 },
{ Action(ACTION_TALK, OBJECT_KIRK, 0, 0), &Room::love2TalkToKirk },
{ Action(ACTION_TALK, OBJECT_SPOCK, 0, 0), &Room::love2TalkToSpock },
{ Action(ACTION_TALK, OBJECT_MCCOY, 0, 0), &Room::love2TalkToMccoy },
{ Action(ACTION_TALK, OBJECT_REDSHIRT, 0, 0), &Room::love2TalkToRedshirt },
{ Action(ACTION_USE, OBJECT_IMTRICOR, -1, 0), &Room::love2UseMTricorderAnywhere },
{ Action(ACTION_USE, OBJECT_ISTRICOR, -1, 0), &Room::love2UseSTricorderAnywhere },
{ Action(ACTION_USE, OBJECT_KIRK, 8, 0), &Room::love2UseKirkOnCabinet },
{ Action(ACTION_USE, OBJECT_SPOCK, 8, 0), &Room::love2UseSpockOnCabinet },
{ Action(ACTION_USE, OBJECT_MCCOY, 8, 0), &Room::love2UseMccoyOnCabinet },
{ Action(ACTION_USE, OBJECT_REDSHIRT, 8, 0), &Room::love2UseRedshirtOnCabinet },
{ Action(ACTION_FINISHED_WALKING, 12, 0, 0), &Room::love2CrewmanReachedCabinet },
{ Action(ACTION_FINISHED_ANIMATION, 11, 0, 0), &Room::love2CrewmanAccessedCabinet },
{ Action(ACTION_FINISHED_ANIMATION, 2, 0, 0), &Room::love2CrewmanOpenedOrClosedCabinet },
{ Action(ACTION_USE, OBJECT_IWRENCH, 11, 0), &Room::love2UseWrenchOnGasFeed },
{ Action(ACTION_FINISHED_WALKING, 1, 0, 0), &Room::love2ReachedGasFeed },
{ Action(ACTION_FINISHED_ANIMATION, 12, 0, 0), &Room::love2ChangedGasFeed },
{ Action(ACTION_USE, OBJECT_IO2GAS, 0x23, 0), &Room::love2UseO2GasOnCanisterSlot },
{ Action(ACTION_USE, OBJECT_IH2GAS, 0x23, 0), &Room::love2UseH2GasOnCanisterSlot },
{ Action(ACTION_USE, OBJECT_IN2GAS, 0x23, 0), &Room::love2UseN2GasOnCanisterSlot },
{ Action(ACTION_FINISHED_WALKING, 3, 0, 0), &Room::love2ReachedCanisterSlot },
{ Action(ACTION_FINISHED_ANIMATION, 13, 0, 0), &Room::love2PutCanisterInSlot1 },
{ Action(ACTION_FINISHED_ANIMATION, 14, 0, 0), &Room::love2PutCanisterInSlot2 },
{ Action(ACTION_USE, OBJECT_IANTIGRA, 12, 0), &Room::love2UseAntigravOnCanister1 },
{ Action(ACTION_FINISHED_WALKING, 4, 0, 0), &Room::love2ReachedCanisterSlot1ToGet },
{ Action(ACTION_FINISHED_ANIMATION, 15, 0, 0), &Room::love2TookCanister1 },
{ Action(ACTION_USE, OBJECT_IANTIGRA, 13, 0), &Room::love2UseAntigravOnCanister2 },
{ Action(ACTION_FINISHED_WALKING, 5, 0, 0), &Room::love2ReachedCanisterSlot2ToGet },
{ Action(ACTION_FINISHED_ANIMATION, 16, 0, 0), &Room::love2TookCanister2 },
{ Action(ACTION_USE, OBJECT_KIRK, 0x20, 0), &Room::love2UseKirkOnSynthesizer },
{ Action(ACTION_USE, OBJECT_SPOCK, 0x20, 0), &Room::love2UseSpockOnSynthesizer },
{ Action(ACTION_USE, OBJECT_MCCOY, 0x20, 0), &Room::love2UseMccoyOnSynthesizer },
{ Action(ACTION_USE, OBJECT_REDSHIRT, 0x20, 0), &Room::love2UseRedshirtOnSynthesizer },
{ Action(ACTION_FINISHED_WALKING, 13, 0, 0), &Room::love2CrewmanReachedSynthesizer },
{ Action(ACTION_FINISHED_ANIMATION, 17, 0, 0), &Room::love2CrewmanUsedSynthesizer },
{ Action(ACTION_FINISHED_WALKING, 16, 0, 0), &Room::love2SpockReachedGasFeeds },
{ Action(ACTION_FINISHED_ANIMATION, 18, 0, 0), &Room::love2SpockEnabledGasFeeds },
{ Action(ACTION_FINISHED_ANIMATION, 3, 0, 0), &Room::love2SynthesizerDoorClosed },
{ Action(ACTION_FINISHED_ANIMATION, 4, 0, 0), &Room::love2SynthesizerFinished },
{ Action(ACTION_FINISHED_ANIMATION, 27, 0, 0), &Room::love2FinishedAnimation27 },

// TODO: more

{ Action(ACTION_USE, OBJECT_IPBC, 9, 0), &Room::love2UsePolyberylcarbonateOnSynthesizerDoor },
{ Action(ACTION_FINISHED_WALKING, 6, 0, 0), &Room::love2KirkReachedSynthesizerWithPolyberylcarbonate },
{ Action(ACTION_FINISHED_ANIMATION, 5, 0, 0), &Room::love2SynthesizerDoorOpenedWithPolyberylcarbonate },
{ Action(ACTION_FINISHED_ANIMATION, 19, 0, 0), &Room::love2PutPolyberylcarbonateInSynthesizer },

{ Action(ACTION_USE, OBJECT_IDISHES, 9, 0), &Room::love2UseDishesOnSynthesizerDoor },
{ Action(ACTION_FINISHED_WALKING, 7, 0, 0), &Room::love2KirkReachedSynthesizerWithDishes },
{ Action(ACTION_FINISHED_ANIMATION, 6, 0, 0), &Room::love2SynthesizerDoorOpenedWithDishes },
{ Action(ACTION_FINISHED_ANIMATION, 20, 0, 0), &Room::love2PutDishesInSynthesizer },

{ Action(ACTION_USE, OBJECT_ISAMPLE, 9, 0), &Room::love2UseSampleOnSynthesizerDoor },
{ Action(ACTION_FINISHED_WALKING, 8, 0, 0), &Room::love2KirkReachedSynthesizerWithSample },
{ Action(ACTION_FINISHED_ANIMATION, 7, 0, 0), &Room::love2SynthesizerDoorOpenedWithSample },
{ Action(ACTION_FINISHED_ANIMATION, 21, 0, 0), &Room::love2PutSampleInSynthesizer },

{ Action(ACTION_USE, -1, 9, 0), &Room::love2UseAnythingOnSynthesizerDoor },
{ Action(ACTION_USE, -1, 0x20, 0), &Room::love2UseAnythingOnSynthesizer },
{ Action(ACTION_GET, 13, 0, 0), &Room::love2GetCanister },
{ Action(ACTION_GET, 12, 0, 0), &Room::love2GetCanister },

{ Action(ACTION_GET, 14, 0, 0), &Room::love2GetAntigrav },
{ Action(ACTION_FINISHED_WALKING, 9, 0, 0), &Room::love2ReachedAntigrav },
{ Action(ACTION_FINISHED_ANIMATION, 22, 0, 0), &Room::love2GotAntigrav },

{ Action(ACTION_GET, 16, 0, 0), &Room::love2GetPolyberylcarbonate },
{ Action(ACTION_FINISHED_WALKING, 18, 0, 0), &Room::love2ReachedPolyberylcarbonate },
{ Action(ACTION_FINISHED_ANIMATION, 26, 0, 0), &Room::love2GotPolyberylcarbonate },

{ Action(ACTION_GET, 17, 0, 0), &Room::love2GetDishes },
{ Action(ACTION_FINISHED_WALKING, 17, 0, 0), &Room::love2ReachedDishes },
{ Action(ACTION_FINISHED_ANIMATION, 25, 0, 0), &Room::love2GotDishes },

{ Action(ACTION_GET, 18, 0, 0), &Room::love2GetSample },
{ Action(ACTION_FINISHED_WALKING, 19, 0, 0), &Room::love2ReachedSample },
{ Action(ACTION_FINISHED_ANIMATION, 28, 0, 0), &Room::love2GotSample },

{ Action(ACTION_GET, 15, 0, 0), &Room::love2GetSynthesizerOutput },
{ Action(ACTION_FINISHED_WALKING, 10, 0, 0), &Room::love2ReachedSynthesizerOutput },
{ Action(ACTION_FINISHED_ANIMATION, 23, 0, 0), &Room::love2GotSynthesizerOutput },

// TODO: test these
{ Action(ACTION_GET, 19, 0, 0), &Room::love2GetCure },
{ Action(ACTION_FINISHED_WALKING, 11, 0, 0), &Room::love2ReachedCure },
{ Action(ACTION_FINISHED_ANIMATION, 24, 0, 0), &Room::love2GotCure },

// TODO: common code
};

RoomAction love3ActionList[] = {
@@ -34,8 +34,8 @@ namespace StarTrek {

void Room::love0Tick1() {
if (!_vm->_awayMission.love.alreadyStartedMission) {
_vm->_awayMission.love.field36 = 1;
_vm->_awayMission.love.field37 = 2;
_vm->_awayMission.love.canister1 = CANTYPE_O2;
_vm->_awayMission.love.canister2 = CANTYPE_H2;
_vm->_awayMission.love.alreadyStartedMission = true;
playVoc("LOV0LOOP"); // FIXME: no audio after first entry?
}
Oops, something went wrong.

0 comments on commit dc1e44e

Please sign in to comment.