Permalink
Browse files

STARTREK: TRIAL5

  • Loading branch information...
Drenn1 authored and sev- committed Jul 11, 2018
1 parent 160bd9a commit 793a5b602006f7cfbf967de83647f67f161ce70a
@@ -288,12 +288,23 @@ struct AwayMission {
// 23: Is dead
int16 shotKlingonState; // 0x3d

bool neuralInterfaceActive; // 0x43
int16 holeContents[3]; // 0x44 (Holes to put gems in for TRIAL5)

bool enteredGlobRoom; // 0x5c
bool forceFieldDown; // 0x5d
bool uhuraAnalyzedCode; // 0x5e
int16 field5f; // 0x5f

// 0: Gave up in court, letting Quetzecoatl die
// 1: Beamed to enterprise after calling Uhura
// 2: Lost the court battle after beaming back to the courtroom
// 3: Quetzecoatl goes free and Vlict doesn't die
// 4: Quetzecoatl goes free and Vlict dies
int16 missionEndMethod; // 0x5f

bool gotPointsForGettingRod; // 0x61
bool gotPointsForCoatingRodWithIron; // 0x62
bool gotPointsForActivatingInterface; // 0x63
bool gotPointsForScanningGlob; // 0x64

bool gotPointsForBeamingOut;
@@ -68,15 +68,15 @@ enum Items {
OBJECT_IH2O,
OBJECT_IWROD,
OBJECT_IIROD,
OBJECT_IREDGEM_A, // FIXME: repeated items? (applies to all names with _A, _B, or _C)
OBJECT_IREDGEM_B,
OBJECT_IREDGEM_C,
OBJECT_IGRNGEM_A,
OBJECT_IGRNGEM_B,
OBJECT_IGRNGEM_C,
OBJECT_IBLUGEM_A,
OBJECT_IBLUGEM_B,
OBJECT_IBLUGEM_C,
OBJECT_IREDGEM1,
OBJECT_IREDGEM2,
OBJECT_IREDGEM3,
OBJECT_IGRNGEM1,
OBJECT_IGRNGEM2,
OBJECT_IGRNGEM3,
OBJECT_IBLUGEM1,
OBJECT_IBLUGEM2,
OBJECT_IBLUGEM3,
OBJECT_ICONECT,
OBJECT_IS8ROCKS,
OBJECT_IIDCARD,
@@ -480,7 +480,9 @@ void Room::spockScan(int direction, TextRef text, bool changeDirection) {

loadActorAnim2(OBJECT_SPOCK, anim, -1, -1, 0);
playSoundEffectIndex(SND_TRICORDER);
showText(TX_SPEAKER_SPOCK, text);

if (text != -1)
showText(TX_SPEAKER_SPOCK, text);
}

void Room::mccoyScan(int direction, TextRef text, bool changeDirection) {
@@ -493,7 +495,9 @@ void Room::mccoyScan(int direction, TextRef text, bool changeDirection) {

loadActorAnim2(OBJECT_MCCOY, anim, -1, -1, 0);
playSoundEffectIndex(SND_TRICORDER);
showText(TX_SPEAKER_MCCOY, text);

if (text != -1)
showText(TX_SPEAKER_MCCOY, text);
}

}
@@ -1953,6 +1953,85 @@ class Room {

// TRIAL5
void trial5Tick1();
void trial5Tick60();
void trial5VlictAppeared();
void trial5WalkToInterface();
void trial5ReachedInterface();
void trial5GetGem(int16 item, int16 object);
void trial5ReachedGem();
void trial5PickedUpGem();
void trial5GetRedGem1();
void trial5GetRedGem2();
void trial5GetRedGem3();
void trial5GetGreenGem1();
void trial5GetGreenGem2();
void trial5GetGreenGem3();
void trial5GetBlueGem1();
void trial5GetBlueGem2();
void trial5GetBlueGem3();
void trial5LookAtKirk();
void trial5LookAtSpock();
void trial5LookAtMccoy();
void trial5LookAtRedshirt();
void trial5LookAtBeam();
void trial5LookAtInterface();
void trial5UseSTricorderOnInterface();
void trial5UseMTricorderOnInterface();
void trial5LookAtRedGem1();
void trial5LookAtRedGem2();
void trial5LookAtRedGem3();
void trial5LookAtGreenGem1();
void trial5LookAtGreenGem2();
void trial5LookAtGreenGem3();
void trial5LookAtBlueGem1();
void trial5LookAtBlueGem2();
void trial5LookAtBlueGem3();
void trial5LookAtHole();
void trial5TalkToKirk();
void trial5TalkToSpock();
void trial5TalkToMccoy();
void trial5TalkToRedshirt();
void trial5UsePhaser();
void trial5UseMTricorderAnywhere();
void trial5UseSTricorderAnywhere();
void trial5UseCommunicator();
void trial5UseGemOnHole(int16 item, int16 object, int16 hole);
void trial5ReachedHoleToPutGem();
void trial5ActivateLightOfWar();
void trial5ActivateLightOfKnowledge();
void trial5ActivateLightOfTravel();
void trial5RestrictedCombination1();
void trial5RestrictedCombination2();
void trial5DestinationNoLongerExists();
void trial5CrewmanBeamedOut();
void trial5UseRedGem1OnHole1();
void trial5UseRedGem2OnHole1();
void trial5UseRedGem3OnHole1();
void trial5UseGreenGem1OnHole1();
void trial5UseGreenGem2OnHole1();
void trial5UseGreenGem3OnHole1();
void trial5UseBlueGem1OnHole1();
void trial5UseBlueGem2OnHole1();
void trial5UseBlueGem3OnHole1();
void trial5UseRedGem1OnHole2();
void trial5UseRedGem2OnHole2();
void trial5UseRedGem3OnHole2();
void trial5UseGreenGem1OnHole2();
void trial5UseGreenGem2OnHole2();
void trial5UseGreenGem3OnHole2();
void trial5UseBlueGem1OnHole2();
void trial5UseBlueGem2OnHole2();
void trial5UseBlueGem3OnHole2();
void trial5UseRedGem1OnHole3();
void trial5UseRedGem2OnHole3();
void trial5UseRedGem3OnHole3();
void trial5UseGreenGem1OnHole3();
void trial5UseGreenGem2OnHole3();
void trial5UseGreenGem3OnHole3();
void trial5UseBlueGem1OnHole3();
void trial5UseBlueGem2OnHole3();
void trial5UseBlueGem3OnHole3();
void trial5UseMedkitAnywhere();

private:
// Room-specific variables. This is memset'ed to 0 when the room is initialized.
@@ -2095,6 +2174,11 @@ class Room {
// trial2
byte globBeingShot;
bool phaserOnKill;

// trial5
int16 itemToUse; // 0x1386
int16 objectToUse; // 0x1388
int16 hole;
} trial;

} _roomVar;
@@ -197,7 +197,7 @@ void Room::trial0ReachedRoomCenter() {
playMidiMusicTracks(2, -1);
showText(TX_SPEAKER_VLICT, TX_TRI0_049);
showText(TX_SPEAKER_VLICT, TX_TRI0_044);
_vm->_awayMission.trial.field5f = 0;
_vm->_awayMission.trial.missionEndMethod = 0;

// FIXME: Are these parameters in the right order?
endMission(_vm->_awayMission.trial.missionScore, _vm->_awayMission.trial.field2b, 0);
@@ -437,7 +437,7 @@ void Room::trial1UseCommunicator() {
int choice = showText(choices);

if (choice == 0) { // "Beam us back to the enterprise"
_vm->_awayMission.trial.field5f = 1;
_vm->_awayMission.trial.missionEndMethod = 1;
endMission(1, 1, 1);
} else if (choice == 1) { // "Beam us to Vlict's position"
showText(TX_SPEAKER_UHURA, TX_TRI1U080);
@@ -413,7 +413,7 @@ void Room::trial2UseCommunicator() {
int choice = showText(choices);

if (choice == 0) { // "Beam us back to the enterprise"
_vm->_awayMission.trial.field5f = 1;
_vm->_awayMission.trial.missionEndMethod = 1;
endMission(_vm->_awayMission.trial.missionScore, 1, 1); // FIXME: Inconsistent with TRIAL1
} else if (choice == 1) { // "Beam us to Vlict's position"
showText(TX_SPEAKER_UHURA, TX_TRI1U080); // NOTE: Original didn't show text here
@@ -381,7 +381,8 @@ void Room::trial3UseSTricorderOnExit() {
void Room::trial3UseMTricorderOnKlingon() {
if (_vm->_awayMission.trial.shotKlingonState == 22) { // Unconscious
mccoyScan(DIR_S, TX_TRI3_011);
showText(TX_SPEAKER_BENNIE, TX_TRI3_028);
if (!_vm->_awayMission.redshirtDead) // BUGFIX: Check if redshirt is dead
showText(TX_SPEAKER_BENNIE, TX_TRI3_028);
}
}

@@ -397,7 +398,7 @@ void Room::trial3UseCommunicator() {
int choice = showText(choices);

if (choice == 0) { // "Beam us back to the enterprise"
_vm->_awayMission.trial.field5f = 1;
_vm->_awayMission.trial.missionEndMethod = 1;
endMission(_vm->_awayMission.trial.missionScore, _vm->_awayMission.trial.field2b, 1); // FIXME: inconsistent
} else if (choice == 1) { // "Beam us to Vlict's position"
trial3BeamToVlict();
@@ -180,7 +180,7 @@ void Room::trial4Tick60() {
}

showText(TX_SPEAKER_KIRK, TX_TRI4_012);
_vm->_awayMission.trial.field5f = 2;
_vm->_awayMission.trial.missionEndMethod = 2;
endMission(_vm->_awayMission.trial.missionScore, _vm->_awayMission.trial.field2b, 2);
}

Oops, something went wrong.

0 comments on commit 793a5b6

Please sign in to comment.