Permalink
Browse files

STARTREK: LOVE4

  • Loading branch information...
Drenn1 authored and sev- committed Jun 22, 2018
1 parent 08ead49 commit 43a0a574ff72c88a4f659f8fd5482a33bcaac8cb
@@ -41,7 +41,7 @@ void StarTrekEngine::initAwayMission() {
_roomIndexToLoad = -1;

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

void StarTrekEngine::runAwayMission() {
@@ -162,7 +162,8 @@ struct AwayMission {
bool field3c; // 0x3c
bool grateRemoved; // 0x3d
bool insulationOnGround; // 0x3e
bool field3f; // 0x3f
bool visitedRoomWithRomulans; // 0x3f
bool romulansCured; // 0x40
bool romulansUnconsciousFromVirus; // 0x41
bool spockAccessedConsole; // 0x49
bool mccoyAccessedConsole; // 0x4a
@@ -171,6 +172,7 @@ struct AwayMission {
bool gotPointsForOpeningGrate; // 0x4d
bool gotPointsForGassingRomulans; // 0x4e
bool gotCure; // 0x4f
bool gotPointsForHydratingRomulans; // 0x51
int16 missionScore; // 0x52
} love;
};
@@ -97,10 +97,10 @@ class Room {


// Interface for room-specific code
void loadActorAnim(int actorIndex, Common::String anim, int16 x, int16 y, uint16 field66); // Cmd 0x00
void loadActorAnim(int actorIndex, Common::String anim, int16 x, int16 y, uint16 field66 = 0); // Cmd 0x00
void loadActorAnimC(int actorIndex, Common::String anim, int16 x, int16 y, void (Room::*funcPtr)());// Cmd 0x00
void loadActorStandAnim(int actorIndex); // Cmd 0x01
void loadActorAnim2(int actorIndex, Common::String anim, int16 x, int16 y, uint16 field66);// Cmd 0x02
void loadActorAnim2(int actorIndex, Common::String anim, int16 x, int16 y, uint16 field66 = 0);// Cmd 0x02
int showRoomSpecificText(const char **textAddr); // (Deprecated, use function below) // Cmd 0x03
int showText(const int *text); // Cmd 0x03
int showText(int speaker, int text); // Cmd 0x03
@@ -1014,6 +1014,42 @@ class Room {

// LOVE4
void love4Tick1();
void love4Tick10();
void love4WalkToDoor();
void love4TouchedHotspot0();
void love4DoorOpenedOrReached();
void love4UseKirkOnLadder();
void love4ReachedLadder();
void love4UseStunPhaserOnRomulan();
void love4LookAnywhere();
void love4LookAtLadder();
void love4LookAtDoor();
void love4LookAtKirk();
void love4LookAtMccoy();
void love4LookAtSpock();
void love4LookAtRedshirt();
void love4LookAtRomulan();
void love4TalkToKirk();
void love4TalkToMccoy();
void love4TalkToRedshirt();
void love4TalkToSpock();
void love4TalkToRomulan();
void love4UseMTricorderOnRomulan();
void love4UseMTricorderAnywhere();
void love4UseSTricorderAnywhere();
void love4UseCureOnRomulan();
void love4MccoyReachedRomulan4();
void love4MccoyCuredRomulan4();
void love4MccoyReachedRomulan3();
void love4MccoyCuredRomulan3();
void love4MccoyReachedRomulan2();
void love4MccoyCuredRomulan2();
void love4MccoyReachedRomulan1();
void love4MccoyCuredRomulan1();
void love4UseWaterOnRomulan();
void love4UseMedkitOnRomulan();
void love4UseCureSampleOnRomulan();
void love4UseAnythingOnRomulan();

// LOVE5
void love5Tick1();
@@ -1132,6 +1168,12 @@ class Room {
byte _188f; // 0x188f
} love3;

struct {
bool gaveWaterToRomulans; // 0xca
byte doorOpenCounter; // 0xcb
bool walkingToDoor; // 0xcc
} love4;


} _roomVar;
};
@@ -1141,6 +1141,60 @@ RoomAction love3ActionList[] = {

RoomAction love4ActionList[] = {
{ Action(ACTION_TICK, 1, 0, 0), &Room::love4Tick1 },
{ Action(ACTION_TICK, 10, 0, 0), &Room::love4Tick10 },
{ Action(ACTION_WALK, 8, 0, 0), &Room::love4WalkToDoor },
{ Action(ACTION_WALK, 0x20, 0, 0), &Room::love4WalkToDoor },
{ Action(ACTION_TOUCHED_HOTSPOT, 0, 0, 0), &Room::love4TouchedHotspot0 },
{ Action(ACTION_USE, OBJECT_KIRK, 0x21, 0), &Room::love4UseKirkOnLadder },
{ Action(ACTION_USE, OBJECT_IPHASERS, 9, 0), &Room::love4UseStunPhaserOnRomulan },
{ Action(ACTION_USE, OBJECT_IPHASERS, 10, 0), &Room::love4UseStunPhaserOnRomulan },
{ Action(ACTION_USE, OBJECT_IPHASERS, 11, 0), &Room::love4UseStunPhaserOnRomulan },
{ Action(ACTION_USE, OBJECT_IPHASERS, 12, 0), &Room::love4UseStunPhaserOnRomulan },
{ Action(ACTION_LOOK, -1, 0, 0), &Room::love4LookAnywhere },
{ Action(ACTION_LOOK, 0x21, 0, 0), &Room::love4LookAtLadder },
{ Action(ACTION_LOOK, 8, 0, 0), &Room::love4LookAtDoor },
{ Action(ACTION_LOOK, OBJECT_KIRK, 0, 0), &Room::love4LookAtKirk },
{ Action(ACTION_LOOK, OBJECT_MCCOY, 0, 0), &Room::love4LookAtMccoy },
{ Action(ACTION_LOOK, OBJECT_SPOCK, 0, 0), &Room::love4LookAtSpock },
{ Action(ACTION_LOOK, OBJECT_REDSHIRT, 0, 0), &Room::love4LookAtRedshirt },
{ Action(ACTION_LOOK, 9, 0, 0), &Room::love4LookAtRomulan },
{ Action(ACTION_LOOK, 10, 0, 0), &Room::love4LookAtRomulan },
{ Action(ACTION_LOOK, 11, 0, 0), &Room::love4LookAtRomulan },
{ Action(ACTION_LOOK, 12, 0, 0), &Room::love4LookAtRomulan },
{ Action(ACTION_TALK, OBJECT_KIRK, 0, 0), &Room::love4TalkToKirk },
{ Action(ACTION_TALK, OBJECT_MCCOY, 0, 0), &Room::love4TalkToMccoy },
{ Action(ACTION_TALK, OBJECT_REDSHIRT, 0, 0), &Room::love4TalkToRedshirt },
{ Action(ACTION_TALK, OBJECT_SPOCK, 0, 0), &Room::love4TalkToSpock },
{ Action(ACTION_TALK, 9, 0, 0), &Room::love4TalkToRomulan },
{ Action(ACTION_TALK, 10, 0, 0), &Room::love4TalkToRomulan },
{ Action(ACTION_TALK, 11, 0, 0), &Room::love4TalkToRomulan },
{ Action(ACTION_TALK, 12, 0, 0), &Room::love4TalkToRomulan },
{ Action(ACTION_USE, OBJECT_IMTRICOR, 9, 0), &Room::love4UseMTricorderOnRomulan },
{ Action(ACTION_USE, OBJECT_IMTRICOR, 10, 0), &Room::love4UseMTricorderOnRomulan },
{ Action(ACTION_USE, OBJECT_IMTRICOR, 11, 0), &Room::love4UseMTricorderOnRomulan },
{ Action(ACTION_USE, OBJECT_IMTRICOR, 12, 0), &Room::love4UseMTricorderOnRomulan },
{ Action(ACTION_USE, OBJECT_IMTRICOR, -1, 0), &Room::love4UseMTricorderAnywhere },
{ Action(ACTION_USE, OBJECT_ISTRICOR, -1, 0), &Room::love4UseSTricorderAnywhere },
{ Action(ACTION_USE, OBJECT_ICURE, 9, 0), &Room::love4UseCureOnRomulan },
{ Action(ACTION_USE, OBJECT_ICURE, 10, 0), &Room::love4UseCureOnRomulan },
{ Action(ACTION_USE, OBJECT_ICURE, 11, 0), &Room::love4UseCureOnRomulan },
{ Action(ACTION_USE, OBJECT_ICURE, 12, 0), &Room::love4UseCureOnRomulan },
{ Action(ACTION_USE, OBJECT_IH2O, 9, 0), &Room::love4UseWaterOnRomulan },
{ Action(ACTION_USE, OBJECT_IH2O, 10, 0), &Room::love4UseWaterOnRomulan },
{ Action(ACTION_USE, OBJECT_IH2O, 11, 0), &Room::love4UseWaterOnRomulan },
{ Action(ACTION_USE, OBJECT_IH2O, 12, 0), &Room::love4UseWaterOnRomulan },
{ Action(ACTION_USE, OBJECT_IMEDKIT, 9, 0), &Room::love4UseMedkitOnRomulan },
{ Action(ACTION_USE, OBJECT_IMEDKIT, 10, 0), &Room::love4UseMedkitOnRomulan },
{ Action(ACTION_USE, OBJECT_IMEDKIT, 11, 0), &Room::love4UseMedkitOnRomulan },
{ Action(ACTION_USE, OBJECT_IMEDKIT, 12, 0), &Room::love4UseMedkitOnRomulan },
{ Action(ACTION_USE, OBJECT_ISAMPLE, 9, 0), &Room::love4UseCureSampleOnRomulan },
{ Action(ACTION_USE, OBJECT_ISAMPLE, 10, 0), &Room::love4UseCureSampleOnRomulan },
{ Action(ACTION_USE, OBJECT_ISAMPLE, 11, 0), &Room::love4UseCureSampleOnRomulan },
{ Action(ACTION_USE, OBJECT_ISAMPLE, 12, 0), &Room::love4UseCureSampleOnRomulan },
{ Action(ACTION_USE, -1, 9, 0), &Room::love4UseAnythingOnRomulan },
{ Action(ACTION_USE, -1, 10, 0), &Room::love4UseAnythingOnRomulan },
{ Action(ACTION_USE, -1, 11, 0), &Room::love4UseAnythingOnRomulan },
{ Action(ACTION_USE, -1, 12, 0), &Room::love4UseAnythingOnRomulan },
};

RoomAction love5ActionList[] = {
@@ -61,15 +61,14 @@ void Room::love3Tick1() {
_vm->_awayMission.timers[0] = getRandomWordInRange(200, 400);
if (_vm->_awayMission.love.field2d)
_vm->_awayMission.timers[1] = getRandomWordInRange(200, 400);

_vm->_awayMission.timers[2] = 200;

_roomVar.love3._188e = 0xb4;
_roomVar.love3._188f = 0xb7;
}

void Room::love3Tick80() {
if (!_vm->_awayMission.love.field3f && haveItem(OBJECT_IRLG)) {
if (!_vm->_awayMission.love.visitedRoomWithRomulans && haveItem(OBJECT_IRLG)) {
showText(TX_SPEAKER_MCCOY, TX_LOV3_010);
showText(TX_SPEAKER_SPOCK, TX_LOV3_020);
}
@@ -145,9 +144,9 @@ void Room::love3TalkToKirk() {
}

void Room::love3TalkToSpock() {
if (_vm->_awayMission.love.field3f)
if (_vm->_awayMission.love.visitedRoomWithRomulans)
showText(TX_SPEAKER_SPOCK, TX_LOV3_003);
if (_vm->_awayMission.love.romulansUnconsciousFromLaughingGas)
else if (_vm->_awayMission.love.romulansUnconsciousFromLaughingGas)
showText(TX_SPEAKER_SPOCK, TX_LOV3_017);
else if (haveItem(OBJECT_IRLG))
showText(TX_SPEAKER_SPOCK, TX_LOV3_004);
Oops, something went wrong.

0 comments on commit 43a0a57

Please sign in to comment.