Skip to content

Commit

Permalink
SCI: Fix PQ3 wrong ending
Browse files Browse the repository at this point in the history
  • Loading branch information
sluicebox committed Dec 21, 2023
1 parent 49c1757 commit a26252f
Showing 1 changed file with 35 additions and 0 deletions.
35 changes: 35 additions & 0 deletions engines/sci/engine/script_patches.cpp
Expand Up @@ -13488,6 +13488,40 @@ static const uint16 pq3PatchGiveLocketPoints[] = {
PATCH_END
};

// PQ3 plays the wrong ending if the player woke Marie from her coma but still
// has an extra rose in their inventory. Room 300 checks to see if Marie is
// awake by testing flags and item locations, but one of these tests is wrong
// and out of sync with similar tests in other scripts.
//
// Giving Marie the rose places it in her room, but purchasing a second rose
// changes rose:owner from her room back to ego, and the location check fails.
//
// We fix this by testing rose:state instead of rose:owner, as all the other
// scripts do. Sierra fixed this in later versions.
//
// Applies to: English PC VGA Floppy
// Responsible method: rm300:init
static const uint16 pq3SignatureWrongEnding[] = {
0x38, SIG_SELECTOR16(owner), // pushi owner
0x76, // push0
0x39, SIG_MAGICDWORD, // pushi at
SIG_SELECTOR8(at),
0x78, // push1
0x39, 0x24, // pushi 24 [ rose ]
SIG_ADDTOOFFSET(+7),
0x35, 0x24, // ldi 24 [ hospital room ]
0x1a, // eq [ (rose owner:) == 36 ]
SIG_END
};

static const uint16 pq3PatchWrongEnding[] = {
0x38, PATCH_SELECTOR16(state), // pushi state
PATCH_ADDTOOFFSET(+13),
0x35, 0x00, // ldi 00
0x1e, // gt? [ (rose state:) > 0 ]
PATCH_END
};

// The doctor's mouth moves too fast in room 36. doctorMouth:cyleSpeed is set to
// one, the maximum speed, unlike any other inset in the game. Most insets use
// the default speed of six and almost all the rest use an even slower speed.
Expand Down Expand Up @@ -13667,6 +13701,7 @@ static const SciScriptPatcherEntry pq3Signatures[] = {
{ true, 36, "doctor mouth speed", 1, pq3SignatureDoctorMouthSpeed, pq3PatchDoctorMouthSpeed },
{ true, 44, "fix judge evidence lockup", 1, pq3SignatureJudgeEvidenceLockup, pq3PatchJudgeEvidenceLockup },
{ true, 99, "disable speed test", 1, sci01SpeedTestLocalSignature, sci01SpeedTestLocalPatch },
{ true, 300, "fix wrong ending", 1, pq3SignatureWrongEnding, pq3PatchWrongEnding },
{ true, 994, "NRS: remove speed throttle", 1, pq3SignatureNrsSpeedThrottle, pq3PatchNrsSpeedThrottle },
SCI_SIGNATUREENTRY_TERMINATOR
};
Expand Down

0 comments on commit a26252f

Please sign in to comment.