MOHAWK: RIVEN: Patch Jungle island book closing animation script

Fixes #10880.
This commit is contained in:
Bastien Bouclet 2019-01-30 08:43:49 +01:00
parent 662791a961
commit 8f350905e9
3 changed files with 59 additions and 1 deletions

View File

@ -83,6 +83,7 @@ void RivenCard::applyPatches(uint16 id) {
applyPropertiesPatch22118(globalId);
applyPropertiesPatchE2E(globalId);
applyPropertiesPatch1518D(globalId);
}
void RivenCard::applyPropertiesPatch8EB7(uint32 globalId) {
@ -410,6 +411,62 @@ void RivenCard::applyPropertiesPatchE2E(uint32 globalId) {
}
}
void RivenCard::applyPropertiesPatch1518D(uint32 globalId) {
// Inside Jungle Island's dome, when looking at the open book,
// stepping back from the stand and then looking at the book
// again, the book closing animation would play again.
//
// Comparing the scripts for the Jungle dome and the other domes
// shows a small portion of script is missing.
// The following patch adds it back so the jungle dome script
// matches the other domes.
//
// Added script part:
// == Script 2 ==
// [...]
// type: CardEnter
// switch (jbook) {
// case 2:
// playMovieBlocking(1);
// jbook = 0;
// refreshCard();
// break;
// }
if (globalId == 0x1518D) {
uint16 jBookVariable = _vm->getStack()->getIdFromName(kVariableNames, "jbook");
uint16 patchData[] = {
1, // Command count in script
kRivenCommandSwitch,
2, // Unused
jBookVariable,
1, // Branches count
2, // jbook == 2 branch
3, // Command count in sub-script
kRivenCommandPlayMovieBlocking,
1, // Argument count
1, // Video id
kRivenCommandSetVariable,
2, // Argument count
jBookVariable,
0, // Variable value
kRivenCommandRefreshCard,
0 // Argument count
};
RivenScriptPtr patchScript = _vm->_scriptMan->readScriptFromData(patchData, ARRAYSIZE(patchData));
// Append the patch to the existing script
RivenScriptPtr loadScript = getScript(kCardEnterScript);
loadScript += patchScript;
debugC(kRivenDebugPatches, "Applied jungle book close loop to card %x", globalId);
}
}
void RivenCard::moveHotspot(uint16 blstId, const Common::Rect &position) {
RivenHotspot *hotspot = getHotspotByBlstId(blstId);
if (!hotspot) {

View File

@ -153,6 +153,7 @@ private:
void loadCardWaterEffectList(uint16 id);
void applyPatches(uint16 id);
void applyPropertiesPatchE2E(uint32 globalId);
void applyPropertiesPatch1518D(uint32 globalId);
void applyPropertiesPatch8EB7(uint32 globalId);
void applyPropertiesPatch2E76(uint32 globalId);
void applyPropertiesPatch22118(uint32 globalId);

View File

@ -75,7 +75,7 @@ enum RivenCommandType {
kRivenCommandDisableMovie = 28,
kRivenCommandDisableAllMovies = 29,
kRivenCommandEnableMovie = 31,
kRivenCommandlayMovieBlocking = 32,
kRivenCommandPlayMovieBlocking = 32,
kRivenCommandPlayMovie = 33,
kRivenCommandStopMovie = 34,
kRivenCommandUnk36 = 36,