[Scummvm-git-logs] scummvm master -> 2bdf17eb3aa872bf06ae91779b66c0a3eaefa36c
neuromancer
noreply at scummvm.org
Thu Nov 19 18:41:08 UTC 2026
This automated email contains information about 13 new commits which have been
pushed to the 'scummvm' repo located at https://api.github.com/repos/scummvm/scummvm .
Summary:
7f82f812dc HOLLYWOOD: RUNAWAY: implemented another pass on the 5xxx scenes
ac17f7d953 HOLLYWOOD: RUNAWAY: chapters 1 and 2 now have interaction, response, exit, and animation-continuation labels
98ef1d6595 HOLLYWOOD: RUNAWAY: added missing details for scenes 5010, 5060 and 5100
4d5f22dfca HOLLYWOOD: RUNAWAY: implemented scene 5140
2213538060 HOLLYWOOD: RUNAWAY: implemented scene 5130 and refined some other 5xxx scenes
d0af6b0196 HOLLYWOOD: RUNAWAY: implemented first pass on scenes 6220, 6350 and 6370
faf0afe45e HOLLYWOOD: RUNAWAY: implemented scenes 6190, 6200 and 6210
55f5e57ff4 HOLLYWOOD: RUNAWAY: implemented scenes 6260 and 6263
149d592b74 HOLLYWOOD: RUNAWAY: implemented scenes 6014, 6080, 6090 and 6130
e73b899fda HOLLYWOOD: RUNAWAY: implemented scenes 6180 and 6240
2f96a205c8 HOLLYWOOD: RUNAWAY: implemented scenes 6270 and 6290
9ee4f4f4c4 HOLLYWOOD: RUNAWAY: migrated 6270 and 6290 to classes
2bdf17eb3a HOLLYWOOD: RUNAWAY: migrated the rest of scenes 6xxx to classes
Commit: 7f82f812dc456b1be5bc255352d839737fdc4de7
https://github.com/scummvm/scummvm/commit/7f82f812dc456b1be5bc255352d839737fdc4de7
Author: neuromancer (gustavo.grieco at gmail.com)
Date: 2026-11-19T19:38:52+01:00
Commit Message:
HOLLYWOOD: RUNAWAY: implemented another pass on the 5xxx scenes
Changed paths:
engines/hollywood/runaway/scene.cpp
engines/hollywood/runaway/scene.h
engines/hollywood/runaway/scene5010.cpp
engines/hollywood/runaway/scene5020.cpp
engines/hollywood/runaway/scene5030.cpp
engines/hollywood/runaway/scene5030.h
engines/hollywood/runaway/scene5050.cpp
engines/hollywood/runaway/scene5060.cpp
engines/hollywood/runaway/scene5070.cpp
engines/hollywood/runaway/scene5080.cpp
engines/hollywood/runaway/scene5100.cpp
engines/hollywood/runaway/scene5110.cpp
engines/hollywood/runaway/scene5160.cpp
engines/hollywood/runaway/scene5170.cpp
diff --git a/engines/hollywood/runaway/scene.cpp b/engines/hollywood/runaway/scene.cpp
index 9d0930874bf..004a5b001ff 100644
--- a/engines/hollywood/runaway/scene.cpp
+++ b/engines/hollywood/runaway/scene.cpp
@@ -906,8 +906,10 @@ void RunawayRoomScene::updateRoomAnimation() {
finishHospitalAnimation(action);
return;
}
- if (desertChapter())
+ if (desertChapter()) {
+ desertAnimationFrame();
continue;
+ }
if (museumChapter()) {
museumAnimationFrame();
continue;
diff --git a/engines/hollywood/runaway/scene.h b/engines/hollywood/runaway/scene.h
index 1ae734a3256..7f4e94ef9e0 100644
--- a/engines/hollywood/runaway/scene.h
+++ b/engines/hollywood/runaway/scene.h
@@ -249,6 +249,8 @@ private:
void updateDesertMaps();
void drawDesertRoom(Graphics::ManagedSurface &viewport, bool foreground);
void drawScene5060(Graphics::ManagedSurface &viewport);
+ void drawScene5080(Graphics::ManagedSurface &viewport);
+ void updateScene5080();
void drawScene5100(Graphics::ManagedSurface &viewport, bool foreground);
void updateScene5100();
bool applyBackground5100();
@@ -260,6 +262,7 @@ private:
void leaveDesertRoom(uint16 scene);
void deferDesertAction(uint16 action);
void finishDesertAnimation(uint16 action);
+ void desertAnimationFrame();
ActionResult executeDesert(uint16 action);
ActionResult execute5020(uint16 action);
ActionResult execute5050(uint16 action);
diff --git a/engines/hollywood/runaway/scene5010.cpp b/engines/hollywood/runaway/scene5010.cpp
index a6661b9d6d4..1d867a5da3d 100644
--- a/engines/hollywood/runaway/scene5010.cpp
+++ b/engines/hollywood/runaway/scene5010.cpp
@@ -118,9 +118,16 @@ void RunawayRoomScene::finishDesertAnimation(uint16 action) {
execute(action + 1000);
}
+void RunawayRoomScene::desertAnimationFrame() {
+ if (_room == 5080 && _roomAction == 326 && _actionStep == 23)
+ _audio.playEffect(72);
+}
+
void RunawayRoomScene::updateDesert(uint elapsed, bool inventoryOpen) {
updateRoomAnimation();
updateConversation();
+ if (_room == 5080)
+ updateScene5080();
if (_room == 5100)
updateScene5100();
if (_roomAction && _actionFrames.empty() && !speaking() && !_walkPath.active()) {
@@ -135,7 +142,14 @@ void RunawayRoomScene::updateDesert(uint elapsed, bool inventoryOpen) {
RunawayRoomScene::ActionResult RunawayRoomScene::executeDesert(uint16 action) {
switch (_room) {
case 5010: {
- const uint16 destinations[] = {5070, 5020, 5100, 5050, 5080, 5060};
+ const uint16 destinations[] = {
+ 5070, // 301: Go to the oil well.
+ 5020, // 302: Go to the thugs' cabin.
+ 5100, // 303: Go to the hangar.
+ 5050, // 304: Go to the airplane graveyard.
+ 5080, // 305: Go to the railway yard.
+ 5060 // 306: Go to the bus.
+ };
if (action >= 301 && action <= 306) {
leaveDesertRoom(destinations[action - 301]);
return kHandled;
@@ -220,7 +234,8 @@ bool RunawayRoomScene::loadDesertRoom() {
if (_room == 5060)
return loadForeground(0, 8) && _npc.load(_archive, 7, 201) && _machine.load(_archive, 12, 195);
if (_room == 5080)
- return loadForeground(0, 11) && loadForeground(1, 12) && loadForeground(2, 13) && loadForeground(3, 14);
+ return loadForeground(0, 11) && loadForeground(1, 12) && loadForeground(2, 13) && loadForeground(3, 14) &&
+ _npc.load(_archive, 9, 47);
if (_room == 5100)
return _npc.load(_archive, 9, 151) && _npcMouth.load(_archive, 12, 126);
return true;
@@ -239,7 +254,8 @@ bool RunawayRoomScene::applyDesertBackground() {
case 5060:
return _desert.tanningOil != 2 || applyPatch(9);
case 5080:
- return !_desert.antsDistracted || applyPatch(_desert.dynamite == 1 ? 7 : 8);
+ return loadRunawayMask(_archive, _background.w, _background.h, _mask, _originalMaps, _desert.antsDistracted ? 4 : 1) &&
+ (!_desert.antsDistracted || applyPatch(_desert.dynamite == 1 ? 7 : 8));
case 5100:
return applyBackground5100();
case 5110:
@@ -333,6 +349,8 @@ Common::U32String RunawayRoomScene::desertHotspotName(byte id) const {
return _inventory.name(12);
if (_room == 5060 && id == 7 && _desert.busPosterSeen)
return Common::U32String("Lawn chair");
+ if (_room == 5080 && id == 3 && _desert.antsDistracted)
+ return Common::U32String("Sawdust");
if (_room == 5100 && id == 3 && _desert.peanutButter)
return _inventory.name(19);
if (_room == 5100 && id == 8 && _desert.footrestSeen)
@@ -405,6 +423,8 @@ void RunawayRoomScene::drawDesertRoom(Graphics::ManagedSurface &viewport, bool f
}
if (_room == 5060)
drawScene5060(viewport);
+ else if (_room == 5080)
+ drawScene5080(viewport);
}
void RunawayRoomScene::setupDesertDepth(RunawayActor::RenderParams ¶ms) const {
diff --git a/engines/hollywood/runaway/scene5020.cpp b/engines/hollywood/runaway/scene5020.cpp
index 42517a397d2..791c944d0cd 100644
--- a/engines/hollywood/runaway/scene5020.cpp
+++ b/engines/hollywood/runaway/scene5020.cpp
@@ -38,13 +38,16 @@ const RunawayHotspot kHotspots[] = {
};
const RunawayResponse kResponses[] = {
- {5020, 303, 1, 0},
- {5020, 305, 4, 0},
- {5020, 306, 5, 0},
- {5020, 307, 6, 0},
- {5020, 308, 7, 0},
- {5020, 310, 9, 0},
- {5020, 311, 10, 0},
+ {5020, 302, 2, 0}, // Look at the path.
+ {5020, 303, 1, 0}, // Use an item with the cabin.
+ {5020, 304, 3, 0}, // Look at the rocking chair.
+ {5020, 305, 4, 0}, // Use the rocking chair.
+ {5020, 306, 5, 0}, // Look at the door.
+ {5020, 307, 6, 0}, // Open the door.
+ {5020, 308, 7, 0}, // Look at the trap door.
+ {5020, 310, 9, 0}, // Look at the tires.
+ {5020, 311, 10, 0}, // Use the tires.
+ {5020, 312, 11, 0}, // Look at the bucket.
};
const RunawayItemAction kItemActions[] = {
@@ -88,17 +91,17 @@ const RunawayRoom kRunawayScene5020 = {
RunawayRoomScene::ActionResult RunawayRoomScene::execute5020(uint16 action) {
switch (action) {
- case 302:
+ case 301: // Go to the desert overview.
leaveDesertRoom(5010);
break;
- case 309:
+ case 309: // Enter the cabin through the trap door.
if (!_desert.hatchSeen) {
_desert.hatchSeen = 1;
say(8);
}
leaveDesertRoom(5031);
break;
- case 313:
+ case 313: // Take the bucket.
_desert.bucketTaken = 1;
_inventory.add(25);
say(12);
diff --git a/engines/hollywood/runaway/scene5030.cpp b/engines/hollywood/runaway/scene5030.cpp
index 4bd28a52914..51173b7a683 100644
--- a/engines/hollywood/runaway/scene5030.cpp
+++ b/engines/hollywood/runaway/scene5030.cpp
@@ -451,9 +451,10 @@ void RunawayScene5030::useItem(byte item, byte hotspot) {
// Dispatch the room's item actions separately from its ordinary verbs.
// Original rejected actions use the shared, voiced inventory responses.
if (item == 1 && hotspot == 3) {
- // The large window is never cleaned; cue 33 belongs to the small one.
+ // 339: Use the chamois with the large window.
sayCue(35, 0);
} else if (item == 1 && hotspot == 4) {
+ // 337: Clean the small window with the damp chamois.
if (_windowClean) {
sayCue(33, 3);
} else if (!_inventory.clothState()) {
@@ -467,14 +468,39 @@ void RunawayScene5030::useItem(byte item, byte hotspot) {
sayCue(33, 1);
}
} else if (item == 3 && hotspot == 4) {
+ // 343: Use the cleaner with the small window.
sayCue(39, 0);
} else if (item == 2 && hotspot == 4) {
+ // 342: Use the crowbar with the small window.
sayCue(38, 0);
} else if (item == 2 && hotspot == 6) {
+ // 338: Pry the padlock off the trap door.
if (_hatchState == kLocked)
waitForSpeech(34, 0, kPryHatch);
else
sayCue(34, _hatchState == kUnlocked ? 2 : 3);
+ } else if (_game == kRunawayFullGame && item == 4 && hotspot == 8) {
+ // 340: Use butter with the freezer.
+ sayCue(36, 0);
+ } else if (_game == kRunawayFullGame && item == 6 && hotspot == 8) {
+ // 341: Heat the helmet's contents on the sunlit freezer lid.
+ switch (_inventory.desert().helmet) {
+ case 0:
+ case 4:
+ sayCue(37, 0);
+ break;
+ case 1:
+ sayCue(37, 1);
+ break;
+ case 2:
+ waitForSpeech(37, 2, kHeatHelmet);
+ break;
+ case 3:
+ sayCue(37, 4);
+ break;
+ default:
+ break;
+ }
} else {
sayInventory(RunawayInventory::Reply(1, 0));
}
@@ -484,60 +510,60 @@ void RunawayScene5030::examine(byte id) {
const bool examined = _examined[id];
_examined[id] = true;
switch (id) {
- case 1:
+ case 1: // Look at the door.
sayCue(1, _peeked ? 1 : 0);
break;
- case 2:
+ case 2: // Look through the crack in the door.
startAction(kPeekDoor);
break;
- case 3:
+ case 3: // Look through the large window.
sayCue(5, 0);
break;
- case 4:
+ case 4: // Look through the small window.
sayCue(7, _windowClean ? 1 : 0);
break;
- case 5:
+ case 5: // Look at the wooden peg.
sayCue(9, examined ? 1 : 0);
break;
- case 6:
+ case 6: // Look at the trap door.
sayCue(_hatchState == kOpen ? 12 : 10, _hatchState == kUnlocked ? 1 : 0);
break;
- case 7:
+ case 7: // Look at Brian's torn shirt.
sayCue(27, examined ? 1 : 0);
break;
- case 8:
+ case 8: // Look at the freezer and its contents.
_coolerInspected |= _lidOpen;
sayCue(13, _coolerMoved ? 0 : !_lidOpen ? 1 : _ice == kDrained ? 6 :
_ice == kMelted ? 5 : _windowClean ? (_unplugged ? 5 : 4) : (_unplugged ? 3 : 2));
break;
- case 9:
+ case 9: // Look at the chamois.
sayCue(15, examined ? 1 : 0);
break;
- case 10:
+ case 10: // Look at the power plug.
sayCue(16, 0);
break;
- case 11:
+ case 11: // Look at the freezer drain.
sayCue(18, 0);
break;
- case 12:
+ case 12: // Look at the telephone.
sayCue(21, 0);
break;
- case 13:
+ case 13: // Look at the shelf.
sayCue(23, 0);
break;
- case 14:
+ case 14: // Look at the crowbar.
sayCue(25, 0);
break;
- case 15:
+ case 15: // Look at Brian's broken glasses.
sayCue(40, 0);
break;
- case 16:
+ case 16: // Look at the bellows.
sayCue(29, 0);
break;
- case 17:
+ case 17: // Look at the cleaner.
sayCue(30, examined ? 1 : 0);
break;
- case 18:
+ case 18: // Look at the freezer lid.
sayCue(32, _lidOpen ? 1 : 0);
break;
default:
@@ -660,19 +686,19 @@ void RunawayScene5030::startAction(Action action) {
case kPickup:
_action = kNone;
switch (_pickupHotspot) {
- case 5:
+ case 5: // Take the wooden peg.
pickUp(5, 8, 0);
break;
- case 9:
+ case 9: // Take the chamois.
pickUp(9, 1, 1);
break;
- case 14:
+ case 14: // Take the crowbar.
pickUp(14, 2, 2);
break;
- case 16:
+ case 16: // Take the bellows.
pickUp(16, 24, 3);
break;
- case 17:
+ case 17: // Take the cleaner.
pickUp(17, 3, 4);
break;
default:
@@ -744,6 +770,20 @@ void RunawayScene5030::startAction(Action action) {
chunk = 22;
frames = 19;
break;
+ case kHeatHelmet:
+ chunk = 31;
+ frames = 69;
+ break;
+ case kPrepareStirringHelmet:
+ _facing = 4;
+ waitForSpeech(37, 6, kStirHelmet);
+ break;
+ case kStirHelmet:
+ if (!loadRoomGraphics())
+ error("Cannot rebuild Runaway room before stirring the helmet");
+ chunk = 31;
+ frames = 69;
+ break;
default:
break;
}
@@ -824,6 +864,13 @@ void RunawayScene5030::finishAction() {
_facing = 4;
sayCue(_peeked ? 3 : 1, _peeked ? _random.getRandomNumber(3) : 1);
_peeked = true;
+ } else if (completed == kHeatHelmet) {
+ applyPatch(25);
+ waitForSpeech(37, 5, kPrepareStirringHelmet);
+ } else if (completed == kStirHelmet) {
+ _audio.stopEffect();
+ _inventory.desert().helmet = 3;
+ sayCue(37, 3);
}
debugC(1, kDebugScene, "Runaway demo: animation %u finished, lid=%u unplugged=%u",
(uint)completed, (uint)_lidOpen, (uint)_unplugged);
@@ -935,6 +982,18 @@ void RunawayScene5030::updateAction() {
case kReturnFromPeek:
length = 20;
break;
+ case kHeatHelmet:
+ length = 28;
+ if (previousStep < 22 && _step >= 22)
+ _audio.playEffect(70);
+ break;
+ case kStirHelmet:
+ length = 90;
+ if (previousStep < 5 && _step >= 5)
+ _audio.playEffect(71, 191);
+ if (previousStep < 81 && _step >= 81)
+ _audio.stopEffect();
+ break;
default:
break;
}
@@ -1041,6 +1100,10 @@ void RunawayScene5030::draw() {
} else if (_action == kPeekDoor || _action == kReturnFromPeek) {
const uint frame = _action == kPeekDoor ? MAX<int>(0, (int)_step - 1) : 18 - MAX<int>(0, (int)_step - 1);
_actionAnimation.draw(_screen, frame, _cameraX, kRoomTop);
+ } else if (_action == kHeatHelmet || _action == kStirHelmet) {
+ const uint step = _action == kHeatHelmet ? _step : _step + 29;
+ const uint frame = step < 54 ? MAX<int>(0, (int)step - 1) : step < 103 ? 46 + (step - 54) % 7 : step - 50;
+ _actionAnimation.draw(_screen, frame, _cameraX, kRoomTop);
} else {
_actor.draw(_screen, _position, _cameraX, kRoomTop, _mask, _maps, _windowClean, _antialias);
}
diff --git a/engines/hollywood/runaway/scene5030.h b/engines/hollywood/runaway/scene5030.h
index 3ee25380e56..ce7cf559d18 100644
--- a/engines/hollywood/runaway/scene5030.h
+++ b/engines/hollywood/runaway/scene5030.h
@@ -88,7 +88,8 @@ private:
kMeltIce, kMeltWait, kInspectIce, kFinishMelting,
kTryMoveCooler, kMoveCooler, kRevealHatch, kFinishMoving, kHatchFound,
kDrainCooler, kFinishDraining, kPryHatch, kOpenHatch, kEscape,
- kPeekDoor, kPeekConversation, kReturnFromPeek
+ kPeekDoor, kPeekConversation, kReturnFromPeek,
+ kHeatHelmet, kPrepareStirringHelmet, kStirHelmet
};
enum IceState { kFrozen, kMelted, kDrained };
enum HatchState { kHidden, kLocked, kUnlocked, kOpen };
diff --git a/engines/hollywood/runaway/scene5050.cpp b/engines/hollywood/runaway/scene5050.cpp
index df7c8a48284..1008f0d0448 100644
--- a/engines/hollywood/runaway/scene5050.cpp
+++ b/engines/hollywood/runaway/scene5050.cpp
@@ -39,12 +39,14 @@ const RunawayHotspot kHotspots[] = {
};
const RunawayResponse kResponses[] = {
- {5050, 302, 1, 0},
- {5050, 309, 8, 0},
- {5050, 310, 9, 0},
- {5050, 311, 10, 0},
- {5050, 313, 12, 0},
- {5050, 314, 13, 0},
+ {5050, 302, 1, 0}, // Look at the path.
+ {5050, 303, 2, 0}, // Look at the helmet.
+ {5050, 309, 8, 0}, // Look at the bullet hole.
+ {5050, 310, 9, 0}, // Use the bullet hole.
+ {5050, 311, 10, 0}, // Look at the pilot's seat.
+ {5050, 312, 11, 0}, // Use the pilot's seat.
+ {5050, 313, 12, 0}, // Look at the gunner's seat.
+ {5050, 314, 13, 0}, // Use the gunner's seat.
};
const RunawayItemAction kItemActions[] = {
@@ -70,32 +72,32 @@ const RunawayRoom kRunawayScene5050 = {
RunawayRoomScene::ActionResult RunawayRoomScene::execute5050(uint16 action) {
RunawaySaveState::DesertItems &items = _inventory.desert();
switch (action) {
- case 302:
+ case 301: // Go to the desert overview.
leaveDesertRoom(5010);
break;
- case 304:
+ case 304: // Take the helmet.
_desert.helmetTaken = 1;
_inventory.add(6);
say(3);
return kBackgroundChanged;
- case 305:
+ case 305: // Look at the ammunition belt.
say(4, _desert.beltSeen != 0);
_desert.beltSeen = 1;
break;
- case 306:
+ case 306: // Take the ammunition belt.
_desert.beltTaken = 1;
_inventory.add(14);
say(5);
return kBackgroundChanged;
- case 307:
+ case 307: // Look at the machine gun.
say(6, _desert.gun);
_desert.gunSeen = 1;
break;
- case 308:
+ case 308: // Use the machine gun.
say(7, _desert.gun);
_desert.gunSeen = 1;
break;
- case 315:
+ case 315: // Use tanning oil with the machine gun.
if (_desert.gun)
say(14, 2);
else if (!_desert.gunSeen)
@@ -105,18 +107,18 @@ RunawayRoomScene::ActionResult RunawayRoomScene::execute5050(uint16 action) {
beginRoomAnimation(action, 11, 46);
}
break;
- case 1315:
+ case 1315: // Finish lubricating the machine gun.
_desert.gun = 1;
say(14, 1);
say(14, 3);
return kBackgroundChanged;
- case 316:
+ case 316: // Use the lipstick with the machine gun.
say(15, items.lipstick != 0);
break;
- case 317:
+ case 317: // Use the pile of lipstick with the machine gun.
say(16, items.lipsticks != 0);
break;
- case 318:
+ case 318: // Load the ammunition belt into the machine gun.
if (items.belt < 2)
say(17, items.belt);
else if (!_desert.gun)
@@ -126,7 +128,7 @@ RunawayRoomScene::ActionResult RunawayRoomScene::execute5050(uint16 action) {
beginRoomAnimation(action, 12, 37);
}
break;
- case 1318:
+ case 1318: // Finish loading the machine gun.
_desert.gun = 2;
items.gunReady = 1;
_inventory.remove(14);
@@ -136,7 +138,7 @@ RunawayRoomScene::ActionResult RunawayRoomScene::execute5050(uint16 action) {
leaveDesertRoom(5062);
}
return kBackgroundChanged;
- case 319:
+ case 319: // Use unsuitable lubricant with the machine gun.
say(18, _desert.gun != 0);
break;
default:
diff --git a/engines/hollywood/runaway/scene5060.cpp b/engines/hollywood/runaway/scene5060.cpp
index eb761f3dd72..a6dd7303e7c 100644
--- a/engines/hollywood/runaway/scene5060.cpp
+++ b/engines/hollywood/runaway/scene5060.cpp
@@ -60,11 +60,11 @@ const RunawayHotspot kHotspots[] = {
};
const RunawayResponse kResponses[] = {
- {5060, 301, 1, 0},
- {5060, 309, 5, 0},
- {5060, 314, 11, 0},
- {5060, 315, 12, 0},
- {5060, 316, 13, 0},
+ {5060, 301, 1, 0}, // Look at the path.
+ {5060, 309, 5, 0}, // Look at the trunk.
+ {5060, 314, 11, 0}, // Use the lawn chair.
+ {5060, 315, 12, 0}, // Look at the radio and cassette player.
+ {5060, 316, 13, 0}, // Use the radio and cassette player.
};
const RunawayItemAction kItemActions[] = {
@@ -92,13 +92,13 @@ const RunawayRoom kRunawayScene5060 = {
RunawayRoomScene::ActionResult RunawayRoomScene::execute5060(uint16 action) {
switch (action) {
- case 302:
+ case 302: // Go to the desert overview.
leaveDesertRoom(5010);
break;
- case 303:
+ case 303: // Look at Lula.
say(2, _random.getRandomBit() * (_desert.lulaHelped ? 2 : 1));
break;
- case 304:
+ case 304: // Talk to Lula.
if (_desert.guard == 2) {
say(20, 12);
} else if (_desert.lulaHelped) {
@@ -108,7 +108,7 @@ RunawayRoomScene::ActionResult RunawayRoomScene::execute5060(uint16 action) {
deferDesertAction(404);
}
break;
- case 404: {
+ case 404: { // Let Lula finish dancing before talking.
Common::Array<byte> frames;
for (uint i = 120 + (_now / 80) % 75; i < 195; ++i)
frames.push_back(i);
@@ -120,7 +120,7 @@ RunawayRoomScene::ActionResult RunawayRoomScene::execute5060(uint16 action) {
beginRoomAnimation(action, 12, 195, frames.data(), frames.size(), false);
break;
}
- case 1404:
+ case 1404: // Ask Lula about distracting Stud.
if (!_desert.guardWeaknessKnown) {
if (!_desert.visited[6]) {
say(20, 1);
@@ -151,7 +151,7 @@ RunawayRoomScene::ActionResult RunawayRoomScene::execute5060(uint16 action) {
}
deferDesertAction(414);
break;
- case 414: {
+ case 414: { // Let Lula resume dancing.
Common::Array<byte> frames;
for (uint i = 95; i < 120; ++i)
frames.push_back(i);
@@ -160,29 +160,29 @@ RunawayRoomScene::ActionResult RunawayRoomScene::execute5060(uint16 action) {
beginRoomAnimation(action, 12, 195, frames.data(), frames.size(), false);
break;
}
- case 1414:
+ case 1414: // Finish the conversation with Lula.
break;
- case 305:
+ case 305: // Look at Mariola.
say(3, _desert.mariolaHelped != 0);
break;
- case 306:
+ case 306: // Talk to Mariola.
_facing = 4;
say(19, _random.getRandomNumber(2));
break;
- case 307:
+ case 307: // Look inside the bus.
say(4, _desert.visited[9] != 0);
break;
- case 308:
+ case 308: // Enter the bus.
beginRoomAnimation(action, 5, 22);
break;
- case 1308:
+ case 1308: // Finish entering the bus.
leaveDesertRoom(5170);
break;
- case 310:
+ case 310: // Search the trunk.
say(6, _desert.ballTaken ? 2 : 0);
beginRoomAnimation(action, 10, 28, kSearchTrunkFrames, _desert.ballTaken ? ARRAYSIZE(kSearchTrunkFrames) : 57);
break;
- case 1310:
+ case 1310: // Collect the basketball from the trunk.
if (_desert.ballTaken) {
say(6, 3);
} else {
@@ -192,12 +192,12 @@ RunawayRoomScene::ActionResult RunawayRoomScene::execute5060(uint16 action) {
holdRoomAnimation(410, 10, 28, 14);
}
break;
- case 1410:
+ case 1410: // Close the trunk.
beginRoomAnimation(420, 10, 28, kSearchTrunkFrames + 57, ARRAYSIZE(kSearchTrunkFrames) - 57);
break;
- case 1420:
+ case 1420: // Finish searching the trunk.
break;
- case 311:
+ case 311: // Look at the tanning oil.
if (!_desert.tanningOil) {
say(7);
_desert.tanningOil = 1;
@@ -205,22 +205,22 @@ RunawayRoomScene::ActionResult RunawayRoomScene::execute5060(uint16 action) {
say(163, 0, true);
}
break;
- case 312:
+ case 312: // Ask Mariola for the tanning oil.
if (!_desert.tanningOil)
execute5060(311);
say(8);
deferDesertAction(412);
break;
- case 412:
+ case 412: // Let Mariola turn toward Brian.
beginRoomAnimation(action, 7, 201, kMariolaTurnFrames, ARRAYSIZE(kMariolaTurnFrames), false);
break;
- case 1412:
+ case 1412: // Listen to Mariola's answer about the oil.
say(9, _desert.mariolaHelped != 0, false, 1);
if (_desert.mariolaHelped)
say(8, 1);
deferDesertAction(422);
break;
- case 422:
+ case 422: // Take the oil if Mariola agrees.
beginRoomAnimation(432, 7, 201, kMariolaRestFrames, ARRAYSIZE(kMariolaRestFrames), false);
if (_desert.mariolaHelped) {
_desert.tanningOil = 2;
@@ -228,19 +228,19 @@ RunawayRoomScene::ActionResult RunawayRoomScene::execute5060(uint16 action) {
say(8, 2);
}
return kBackgroundChanged;
- case 1432:
+ case 1432: // Finish asking for the tanning oil.
break;
- case 313:
+ case 313: // Look at the lawn chair.
say(10, _desert.busPosterSeen != 0);
_desert.busPosterSeen = 1;
break;
- case 317:
+ case 317: // Look at Mariola's sunglasses.
say(14, _desert.mariolaHelped != 0);
break;
- case 318:
+ case 318: // Take Mariola's sunglasses.
say(15, !_inventory.contains(20) ? 0 : _desert.mariolaHelped ? 2 : 1);
break;
- case 319:
+ case 319: // Give the repaired basketball to Lula.
if (!_desert.guardWeaknessKnown)
say(17, 7);
else if (_inventory.desert().ball < 2)
@@ -248,7 +248,7 @@ RunawayRoomScene::ActionResult RunawayRoomScene::execute5060(uint16 action) {
else
return kUnhandled;
break;
- case 320:
+ case 320: // Give the darkened sunglasses to Mariola.
if (!_inventory.desert().glasses) {
say(16);
} else if (_inventory.desert().glasses == 1) {
@@ -258,7 +258,7 @@ RunawayRoomScene::ActionResult RunawayRoomScene::execute5060(uint16 action) {
say(15, 2);
}
break;
- case 1320:
+ case 1320: // Finish replacing Mariola's sunglasses.
_desert.mariolaHelped = 1;
_inventory.desert().glasses = 2;
say(16, 2);
diff --git a/engines/hollywood/runaway/scene5070.cpp b/engines/hollywood/runaway/scene5070.cpp
index 4b10cdd4744..18bac9c94aa 100644
--- a/engines/hollywood/runaway/scene5070.cpp
+++ b/engines/hollywood/runaway/scene5070.cpp
@@ -38,10 +38,10 @@ const RunawayHotspot kHotspots[] = {
};
const RunawayResponse kResponses[] = {
- {5070, 302, 1, 0},
- {5070, 307, 4, 0},
- {5070, 308, 5, 0},
- {5070, 309, 6, 0},
+ {5070, 302, 1, 0}, // Look at the path.
+ {5070, 307, 4, 0}, // Look at the oil well.
+ {5070, 308, 5, 0}, // Use the oil well.
+ {5070, 309, 6, 0}, // Look at the tree.
};
const RunawayItemAction kItemActions[] = {
@@ -63,27 +63,27 @@ const RunawayRoom kRunawayScene5070 = {
RunawayRoomScene::ActionResult RunawayRoomScene::execute5070(uint16 action) {
RunawaySaveState::DesertItems &items = _inventory.desert();
switch (action) {
- case 301:
+ case 301: // Go to the desert overview.
leaveDesertRoom(5010);
break;
- case 305:
+ case 305: // Look at the detonator.
say(2, _random.getRandomBit());
break;
- case 306: {
+ case 306: { // Use the detonator.
const byte variation = _random.getRandomBit();
say(3, variation);
if (variation)
say(3, 2);
break;
}
- case 310:
+ case 310: // Use the tree.
say(5, 0, true);
break;
- case 311:
+ case 311: // Place the dynamite at the oil well.
say(7);
beginRoomAnimation(action, 11, 40);
break;
- case 1311:
+ case 1311: // Finish setting the explosives.
_desert.dynamitePlaced = 1;
items.bombReady = 1;
_inventory.remove(5);
@@ -93,28 +93,28 @@ RunawayRoomScene::ActionResult RunawayRoomScene::execute5070(uint16 action) {
leaveDesertRoom(5062);
}
return kBackgroundChanged;
- case 312:
+ case 312: // Use the bucket with the oil well.
if (items.bucket != 1)
say(17, 0, true);
else
say(8, _desert.dynamitePlaced != 0);
break;
- case 313:
+ case 313: // Look at the rock.
say(9, _desert.dynamitePlaced != 0);
break;
- case 314:
+ case 314: // Use the rock.
say(10);
break;
- case 315:
+ case 315: // Look at the puddle of oil.
say(11, _desert.oilSeen != 0);
_desert.oilSeen = 1;
break;
- case 316:
+ case 316: // Take oil from the puddle.
if (!_desert.oilSeen)
execute5070(315);
say(12);
break;
- case 317:
+ case 317: // Dip the sunglasses in the oil.
if (items.glasses)
say(13, items.glasses + 1);
else {
@@ -122,7 +122,7 @@ RunawayRoomScene::ActionResult RunawayRoomScene::execute5070(uint16 action) {
beginRoomAnimation(action, 9, 29);
}
break;
- case 1317:
+ case 1317: // Finish darkening the sunglasses.
items.glasses = 1;
_inventory.select(0);
say(13, 1);
diff --git a/engines/hollywood/runaway/scene5080.cpp b/engines/hollywood/runaway/scene5080.cpp
index 91e5b2b4e16..82a6286a554 100644
--- a/engines/hollywood/runaway/scene5080.cpp
+++ b/engines/hollywood/runaway/scene5080.cpp
@@ -19,6 +19,7 @@
*
*/
+#include "common/textconsole.h"
#include "common/util.h"
#include "hollywood/runaway/scene.h"
#include "hollywood/runaway/scene_data.h"
@@ -43,15 +44,18 @@ const RunawayHotspot kHotspots[] = {
};
const RunawayResponse kResponses[] = {
- {5080, 302, 1, 0},
- {5080, 308, 7, 0},
- {5080, 310, 9, 0},
- {5080, 311, 10, 0},
- {5080, 319, 16, 0},
- {5080, 320, 17, 0},
- {5080, 321, 18, 0},
- {5080, 324, 19, 0},
- {5080, 325, 20, 0},
+ {5080, 302, 1, 0}, // Look at the path.
+ {5080, 304, 3, 0}, // Use the wooden box.
+ {5080, 308, 7, 0}, // Look at the explosives.
+ {5080, 310, 9, 0}, // Look at the water tank.
+ {5080, 311, 10, 0}, // Use the water tank.
+ {5080, 312, 11, 0}, // Look at the train car.
+ {5080, 318, 15, 0}, // Read the warning sign.
+ {5080, 319, 16, 0}, // Take the warning sign.
+ {5080, 320, 17, 0}, // Look at the ladder.
+ {5080, 321, 18, 0}, // Climb the ladder.
+ {5080, 324, 19, 0}, // Use the crowbar with the shed door.
+ {5080, 325, 20, 0}, // Use an item with the water tank.
};
const RunawayItemAction kItemActions[] = {
@@ -74,48 +78,48 @@ const RunawayRoom kRunawayScene5080 = {
RunawayRoomScene::ActionResult RunawayRoomScene::execute5080(uint16 action) {
RunawaySaveState::DesertItems &items = _inventory.desert();
switch (action) {
- case 301:
+ case 301: // Go to the desert overview.
leaveDesertRoom(5010);
break;
- case 303:
+ case 303: // Look inside the wooden box.
say(2);
break;
- case 305:
+ case 305: // Look at the shed.
say(4, _desert.antsDistracted);
break;
- case 306:
+ case 306: // Look at the shed door.
say(5, _desert.shedTried);
break;
- case 307:
+ case 307: // Try to open the shed.
if (_desert.antsDistracted) {
say(14, 0, true);
} else {
beginRoomAnimation(action, 25, 28);
}
break;
- case 1307:
+ case 1307: // Finish trying the jammed door.
say(6, _desert.shedTried);
_desert.shedTried = 1;
break;
- case 309:
+ case 309: // Take the dynamite.
_desert.dynamite = 2;
_inventory.add(5);
say(8);
return kBackgroundChanged;
- case 313:
+ case 313: // Enter the train car.
if (!_desert.trainEntered) {
say(12);
_desert.trainEntered = 1;
}
beginRoomAnimationRange(action, 23, 35, 0, 27);
break;
- case 1313:
+ case 1313: // Finish entering the train car.
leaveDesertRoom(5110);
break;
- case 316:
+ case 316: // Look at the anthill.
say(13, _desert.antsDistracted ? 2 : 0);
break;
- case 317:
+ case 317: // Use the anthill.
if (_desert.antsDistracted) {
say(14, 2);
} else {
@@ -123,7 +127,7 @@ RunawayRoomScene::ActionResult RunawayRoomScene::execute5080(uint16 action) {
say(14, 1);
}
break;
- case 326:
+ case 326: // Smear the peanut mixture on the shed.
if (!items.antTrickKnown) {
say(3, 0, true);
} else if (items.helmet != 3) {
@@ -131,20 +135,83 @@ RunawayRoomScene::ActionResult RunawayRoomScene::execute5080(uint16 action) {
} else {
say(21);
walkTo(Common::Point(564, 497), 7, true);
- beginRoomAnimation(action, 26, 38);
+ byte brian[49] = {}, butter[49] = {};
+ for (uint i = 1; i < 39; ++i)
+ brian[i] = i - 1;
+ for (uint i = 39; i < ARRAYSIZE(brian); ++i)
+ brian[i] = 48 - i;
+ for (uint i = 27; i < ARRAYSIZE(butter); ++i)
+ butter[i] = MIN<uint>(12, i - 26);
+ beginRoomAnimation(action, 26, 38, brian, ARRAYSIZE(brian));
+ setRoomAnimationOverlay(27, 13, butter, ARRAYSIZE(butter));
}
break;
- case 1326:
+ case 1326: // Finish spreading the mixture and watch for ants.
+ _secondaryAnimation.draw(_background, 12, 0, 0);
+ say(21, 1);
+ deferDesertAction(426);
+ break;
+ case 426: // Start the ants approaching the shed.
+ if (!_machine.load(_archive, 22, 133))
+ error("Cannot load Runaway ants animation");
+ _ambientFrame = 0;
+ _ambientTick = _now;
+ deferDesertAction(436);
+ break;
+ case 436: // Wait for the ants to swarm.
+ if (_now - _ambientTick < 4000) {
+ deferDesertAction(action);
+ } else {
+ say(21, 2);
+ deferDesertAction(446);
+ }
+ break;
+ case 446: // Step back from the ants.
+ walkTo(Common::Point(906, 450), 5, true);
+ deferDesertAction(456);
+ break;
+ case 456: // Watch the ants consume the shed.
+ if (_ambientFrame < 132) {
+ deferDesertAction(action);
+ } else {
+ say(21, 3);
+ deferDesertAction(466);
+ }
+ break;
+ case 466: // Expose the dynamite and replace the shed map.
_desert.antsDistracted = 1;
_desert.dynamite = 1;
items.helmet = 4;
- for (byte variation = 1; variation <= 4; ++variation)
- say(21, variation);
+ _audio.stopEffect();
+ deferDesertAction(476);
return kBackgroundChanged;
+ case 476: // Approach the remains of the shed.
+ walkTo(Common::Point(301, 478), 7);
+ deferDesertAction(486);
+ break;
+ case 486: // Describe the exposed dynamite.
+ say(21, 4);
+ break;
default:
return kUnhandled;
}
return kHandled;
}
+void RunawayRoomScene::updateScene5080() {
+ if (_roomAction < 436 || _roomAction > 466)
+ return;
+ const uint frame = MIN<uint>(132, (_now - _ambientTick) / 80);
+ if (_ambientFrame < 36 && frame >= 36)
+ _audio.playEffect(60);
+ _ambientFrame = frame;
+}
+
+void RunawayRoomScene::drawScene5080(Graphics::ManagedSurface &viewport) {
+ const uint frame = (_now / 80) % 92;
+ _npc.draw(viewport, frame <= 46 ? frame : 92 - frame, _camera.x, -_camera.y);
+ if (_roomAction >= 436 && _roomAction <= 466)
+ _machine.draw(viewport, _ambientFrame, _camera.x, -_camera.y);
+}
+
} // End of namespace Hollywood
diff --git a/engines/hollywood/runaway/scene5100.cpp b/engines/hollywood/runaway/scene5100.cpp
index 33d94e2a139..2c152a9e1a3 100644
--- a/engines/hollywood/runaway/scene5100.cpp
+++ b/engines/hollywood/runaway/scene5100.cpp
@@ -69,16 +69,16 @@ const RunawayHotspot kHotspots[] = {
};
const RunawayResponse kResponses[] = {
- {5100, 301, 2, 0},
- {5100, 308, 16, 0},
- {5100, 311, 18, 0},
- {5100, 312, 19, 0},
- {5100, 316, 22, 0},
- {5100, 318, 24, 0},
- {5100, 319, 25, 0},
- {5100, 320, 26, 0},
- {5100, 322, 8, 0},
- {5100, 324, 28, 0},
+ {5100, 301, 2, 0}, // Look at the path.
+ {5100, 308, 16, 0}, // Use the motorcycle.
+ {5100, 311, 18, 0}, // Look at the ants.
+ {5100, 312, 19, 0}, // Use the ants.
+ {5100, 316, 22, 0}, // Use the left barrel.
+ {5100, 318, 24, 0}, // Use the right barrel.
+ {5100, 319, 25, 0}, // Look at the helicopter.
+ {5100, 320, 26, 0}, // Use the helicopter.
+ {5100, 322, 8, 0}, // Take the beer can.
+ {5100, 324, 28, 0}, // Use the bucket.
};
const RunawayItemAction kItemActions[] = {
@@ -144,10 +144,10 @@ void RunawayRoomScene::walkHangar(Common::Point target, byte facing) {
RunawayRoomScene::ActionResult RunawayRoomScene::execute5100(uint16 action) {
switch (action) {
- case 302:
+ case 302: // Go to the desert overview.
leaveDesertRoom(5010);
break;
- case 303:
+ case 303: // Look through the barn doors.
if (!_desert.barnDoor) {
Common::Array<byte> frames;
frames.push_back(1);
@@ -163,17 +163,17 @@ RunawayRoomScene::ActionResult RunawayRoomScene::execute5100(uint16 action) {
say(3, _desert.barnDoor == 1 ? 3 : 4);
}
break;
- case 1303:
+ case 1303: // Describe the hangar after peeking inside.
_desert.barnDoor = 1;
say(3, 1);
say(3, 2);
break;
- case 304:
+ case 304: // Enter the hangar.
say(4, _desert.barnDoor);
if (_desert.barnDoor != 2)
deferDesertAction(404);
break;
- case 404:
+ case 404: // Walk behind the barn doors.
_desert.barnDoor = 1;
_desert.insideBarn = 1;
if (!applyBackground5100())
@@ -182,32 +182,32 @@ RunawayRoomScene::ActionResult RunawayRoomScene::execute5100(uint16 action) {
walkHangar(Common::Point(680, 355), 0);
deferDesertAction(414);
break;
- case 414:
+ case 414: // Approach Stud from inside the hangar.
walkHangar(Common::Point(253, 418), 4);
break;
- case 305:
+ case 305: // Look at the peanut butter jar.
say(10, _desert.peanutButter != 0);
if (!_desert.peanutButter)
_desert.peanutButter = 1;
break;
- case 306:
+ case 306: // Take the peanut butter jar.
if (!_desert.peanutButter)
execute5100(305);
say(11);
deferDesertAction(406);
break;
- case 406:
+ case 406: // Collect the jar and attract Stud's attention.
_inventory.add(19);
_desert.peanutButter = 2;
say(11, 1);
say(12, 0, false, 1);
deferDesertAction(416);
return kBackgroundChanged;
- case 416:
+ case 416: // Approach Stud to ask about the jar.
walkTo(Common::Point(_desertHotspots[6].x, _desertHotspots[6].y), 7);
deferDesertAction(426);
break;
- case 426:
+ case 426: // Learn about the ants from Stud.
say(11, 2);
say(12, 1, false, 1);
say(11, 3);
@@ -218,20 +218,20 @@ RunawayRoomScene::ActionResult RunawayRoomScene::execute5100(uint16 action) {
say(11, 5);
_inventory.desert().antTrickKnown = 1;
break;
- case 307: {
+ case 307: { // Look at the motorcycle.
const byte variation = _random.getRandomBit();
say(15, variation);
if (variation)
_desert.motorcycleSeen = 1;
break;
}
- case 309:
+ case 309: // Look at Stud.
say(5, _desert.insideBarn ? _random.getRandomNumber(3) : 4 + _random.getRandomBit());
break;
- case 310:
+ case 310: // Talk to Stud.
say(6, !_desert.insideBarn);
break;
- case 313:
+ case 313: // Look at the loose footrest.
if (!_desert.footrestSeen) {
say(20);
_desert.footrestSeen = 1;
@@ -239,38 +239,38 @@ RunawayRoomScene::ActionResult RunawayRoomScene::execute5100(uint16 action) {
say(172, 0, true);
}
break;
- case 314:
+ case 314: // Take the footrest.
if (!_desert.footrestSeen)
execute5100(313);
_inventory.add(21);
_desert.footrest = 2;
say(18, 0, true);
return kBackgroundChanged;
- case 315:
+ case 315: // Look at the left barrel.
say(21, _random.getRandomBit());
break;
- case 317:
+ case 317: // Look at the right barrel.
say(23, _random.getRandomNumber(2));
break;
- case 321:
+ case 321: // Look at the beer can.
say(7, _desert.beerSeen != 0);
_desert.beerSeen = 1;
break;
- case 323:
+ case 323: // Look at the bucket.
say(27, _random.getRandomBit());
break;
- case 325:
+ case 325: // Leave the hangar through the side entrance.
walkHangar(Common::Point(680, 355), 0);
deferDesertAction(425);
break;
- case 425:
+ case 425: // Walk outside the barn doors.
walkHangar(Common::Point(1348, 332), 5);
deferDesertAction(435);
break;
- case 435:
+ case 435: // Restore the exterior hangar map.
_desert.insideBarn = 0;
return kBackgroundChanged;
- case 327:
+ case 327: // Pry the footrest off the motorcycle.
if (_desert.footrest) {
say(17, 2);
} else {
@@ -293,17 +293,17 @@ RunawayRoomScene::ActionResult RunawayRoomScene::execute5100(uint16 action) {
setRoomAnimationOverlay(7, 27, footrest, ARRAYSIZE(footrest));
}
break;
- case 1327:
+ case 1327: // Finish loosening the footrest.
_desert.footrest = 1;
say(17, 1);
return kBackgroundChanged;
- case 328:
+ case 328: // Put the sleeping pill in Stud's beer.
if (_desert.guard)
return kUnhandled;
say(9);
_desert.guardWeaknessKnown = 1;
break;
- case 329:
+ case 329: // Try to walk past Stud.
say(1, _random.getRandomBit());
break;
default:
diff --git a/engines/hollywood/runaway/scene5110.cpp b/engines/hollywood/runaway/scene5110.cpp
index d6d75abc187..a4b7348d754 100644
--- a/engines/hollywood/runaway/scene5110.cpp
+++ b/engines/hollywood/runaway/scene5110.cpp
@@ -39,14 +39,16 @@ const RunawayHotspot kHotspots[] = {
};
const RunawayResponse kResponses[] = {
- {5110, 301, 1, 0},
- {5110, 305, 4, 0},
- {5110, 306, 5, 0},
- {5110, 307, 6, 0},
- {5110, 308, 7, 0},
- {5110, 313, 12, 0},
- {5110, 314, 13, 0},
- {5110, 315, 14, 0},
+ {5110, 301, 1, 0}, // Look at the exit door.
+ {5110, 304, 3, 0}, // Open the compartment door by hand.
+ {5110, 305, 4, 0}, // Look at the chain.
+ {5110, 306, 5, 0}, // Pull the chain.
+ {5110, 307, 6, 0}, // Look at the contraptions.
+ {5110, 308, 7, 0}, // Use the contraptions.
+ {5110, 313, 12, 0}, // Look at the clock.
+ {5110, 314, 13, 0}, // Use the clock.
+ {5110, 315, 14, 0}, // Use the crowbar with the barrel.
+ {5110, 318, 15, 0}, // Use the crowbar with the chain.
};
const RunawayItemAction kItemActions[] = {
@@ -73,27 +75,27 @@ const RunawayRoom kRunawayScene5110 = {
RunawayRoomScene::ActionResult RunawayRoomScene::execute5110(uint16 action) {
RunawaySaveState::DesertItems &items = _inventory.desert();
switch (action) {
- case 302:
+ case 302: // Leave the train car.
leaveDesertRoom(5081);
break;
- case 303:
+ case 303: // Look at the closed compartment door.
say(2, _desert.trainDoorOpen != 0);
break;
- case 309:
+ case 309: // Look at the barrel.
say(8, _desert.barrel);
if (!_desert.barrel)
_desert.barrel = 1;
break;
- case 310:
+ case 310: // Use the barrel.
if (!_desert.barrel)
execute5110(309);
say(9, _desert.barrel == 2);
break;
- case 311:
+ case 311: // Look inside the bucket.
say(10, _desert.screwSeen != 0);
_desert.screwSeen = 1;
break;
- case 312:
+ case 312: // Take the screw from the bucket.
if (_desert.screwTaken)
say(11, 2);
else {
@@ -105,11 +107,11 @@ RunawayRoomScene::ActionResult RunawayRoomScene::execute5110(uint16 action) {
say(11, 1);
}
break;
- case 316:
+ case 316: // Use the screw with the barrel.
say(16);
_desert.powderNeeded = 1;
break;
- case 317:
+ case 317: // Drill the barrel with the makeshift drill.
if (!_desert.bucket) {
say(17);
_desert.powderNeeded = 1;
@@ -120,12 +122,12 @@ RunawayRoomScene::ActionResult RunawayRoomScene::execute5110(uint16 action) {
say(17, 3);
}
break;
- case 1317:
+ case 1317: // Finish filling the bucket with gunpowder.
_desert.barrel = 2;
_desert.bucket = 2;
say(17, 2);
return kBackgroundChanged;
- case 319:
+ case 319: // Pry open the compartment door.
if (_desert.trainDoorOpen)
say(18, 3);
else {
@@ -133,16 +135,16 @@ RunawayRoomScene::ActionResult RunawayRoomScene::execute5110(uint16 action) {
beginRoomAnimation(action, 10, 49);
}
break;
- case 1319:
+ case 1319: // Collect the peanuts behind the door.
_desert.trainDoorOpen = 1;
say(18, 1);
_inventory.add(18);
say(18, 2);
return kBackgroundChanged;
- case 320:
+ case 320: // Look at the bucket beneath the barrel.
say(19, _desert.bucket != 1);
break;
- case 321:
+ case 321: // Take the bucket beneath the barrel.
if (_desert.bucket == 1)
say(20);
else {
@@ -153,7 +155,7 @@ RunawayRoomScene::ActionResult RunawayRoomScene::execute5110(uint16 action) {
return kBackgroundChanged;
}
break;
- case 322:
+ case 322: // Place the empty bucket beneath the barrel.
if (!_desert.powderNeeded)
say(21);
else if (_desert.bucket)
@@ -163,17 +165,17 @@ RunawayRoomScene::ActionResult RunawayRoomScene::execute5110(uint16 action) {
beginRoomAnimation(action, 11, 49);
}
break;
- case 1322:
+ case 1322: // Finish positioning the bucket.
_desert.bucket = 1;
_inventory.remove(25);
return kBackgroundChanged;
- case 323:
+ case 323: // Use the helmet with the barrel.
if (!_desert.powderNeeded)
say(14, 0, true);
else
say(22, items.helmet == 0);
break;
- case 324:
+ case 324: // Use the butter with the barrel.
say(_desert.powderNeeded ? 23 : 14, 0, !_desert.powderNeeded);
break;
default:
diff --git a/engines/hollywood/runaway/scene5160.cpp b/engines/hollywood/runaway/scene5160.cpp
index 91745b8a994..84896c84ceb 100644
--- a/engines/hollywood/runaway/scene5160.cpp
+++ b/engines/hollywood/runaway/scene5160.cpp
@@ -41,16 +41,17 @@ const RunawayHotspot kHotspots[] = {
};
const RunawayResponse kResponses[] = {
- {5160, 301, 1, 0},
- {5160, 308, 6, 0},
- {5160, 310, 8, 0},
- {5160, 311, 9, 0},
- {5160, 312, 10, 0},
- {5160, 316, 14, 0},
- {5160, 318, 16, 0},
- {5160, 321, 19, 0},
- {5160, 323, 21, 0},
- {5160, 324, 22, 0},
+ {5160, 301, 1, 0}, // Look toward the front of the bus.
+ {5160, 308, 6, 0}, // Take the glass.
+ {5160, 310, 8, 0}, // Use the ventilation grating.
+ {5160, 311, 9, 0}, // Look at the boots.
+ {5160, 312, 10, 0}, // Take the boots.
+ {5160, 316, 14, 0}, // Use the bull.
+ {5160, 317, 15, 0}, // Look at the painting.
+ {5160, 318, 16, 0}, // Take the painting.
+ {5160, 321, 19, 0}, // Give the sleeping pill to Carla.
+ {5160, 323, 21, 0}, // Give the butter to Carla.
+ {5160, 324, 22, 0}, // Put the sleeping pill in the glass.
};
const RunawayItemAction kItemActions[] = {
@@ -95,34 +96,34 @@ void RunawayRoomScene::startCarlaConversation() {
RunawayRoomScene::ActionResult RunawayRoomScene::execute5160(uint16 action) {
switch (action) {
- case 302:
+ case 302: // Go to the front of the bus.
leaveDesertRoom(5171);
break;
- case 303:
+ case 303: // Look at the refrigerator.
say(2, _desert.fridgeOpened);
_desert.fridgeSeen = 1;
break;
- case 304:
+ case 304: // Open the refrigerator without the key.
say(3, _inventory.contains(26));
break;
- case 305:
+ case 305: // Look at Carla.
say(4, _random.getRandomNumber(_desert.carlaStory ? 3 : 2));
break;
- case 306:
+ case 306: // Talk to Carla.
startCarlaConversation();
break;
- case 307:
+ case 307: // Look at the glass.
say(5, _random.getRandomNumber(1));
break;
- case 309:
+ case 309: // Look at the ventilation grating.
say(7, !_desert.ventSeen ? 0 : _desert.ventCleaned ? 2 : 1);
break;
- case 313:
+ case 313: // Look at the needle and thread.
say(11, _desert.needle != 0);
if (!_desert.needle)
_desert.needle = 1;
break;
- case 314:
+ case 314: // Take the needle and thread.
if (!_desert.needle)
execute5160(313);
say(12);
@@ -130,15 +131,15 @@ RunawayRoomScene::ActionResult RunawayRoomScene::execute5160(uint16 action) {
_desert.needle = 2;
say(12, 1);
return kBackgroundChanged;
- case 315:
+ case 315: // Look at the bull.
say(13, _random.getRandomNumber(1));
break;
- case 319:
+ case 319: // Unlock and search the refrigerator.
if (!_desert.fridgeOpened)
say(17);
beginRoomAnimationRange(action, 15, 73, 0, 54);
break;
- case 1319:
+ case 1319: // Collect the butter from the refrigerator.
if (!_desert.fridgeOpened) {
say(17, 1);
_inventory.add(4);
@@ -148,7 +149,7 @@ RunawayRoomScene::ActionResult RunawayRoomScene::execute5160(uint16 action) {
}
deferDesertAction(419);
break;
- case 419: {
+ case 419: { // Close the refrigerator.
static const byte frames[] = {
54, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72,
26, 25, 24, 23, 22, 21, 20, 19, 18, 17, 16, 15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1
@@ -156,13 +157,13 @@ RunawayRoomScene::ActionResult RunawayRoomScene::execute5160(uint16 action) {
beginRoomAnimation(action, 15, 73, frames, ARRAYSIZE(frames));
break;
}
- case 1419:
+ case 1419: // Finish searching the refrigerator.
if (!_desert.fridgeOpened) {
_desert.fridgeOpened = 1;
say(17, 3);
}
break;
- case 320:
+ case 320: // Vacuum the ventilation grating.
if (!_desert.ventSeen)
say(18);
else if (_desert.ventCleaned)
@@ -172,14 +173,14 @@ RunawayRoomScene::ActionResult RunawayRoomScene::execute5160(uint16 action) {
beginRoomAnimation(action, 16, 40);
}
break;
- case 1320:
+ case 1320: // Recover the sleeping pill from the vacuum.
say(18, 2);
_inventory.add(9);
_inventory.desert().pill = 1;
_desert.ventCleaned = 1;
say(18, 3);
break;
- case 322:
+ case 322: // Give the refrigerator key to Carla.
say(20, _desert.fridgeOpened);
break;
default:
diff --git a/engines/hollywood/runaway/scene5170.cpp b/engines/hollywood/runaway/scene5170.cpp
index 4d4fb81965c..9941dd98c78 100644
--- a/engines/hollywood/runaway/scene5170.cpp
+++ b/engines/hollywood/runaway/scene5170.cpp
@@ -49,8 +49,9 @@ const RunawayHotspot kHotspots[] = {
};
const RunawayResponse kResponses[] = {
- {5170, 311, 10, 0},
- {5170, 319, 18, 0},
+ {5170, 303, 3, 0}, // Look toward the back of the bus.
+ {5170, 311, 10, 0}, // Look at the sunglasses.
+ {5170, 319, 18, 0}, // Return lipstick to the shelf.
};
const RunawayItemAction kItemActions[] = {
@@ -72,24 +73,24 @@ const RunawayRoom kRunawayScene5170 = {
RunawayRoomScene::ActionResult RunawayRoomScene::execute5170(uint16 action) {
switch (action) {
- case 301:
+ case 301: // Look outside the bus.
say(1, _desert.busDoor != 0);
break;
- case 302:
+ case 302: // Leave the bus.
if (_desert.busDoor == 0 || _desert.busDoor == 2)
leaveDesertRoom(5061);
else
say(2);
break;
- case 304:
+ case 304: // Go to the back of the bus.
leaveDesertRoom(5160);
break;
- case 305:
+ case 305: // Look at the right-hand shelf.
say(4, _desert.lipstickShelf == 0 ? 0 : _desert.lipstickShelf == 3 ? 2 : 1);
if (!_desert.lipstickShelf)
_desert.lipstickShelf = 1;
break;
- case 306:
+ case 306: // Take lipstick from the shelf.
if (_desert.lipstickShelf < 2) {
say(5);
_inventory.add(10);
@@ -108,12 +109,12 @@ RunawayRoomScene::ActionResult RunawayRoomScene::execute5170(uint16 action) {
say(5, 5);
}
return kBackgroundChanged;
- case 307:
+ case 307: // Look at the door mechanism.
say(6, _desert.crank != 0);
if (!_desert.crank)
_desert.crank = 1;
break;
- case 308:
+ case 308: // Turn the makeshift crank.
if (_desert.crank < 2) {
say(7);
} else {
@@ -121,16 +122,16 @@ RunawayRoomScene::ActionResult RunawayRoomScene::execute5170(uint16 action) {
_audio.playEffect(_desert.busDoor == 1 ? 65 : 64);
}
break;
- case 1308:
+ case 1308: // Finish opening or closing the bus door.
if (!_desert.busDoor)
say(7, 1);
_desert.busDoor = _desert.busDoor == 1 ? 2 : 1;
return kBackgroundChanged;
- case 309:
+ case 309: // Look in the pocket.
say(8);
walkTo(Common::Point(339, 512), 3, true);
break;
- case 310:
+ case 310: // Search the pocket for the refrigerator key.
if (_desert.keyTaken) {
say(9, 2);
} else {
@@ -144,47 +145,47 @@ RunawayRoomScene::ActionResult RunawayRoomScene::execute5170(uint16 action) {
walkTo(Common::Point(340, 511), 3, true);
}
break;
- case 312:
+ case 312: // Take the sunglasses.
say(11);
_inventory.add(20);
_desert.glassesTaken = 1;
say(11, 1);
return kBackgroundChanged;
- case 313:
+ case 313: // Look at the object under the bed.
say(12, _desert.vacuum != 0);
if (!_desert.vacuum)
_desert.vacuum = 1;
break;
- case 314:
+ case 314: // Take the vacuum cleaner.
if (!_desert.vacuum)
say(12);
_inventory.add(22);
_desert.vacuum = 2;
say(13);
return kBackgroundChanged;
- case 315:
+ case 315: // Look at the necklaces.
say(14, _desert.necklacesSeen);
_desert.necklacesSeen = 1;
break;
- case 316:
+ case 316: // Take the necklaces.
if (!_desert.necklacesSeen)
execute5170(315);
say(15);
break;
- case 317:
+ case 317: // Look at the rings and earrings.
say(16, _desert.ringsSeen);
_desert.ringsSeen = 1;
break;
- case 318:
+ case 318: // Take the rings and earrings.
if (!_desert.ringsSeen)
execute5170(317);
say(17);
break;
- case 320:
+ case 320: // Attach the footrest to the door mechanism.
say(19);
beginRoomAnimation(action, 12, 42);
break;
- case 1320:
+ case 1320: // Finish assembling the makeshift crank.
_inventory.remove(21);
_desert.crank = 2;
say(19, 1);
Commit: ac17f7d953f93a09bcc2aa3ea787208adfee4998
https://github.com/scummvm/scummvm/commit/ac17f7d953f93a09bcc2aa3ea787208adfee4998
Author: neuromancer (gustavo.grieco at gmail.com)
Date: 2026-11-19T19:38:52+01:00
Commit Message:
HOLLYWOOD: RUNAWAY: chapters 1 and 2 now have interaction, response, exit, and animation-continuation labels
Changed paths:
engines/hollywood/runaway/scene2010.cpp
engines/hollywood/runaway/scene2020.cpp
engines/hollywood/runaway/scene2060.cpp
engines/hollywood/runaway/scene2080.cpp
engines/hollywood/runaway/scene4010.cpp
engines/hollywood/runaway/scene4030.cpp
engines/hollywood/runaway/scene4050.cpp
engines/hollywood/runaway/scene4060.cpp
engines/hollywood/runaway/scene4070.cpp
engines/hollywood/runaway/scene4090.cpp
engines/hollywood/runaway/scene4100.cpp
engines/hollywood/runaway/scene4140.cpp
diff --git a/engines/hollywood/runaway/scene2010.cpp b/engines/hollywood/runaway/scene2010.cpp
index 682a462d638..fd04acdc170 100644
--- a/engines/hollywood/runaway/scene2010.cpp
+++ b/engines/hollywood/runaway/scene2010.cpp
@@ -98,16 +98,56 @@ void RunawayOpening::enter(Step step, uint32 now) {
_row = 0;
_speech.stop();
switch (step) {
- case kSitDown: _firstFrame = 0; _lastFrame = 20; _headBank = 0; break;
- case kLeanForward: _firstFrame = 161; _lastFrame = 177; _headBank = 0; break;
- case kLeanBack: _firstFrame = 177; _lastFrame = 161; _headBank = 0; break;
- case kTurnToScreen: _firstFrame = 128; _lastFrame = 160; _headBank = 0; break;
- case kTurnBack: _firstFrame = 160; _lastFrame = 128; _headBank = 0; break;
- case kIntroduction: _bodyFrame = 20; _headBank = 1; speak(0, 0); break;
- case kQuestion: _bodyFrame = 177; _headBank = 5; speak(0, 1); break;
- case kBackground: _bodyFrame = 20; _headBank = 1; speak(0, 2); break;
- case kJourney: _bodyFrame = 160; _headBank = 4; speak(0, 3); break;
- case kLastNarration: _bodyFrame = 20; _headBank = 1; speak(0, 9); break;
+ case kSitDown:
+ _firstFrame = 0;
+ _lastFrame = 20;
+ _headBank = 0;
+ break;
+ case kLeanForward:
+ _firstFrame = 161;
+ _lastFrame = 177;
+ _headBank = 0;
+ break;
+ case kLeanBack:
+ _firstFrame = 177;
+ _lastFrame = 161;
+ _headBank = 0;
+ break;
+ case kTurnToScreen:
+ _firstFrame = 128;
+ _lastFrame = 160;
+ _headBank = 0;
+ break;
+ case kTurnBack:
+ _firstFrame = 160;
+ _lastFrame = 128;
+ _headBank = 0;
+ break;
+ case kIntroduction:
+ _bodyFrame = 20;
+ _headBank = 1;
+ speak(0, 0);
+ break;
+ case kQuestion:
+ _bodyFrame = 177;
+ _headBank = 5;
+ speak(0, 1);
+ break;
+ case kBackground:
+ _bodyFrame = 20;
+ _headBank = 1;
+ speak(0, 2);
+ break;
+ case kJourney:
+ _bodyFrame = 160;
+ _headBank = 4;
+ speak(0, 3);
+ break;
+ case kLastNarration:
+ _bodyFrame = 20;
+ _headBank = 1;
+ speak(0, 9);
+ break;
case kMontage:
startMovie("DATAVA02.001", 0, 700);
_audio.playIntroMusic(4);
@@ -146,16 +186,26 @@ void RunawayOpening::enter(Step step, uint32 now) {
_failed = !_video.seekToFrame(2566);
speak(1, 2);
break;
- case kApproach: startMovie(nullptr, 2578, 2626); break;
- case kUnconscious: speak(1, 3); break;
- case kTurn: startMovie(nullptr, 2638, 2653); break;
+ case kApproach:
+ startMovie(nullptr, 2578, 2626);
+ break;
+ case kUnconscious:
+ speak(1, 3);
+ break;
+ case kTurn:
+ startMovie(nullptr, 2638, 2653);
+ break;
case kHospital:
if (Common::File::exists("DATAVC00.000"))
_failed = !_video.seekToFrame(2655);
speak(1, 4);
break;
- case kHitman: speak(1, 5); break;
- case kReply: speak(1, 6); break;
+ case kHitman:
+ speak(1, 5);
+ break;
+ case kReply:
+ speak(1, 6);
+ break;
case kFilmEnd:
startMovie(nullptr, 2668, 2927);
_audio.playEffect(42);
diff --git a/engines/hollywood/runaway/scene2020.cpp b/engines/hollywood/runaway/scene2020.cpp
index 2ffd869b6f5..7490a28d7fa 100644
--- a/engines/hollywood/runaway/scene2020.cpp
+++ b/engines/hollywood/runaway/scene2020.cpp
@@ -50,44 +50,56 @@ const RunawayHotspot kHotspots[] = {
{"Poster", 454, 455, 1, {329, 328}, {0, 0}},
{"Emergency exit map", 1265, 546, 1, {330, 331}, {1, 0}},
{"Bed", 404, 456, 1, {344, 345}, {0, 0}},
+ // IDs 20-22 hold alternate bed/chart shapes and names in the original.
+ {"", 0, 0, 0, {0, 0}, {0, 0}},
+ {"", 0, 0, 0, {0, 0}, {0, 0}},
+ {"", 0, 0, 0, {0, 0}, {0, 0}},
+ {"Hallway door", 313, 532, 5, {351, 352}, {0, 0}},
};
const RunawayResponse kResponses[] = {
- {kHospitalBedroom, 301, 1, 0},
- {kHospitalBedroom, 304, 4, 0},
- {kHospitalBedroom, 306, 5, 0},
- {kHospitalBedroom, 308, 6, 0},
- {kHospitalBedroom, 310, 7, 0},
- {kHospitalBedroom, 311, 8, 0},
- {kHospitalBedroom, 312, 9, 0},
- {kHospitalBedroom, 320, 16, 0},
- {kHospitalBedroom, 321, 17, 0},
- {kHospitalBedroom, 322, 18, 0},
- {kHospitalBedroom, 323, 19, 0},
- {kHospitalBedroom, 325, 21, 0},
- {kHospitalBedroom, 326, 22, 0},
- {kHospitalBedroom, 327, 23, 0},
- {kHospitalBedroom, 328, 24, 0},
- {kHospitalBedroom, 329, 25, 0},
- {kHospitalBedroom, 331, 27, 0},
- {kHospitalBedroom, 333, 29, 0},
- {kHospitalBedroom, 344, 39, 0},
- {kHospitalBedroom, 345, 40, 0},
+ {kHospitalBedroom, 301, 1, 0}, // Look at the bathroom door.
+ {kHospitalBedroom, 304, 4, 0}, // Look at the glass.
+ {kHospitalBedroom, 306, 5, 0}, // Look at the sleeping pills.
+ {kHospitalBedroom, 308, 6, 0}, // Look at the sheet.
+ {kHospitalBedroom, 310, 7, 0}, // Look at the locker.
+ {kHospitalBedroom, 311, 8, 0}, // Open the locker.
+ {kHospitalBedroom, 312, 9, 0}, // Look at Gina's bag.
+ {kHospitalBedroom, 320, 16, 0}, // Use the fake patient.
+ {kHospitalBedroom, 321, 17, 0}, // Look at the fire sprinkler.
+ {kHospitalBedroom, 322, 18, 0}, // Use the fire sprinkler.
+ {kHospitalBedroom, 323, 19, 0}, // Look at a nurse buzzer.
+ {kHospitalBedroom, 325, 21, 0}, // Look at the radiator.
+ {kHospitalBedroom, 326, 22, 0}, // Use the radiator.
+ {kHospitalBedroom, 327, 23, 0}, // Look at the AIDS poster.
+ {kHospitalBedroom, 328, 24, 0}, // Take a poster.
+ {kHospitalBedroom, 329, 25, 0}, // Look at the organ donor poster.
+ {kHospitalBedroom, 331, 27, 0}, // Take the emergency exit map.
+ {kHospitalBedroom, 333, 29, 0}, // Use Gina's bag with the locker.
+ {kHospitalBedroom, 344, 39, 0}, // Look at the empty bed.
+ {kHospitalBedroom, 345, 40, 0}, // Use the empty bed.
};
const RunawayItemAction kItemActions[] = {
- {kHospitalBedroom, 5, 6, 333, false},
- {kHospitalBedroom, 6, 9, 334, false},
- {kHospitalBedroom, 6, 10, 335},
- {kHospitalBedroom, 9, 12, 343}, // Matches at the sprinkler.
- {kHospitalBedroom, 10, 2, 336, false},
- {kHospitalBedroom, 13, 2, 349}, // Water for Gina.
- {kHospitalBedroom, 14, 19, 341, false},
- {kHospitalBedroom, 15, 2, 337, false},
- {kHospitalBedroom, 16, 9, 339},
- {kHospitalBedroom, 16, 10, 338, false},
- {kHospitalBedroom, 17, 19, 340},
- {kHospitalBedroom, 18, 12, 342},
+ {kHospitalBedroom, 5, 6, 333, false}, // Use Gina's bag with the locker.
+ {kHospitalBedroom, 6, 9, 334, false}, // Put Gina's chart back on her bed.
+ {kHospitalBedroom, 6, 10, 335}, // Put Gina's chart on the decoy's bed.
+ {kHospitalBedroom, 9, 12, 343}, // Use the matches at the sprinkler.
+ {kHospitalBedroom, 10, 2, 336, false}, // Use the wig with Gina.
+ {kHospitalBedroom, 13, 2, 349}, // Use the glass with Gina.
+ {kHospitalBedroom, 14, 19, 341, false}, // Use the pillows with the empty bed.
+ {kHospitalBedroom, 15, 2, 337, false}, // Use the syringe with Gina.
+ {kHospitalBedroom, 16, 9, 339}, // Replace Gina's medical chart.
+ {kHospitalBedroom, 16, 10, 338, false}, // Put the blank medical chart on the other bed.
+ {kHospitalBedroom, 17, 19, 340}, // Use the head with the empty bed.
+ {kHospitalBedroom, 18, 12, 342}, // Use the flammable spray at the sprinkler.
+};
+
+const byte kPeekHallwayFrames[] = {
+ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17,
+ 18, 19, 19, 19, 19, 19, 18, 17, 16, 15, 14, 20, 21, 22, 23, 24,
+ 24, 24, 24, 24, 24, 23, 22, 21, 20, 14, 13, 12, 11, 10, 9, 8,
+ 7, 6, 5, 4, 3, 2, 1, 0
};
// Retail chapter-one film scripts, from 0x43c450..0x4403cb.
@@ -385,43 +397,43 @@ bool RunawayRoomScene::sayHospitalInventory(const RunawayInventory::Reply &reply
RunawayRoomScene::ActionResult RunawayRoomScene::execute2020(uint16 action) {
switch (action) {
- case 302:
+ case 302: // Look at Gina.
say(2, _random.getRandomNumber(2) + (_hospital.attacked ? 3 : 0));
return kHandled;
- case 303:
+ case 303: // Talk to Gina.
say(3, _random.getRandomBit() + (_hospital.attacked ? 2 : 0));
return kHandled;
- case 305:
+ case 305: // Take the glass.
_hospital.glassTaken = 1;
_inventory.add(13);
_facing = 4;
say(62, 0, true);
return kBackgroundChanged;
- case 307:
+ case 307: // Take the sleeping pills.
_hospital.pillsTaken = 1;
_inventory.add(8);
_facing = 4;
say(57, 0, true);
return kBackgroundChanged;
- case 309:
+ case 309: // Take the sheet.
_hospital.sheetTaken = 1;
_inventory.add(7);
_facing = 4;
say(18, _random.getRandomNumber(2), true);
return kBackgroundChanged;
- case 313:
+ case 313: // Take Gina's bag.
_hospital.bagTaken = 1;
_inventory.add(5);
_facing = 6;
say(9, 1);
return kBackgroundChanged;
- case 330:
+ case 330: // Read the emergency exit map.
if (!_hospital.exitMapRead)
say(26);
say(26, _hospital.window ? 2 : 1);
_hospital.exitMapRead = 1;
return kHandled;
- case 332:
+ case 332: // Climb through the window.
if (!_hospital.exitMapRead) {
say(28);
return kHandled;
@@ -431,49 +443,49 @@ RunawayRoomScene::ActionResult RunawayRoomScene::execute2020(uint16 action) {
_hospital.window = MIN<int>(2, _hospital.window + 1);
beginRoomAnimation(action, 4, 42);
return kHandled;
- case 314:
+ case 314: // Look out of the window.
say(10, _hospital.window >= 2);
return kHandled;
- case 315:
- case 316:
+ case 315: // Look at Gina's medical chart.
+ case 316: // Take Gina's medical chart.
say(action == 315 ? 11 : 12, _hospital.chartReplaced);
return kHandled;
- case 317:
- case 318:
+ case 317: // Look at the other medical chart.
+ case 318: // Take the other medical chart.
say(action == 317 ? 13 : 14, _hospital.chartMoved);
return kHandled;
- case 319:
+ case 319: // Look at the fake patient.
say(15, _hospital.attacked);
return kHandled;
- case 324:
+ case 324: // Press a nurse buzzer.
say(20, _hospital.attacked);
return kHandled;
- case 334:
+ case 334: // Put Gina's chart back on her bed.
say(30);
return kHandled;
- case 335:
+ case 335: // Put Gina's chart on the decoy's bed.
if (!_hospital.decoy) {
say(31);
return kHandled;
}
beginRoomAnimation(action, 16, 29);
return kHandled;
- case 336:
+ case 336: // Use the wig with Gina.
say(32);
return kHandled;
- case 337:
+ case 337: // Use the syringe with Gina.
if (_hospital.attacked)
say(33);
else
say(4, 0, true);
return kHandled;
- case 338:
+ case 338: // Put the blank medical chart on the other bed.
if (_inventory.chartWritten())
- say(4, 0, true);
+ say(14, _random.getRandomNumber(2), true);
else
say(34);
return kHandled;
- case 339: {
+ case 339: { // Replace Gina's medical chart.
if (!_inventory.chartWritten()) {
say(34);
return kHandled;
@@ -484,8 +496,8 @@ RunawayRoomScene::ActionResult RunawayRoomScene::execute2020(uint16 action) {
_actionFrames.push_back(frame);
return kHandled;
}
- case 340:
- case 341:
+ case 340: // Use the head with the empty bed.
+ case 341: // Use the pillows with the empty bed.
if (!_inventory.contains(17))
say(36, 5);
else if (!_inventory.headWig())
@@ -500,7 +512,7 @@ RunawayRoomScene::ActionResult RunawayRoomScene::execute2020(uint16 action) {
_actionStage = 0;
}
return kHandled;
- case 342:
+ case 342: // Use the flammable spray at the sprinkler.
if (!_hospital.attacked || !_hospital.medicineRead) {
if (_inventory.contains(9))
say(37, 1);
@@ -513,17 +525,25 @@ RunawayRoomScene::ActionResult RunawayRoomScene::execute2020(uint16 action) {
_roomAction = action;
}
return kHandled;
- case 343:
+ case 343: // Use the matches at the sprinkler.
say(_hospital.attacked && _hospital.medicineRead ? 38 : 37, _hospital.attacked && _hospital.medicineRead ? 0 : 1);
return kHandled;
- case 346:
+ case 346: // Go to the bathroom.
leaveHospitalRoom(kHospitalBathroom, Common::Point(0, 596), 1);
return kHandled;
- case 349:
+ case 349: // Use the glass with Gina.
if (_hospital.attacked)
say(41, _inventory.water() != 0);
else
- say(4, 0, true);
+ say(14, _random.getRandomNumber(2), true);
+ return kHandled;
+ case 351: // Peek through the hallway door.
+ walkTo(Common::Point(313, 532), 5, true);
+ _roomAction = action;
+ _actionStage = 0;
+ return kHandled;
+ case 352: // Try to leave through the hallway door.
+ say(42, _hospital.attacked ? 2 : _random.getRandomBit());
return kHandled;
default:
return kUnhandled;
@@ -539,30 +559,34 @@ float RunawayRoomScene::actorHeight2020() const {
void RunawayRoomScene::update2020() {
if (_hospitalEntryStep && !speaking() && !_walkPath.active()) {
switch (_hospitalEntryStep++) {
- case 1:
+ case 1: // Reflect on Gina's story.
_facing = 4;
say(0, 1);
break;
- case 2:
+ case 2: // Approach Gina.
walkTo(Common::Point(1075, 599));
break;
- case 3:
+ case 3: // Decide to protect Gina.
say(0, 2);
break;
- case 4:
+ case 4: // Finish the hospital introduction.
_facing = 3;
say(0, 3);
_hospitalEntryStep = 0;
break;
- case 5:
+ case 5: // React to the attack on the decoy.
_facing = 4;
say(81, 6);
_hospitalEntryStep = 0;
break;
- case 6:
+ case 6: // Inspect the completed decoy.
say(36, 4);
_hospitalEntryStep = 0;
break;
+ case 7: // Report what Brian saw in the hallway.
+ say(42, _hospital.attacked ? 5 : 4);
+ _hospitalEntryStep = 0;
+ break;
default:
_hospitalEntryStep = 0;
break;
@@ -578,6 +602,16 @@ void RunawayRoomScene::update2020() {
}
} else if (_roomAction == 342) {
startHospitalFilm(kEscapeFilm);
+ } else if (_roomAction == 351 && _actionFrames.empty()) {
+ if (!_actionStage) {
+ say(42, 3);
+ _actionStage = 1;
+ } else if (_actionStage == 1) {
+ walkTo(Common::Point(40, 599), 5, true);
+ _actionStage = 2;
+ } else {
+ beginRoomAnimation(351, 10, 25, kPeekHallwayFrames, ARRAYSIZE(kPeekHallwayFrames));
+ }
}
}
if (_now - _ambientTick >= 80) {
@@ -627,11 +661,17 @@ void RunawayRoomScene::adaptGogFilm(const RunawaySequence::Command *commands) {
} else if (movie == 9 && command.operation == S::kPlay) {
uint targetPart = 1;
if (command.a == 1608) {
- targetPart = 2; command.a = 0; command.b = 23;
+ targetPart = 2;
+ command.a = 0;
+ command.b = 23;
} else if (command.a == 1632 || command.a == 1633) {
- targetPart = 3; command.a = 0; command.b = 54;
+ targetPart = 3;
+ command.a = 0;
+ command.b = 54;
} else if (command.a == 1688) {
- targetPart = 4; command.a = 0; command.b = 24;
+ targetPart = 4;
+ command.a = 0;
+ command.b = 24;
} else if (command.a == 65) {
command.a = 66;
} else if (command.a == 106) {
@@ -663,11 +703,21 @@ void RunawayRoomScene::adaptGogFilm(const RunawaySequence::Command *commands) {
void RunawayRoomScene::startHospitalFilm(HospitalFilm film) {
const RunawaySequence::Command *commands = nullptr;
switch (film) {
- case kGinaStoryFilm: commands = kGinaStory; break;
- case kLedgeFilm: commands = kLedgeCrossing; break;
- case kDecoyFilm: commands = kBuildDecoy; break;
- case kAmbushFilm: commands = kHospitalAmbush; break;
- case kEscapeFilm: commands = kHospitalEscape; break;
+ case kGinaStoryFilm:
+ commands = kGinaStory;
+ break;
+ case kLedgeFilm:
+ commands = kLedgeCrossing;
+ break;
+ case kDecoyFilm:
+ commands = kBuildDecoy;
+ break;
+ case kAmbushFilm:
+ commands = kHospitalAmbush;
+ break;
+ case kEscapeFilm:
+ commands = kHospitalEscape;
+ break;
}
_hospitalFilm = film;
_roomAction = 0;
@@ -718,10 +768,10 @@ void RunawayRoomScene::finishHospitalFilm() {
void RunawayRoomScene::finishHospitalAnimation(uint16 action) {
switch (action) {
- case 332:
+ case 332: // Start the ledge crossing.
startHospitalFilm(kLedgeFilm);
return;
- case 302:
+ case 302: // Return through the storeroom window.
_transition.scene = 2022;
_transition.position = Common::Point(265, 456);
_transition.facing = 3;
@@ -732,20 +782,24 @@ void RunawayRoomScene::finishHospitalAnimation(uint16 action) {
_hospital.storeroomVisited = 1;
_facing = 3;
return;
- case 2022:
+ case 2022: // Finish climbing into Gina's room.
_facing = 3;
return;
- case 335:
+ case 335: // Finish moving Gina's chart to the decoy's bed.
_hospital.chartMoved = 1;
_inventory.remove(6);
say(31, 1);
break;
- case 339:
+ case 339: // Finish replacing Gina's chart.
_hospital.chartReplaced = 1;
_inventory.remove(16);
_inventory.add(6);
say(35);
break;
+ case 351: // Return from peeking through the hallway door.
+ walkTo(Common::Point(313, 532), 4, true);
+ _hospitalEntryStep = 7;
+ return;
default:
return;
}
diff --git a/engines/hollywood/runaway/scene2060.cpp b/engines/hollywood/runaway/scene2060.cpp
index 1168dc0ced1..0655247815f 100644
--- a/engines/hollywood/runaway/scene2060.cpp
+++ b/engines/hollywood/runaway/scene2060.cpp
@@ -47,22 +47,22 @@ const RunawayHotspot kHotspots[] = {
};
const RunawayResponse kResponses[] = {
- {kHospitalStoreroom, 301, 1, 0},
- {kHospitalStoreroom, 304, 2, 0},
- {kHospitalStoreroom, 305, 2, 1},
- {kHospitalStoreroom, 308, 4, 0},
- {kHospitalStoreroom, 316, 8, 0},
- {kHospitalStoreroom, 317, 9, 0},
- {kHospitalStoreroom, 318, 10, 0},
- {kHospitalStoreroom, 319, 10, 1},
- {kHospitalStoreroom, 320, 11, 0},
- {kHospitalStoreroom, 321, 11, 1},
- {kHospitalStoreroom, 322, 12, 0},
- {kHospitalStoreroom, 323, 12, 1},
- {kHospitalStoreroom, 324, 13, 0},
- {kHospitalStoreroom, 325, 14, 0},
- {kHospitalStoreroom, 326, 14, 1},
- {kHospitalStoreroom, 327, 15, 0}
+ {kHospitalStoreroom, 301, 1, 0}, // Look at the window.
+ {kHospitalStoreroom, 304, 2, 0}, // Look at the radiator.
+ {kHospitalStoreroom, 305, 2, 1}, // Use the radiator.
+ {kHospitalStoreroom, 308, 4, 0}, // Look at the spray can.
+ {kHospitalStoreroom, 316, 8, 0}, // Look at the left file cabinet.
+ {kHospitalStoreroom, 317, 9, 0}, // Look at the right file cabinet.
+ {kHospitalStoreroom, 318, 10, 0}, // Look at the bottles.
+ {kHospitalStoreroom, 319, 10, 1}, // Take the bottles.
+ {kHospitalStoreroom, 320, 11, 0}, // Look at the box beneath the book.
+ {kHospitalStoreroom, 321, 11, 1}, // Open the box beneath the book.
+ {kHospitalStoreroom, 322, 12, 0}, // Look at the medicine boxes.
+ {kHospitalStoreroom, 323, 12, 1}, // Take the medicine boxes.
+ {kHospitalStoreroom, 324, 13, 0}, // Look at the serum stand.
+ {kHospitalStoreroom, 325, 14, 0}, // Look at the serum bag.
+ {kHospitalStoreroom, 326, 14, 1}, // Take the serum bag.
+ {kHospitalStoreroom, 327, 15, 0} // Look at the pillows.
};
} // End of anonymous namespace
@@ -96,19 +96,19 @@ void RunawayRoomScene::updateMaps2060() {
RunawayRoomScene::ActionResult RunawayRoomScene::execute2060(uint16 action) {
switch (action) {
- case 302:
+ case 302: // Climb back to Gina's room.
beginRoomAnimation(action, 4, 44);
return kHandled;
- case 303:
+ case 303: // Return to Gina's room without the climbing animation.
_transition.scene = 2022;
_transition.position = Common::Point(265, 456);
_transition.facing = 3;
return kHandled;
- case 306:
+ case 306: // Look inside the syringe box.
say(3, _hospital.syringesSeen);
_hospital.syringesSeen = 1;
return kHandled;
- case 307:
+ case 307: // Take a syringe.
if (_inventory.contains(15)) {
say(3, 3);
} else {
@@ -117,33 +117,33 @@ RunawayRoomScene::ActionResult RunawayRoomScene::execute2060(uint16 action) {
say(64, 0, true);
}
return kHandled;
- case 309:
+ case 309: // Take the spray can.
_hospital.sprayTaken = 1;
_inventory.add(18);
say(18, _random.getRandomNumber(2), true);
return kBackgroundChanged;
- case 310:
+ case 310: // Look at the medical reference book.
say(5, _hospital.book != 0);
_hospital.book = 1;
return kHandled;
- case 311:
+ case 311: // Take the medical reference book.
_hospital.book = 2;
_inventory.add(19);
say(18, _random.getRandomNumber(2), true);
return kBackgroundChanged;
- case 312:
+ case 312: // Look at the blank medical chart.
say(6, _hospital.blankChart != 0);
_hospital.blankChart = 1;
return kHandled;
- case 313:
+ case 313: // Take the blank medical chart.
_hospital.blankChart = 2;
_inventory.add(16);
say(65, 0, true);
return kBackgroundChanged;
- case 314:
+ case 314: // Look at the anatomical model.
say(7, _hospital.headTaken ? 2 : _random.getRandomBit());
return kHandled;
- case 315:
+ case 315: // Take the model head.
if (_hospital.headTaken) {
say(7, 4);
return kHandled;
@@ -153,7 +153,7 @@ RunawayRoomScene::ActionResult RunawayRoomScene::execute2060(uint16 action) {
_inventory.add(17);
say(66, 0, true);
return kBackgroundChanged;
- case 328:
+ case 328: // Take the pillows.
say(15, 1);
_hospital.pillowsTaken = 1;
_inventory.add(14);
diff --git a/engines/hollywood/runaway/scene2080.cpp b/engines/hollywood/runaway/scene2080.cpp
index 22013e1a990..3808dfec6a1 100644
--- a/engines/hollywood/runaway/scene2080.cpp
+++ b/engines/hollywood/runaway/scene2080.cpp
@@ -41,22 +41,21 @@ const RunawayHotspot kHotspots[] = {
};
const RunawayResponse kResponses[] = {
- {kHospitalBathroom, 301, 1, 0},
- {kHospitalBathroom, 308, 2, 0},
- {kHospitalBathroom, 309, 5, 0},
- {kHospitalBathroom, 310, 5, 1},
- {kHospitalBathroom, 313, 8, 0},
- {kHospitalBathroom, 314, 9, 0},
- {kHospitalBathroom, 315, 10, 0},
- {kHospitalBathroom, 317, 12, 0},
- {kHospitalBathroom, 318, 13, 0},
- {kHospitalBathroom, 319, 14, 0},
- {kHospitalBathroom, 321, 16, 0}
+ {kHospitalBathroom, 301, 1, 0}, // Look at the wastebasket.
+ {kHospitalBathroom, 309, 5, 0}, // Look at the faucet.
+ {kHospitalBathroom, 310, 5, 1}, // Use the faucet.
+ {kHospitalBathroom, 313, 8, 0}, // Look at the pipe.
+ {kHospitalBathroom, 314, 9, 0}, // Use the pipe.
+ {kHospitalBathroom, 315, 10, 0}, // Look at the shower nozzle.
+ {kHospitalBathroom, 317, 12, 0}, // Look at the medicine cabinet.
+ {kHospitalBathroom, 318, 13, 0}, // Open the medicine cabinet.
+ {kHospitalBathroom, 319, 14, 0}, // Look at the toilet.
+ {kHospitalBathroom, 321, 16, 0} // Use an item with the pipe.
};
const RunawayItemAction kItemActions[] = {
- {kHospitalBathroom, 13, 2, 307},
- {kHospitalBathroom, 0, 7, 321, false}
+ {kHospitalBathroom, 13, 2, 307}, // Fill the glass at the faucet.
+ {kHospitalBathroom, 0, 6, 321, false} // Use an item with the pipe.
};
// The faucet animation opens with a held frame, then returns from frame 22.
@@ -94,31 +93,31 @@ void RunawayRoomScene::updateMaps2080() {
RunawayRoomScene::ActionResult RunawayRoomScene::execute2080(uint16 action) {
switch (action) {
- case 312:
- case 316:
+ case 312: // Use the sign.
+ case 316: // Use the shower nozzle.
say(action == 312 ? 7 : 11, _hospital.medicineRead);
return kHandled;
- case 302:
+ case 302: // Search the wastebasket for the marker.
_roomAction = action;
_actionStage = 0;
_actionStarted = _now;
_actionStep = 0;
return kHandled;
- case 303:
- case 304:
+ case 303: // Return to Gina's room.
+ case 304: // Return to Gina's room without the door sound.
leaveHospitalRoom(2021, Common::Point(1265, 546), 5);
return kHandled;
- case 305:
+ case 305: // Look at the alcohol bottle.
say(3, _hospital.alcohol == 2 ? 1 : 0);
_hospital.alcohol = 2;
return kHandled;
- case 306:
+ case 306: // Take the alcohol bottle.
_hospital.alcohol = 1;
_inventory.add(12);
_facing = 3;
say(18, _random.getRandomNumber(2), true);
return kBackgroundChanged;
- case 307:
+ case 307: // Fill the glass at the faucet.
if (_inventory.water() == 1) {
say(4, 1);
return kHandled;
@@ -129,8 +128,11 @@ RunawayRoomScene::ActionResult RunawayRoomScene::execute2080(uint16 action) {
_actionStarted = _now;
_actionStep = 0;
return kHandled;
- case 311:
- case 320:
+ case 308: // Look at the bathroom door.
+ say(2, _hospital.attacked);
+ return kHandled;
+ case 311: // Read the sign.
+ case 320: // Use the toilet.
say(action == 311 ? 6 : 15);
_roomAction = action;
return kHandled;
diff --git a/engines/hollywood/runaway/scene4010.cpp b/engines/hollywood/runaway/scene4010.cpp
index c0fe1b8610f..dc2ae7b6877 100644
--- a/engines/hollywood/runaway/scene4010.cpp
+++ b/engines/hollywood/runaway/scene4010.cpp
@@ -217,15 +217,24 @@ void RunawayRoomScene::finishMuseumAnimation(uint16 action) {
refreshMuseum();
}
break;
- case kMuseumLaboratory: finish4050(action); break;
- case kMuseumHall: finish4060(action); break;
- case kMuseumWilly: finish4070(action); break;
- case kMuseumSecurity: finish4100(action); break;
+ case kMuseumLaboratory:
+ finish4050(action);
+ break;
+ case kMuseumHall:
+ finish4060(action);
+ break;
+ case kMuseumWilly:
+ finish4070(action);
+ break;
+ case kMuseumSecurity:
+ finish4100(action);
+ break;
case kMuseumKeypad:
if (action == 414)
leaveMuseumRoom(4063, Common::Point(1153, 297), 7);
break;
- default: break;
+ default:
+ break;
}
}
diff --git a/engines/hollywood/runaway/scene4030.cpp b/engines/hollywood/runaway/scene4030.cpp
index fd186eeffe0..dc6abfa12a5 100644
--- a/engines/hollywood/runaway/scene4030.cpp
+++ b/engines/hollywood/runaway/scene4030.cpp
@@ -31,7 +31,7 @@ const RunawayHotspot kHotspots[] = {
{"Door", 1165, 594, 2, {322, 301}, {0, 0}},
{"Pair of books", 355, 595, 1, {302, 303}, {0, 1}},
{"Crack", 355, 595, 1, {304, 305}, {1, 0}},
- {"Money", 550, 647, 7, {306, 307}, {0, 0}},
+ {"Money", 550, 647, 7, {306, 307}, {1, 0}},
{"Papers", 550, 647, 7, {308, 319}, {1, 0}},
{"Device", 550, 647, 7, {309, 310}, {1, 1}},
{"Shelves", 815, 508, 1, {311, 312}, {0, 0}},
@@ -41,29 +41,29 @@ const RunawayHotspot kHotspots[] = {
};
const RunawayResponse kResponses[] = {
- {kMuseumOffice, 305, 4, 0},
- {kMuseumOffice, 306, 5, 0},
- {kMuseumOffice, 307, 6, 0},
- {kMuseumOffice, 311, 11, 0},
- {kMuseumOffice, 312, 12, 0},
- {kMuseumOffice, 313, 13, 0},
- {kMuseumOffice, 314, 14, 0},
- {kMuseumOffice, 315, 15, 0},
- {kMuseumOffice, 316, 16, 0},
- {kMuseumOffice, 317, 17, 0},
- {kMuseumOffice, 318, 18, 0},
- {kMuseumOffice, 319, 8, 0},
- {kMuseumOffice, 320, 19, 0},
- {kMuseumOffice, 322, 22, 0},
+ {kMuseumOffice, 305, 4, 0}, // Use the crack.
+ {kMuseumOffice, 306, 5, 0}, // Look at the money.
+ {kMuseumOffice, 307, 6, 0}, // Take the money.
+ {kMuseumOffice, 311, 11, 0}, // Look at the right shelves.
+ {kMuseumOffice, 312, 12, 0}, // Take books from the right shelves.
+ {kMuseumOffice, 313, 13, 0}, // Look at the safe.
+ {kMuseumOffice, 314, 14, 0}, // Use the safe.
+ {kMuseumOffice, 315, 15, 0}, // Look at the left shelves.
+ {kMuseumOffice, 316, 16, 0}, // Take books from the left shelves.
+ {kMuseumOffice, 317, 17, 0}, // Look at the window.
+ {kMuseumOffice, 318, 18, 0}, // Open the window.
+ {kMuseumOffice, 319, 8, 0}, // Take the papers.
+ {kMuseumOffice, 320, 19, 0}, // Use an item with the crack.
+ {kMuseumOffice, 322, 22, 0}, // Look at the office door.
};
const RunawayItemAction kItemActions[] = {
- {kMuseumOffice, 17, 3, 321},
- {kMuseumOffice, 0, 3, 320},
+ {kMuseumOffice, 17, 3, 321}, // Open or close the safe with the strange key.
+ {kMuseumOffice, 0, 3, 320}, // Use an item with the crack.
};
const RunawayExit kExits[] = {
- {kMuseumOffice, 301, kMuseumHall, 607, 323, true, true},
+ {kMuseumOffice, 301, kMuseumHall, 607, 323, true, true}, // Leave the office.
};
} // End of anonymous namespace
@@ -108,39 +108,47 @@ RunawayRoomScene::ActionResult RunawayRoomScene::execute4030(uint16 action) {
return kHandled;
}
switch (action) {
- case 302: // Examine the books.
+ case 302: // Look at the books.
say(_books != kUnexamined ? 111 : 1, 0, _books != kUnexamined);
_books = MAX(_books, kIdentified);
return kHandled;
case 303: // Take the books, revealing the crack.
+ if (_books == kUnexamined)
+ say(1);
_books = kTaken;
_inventory.add(16);
say(2);
say(2, 1);
say(2, 2);
return kBackgroundChanged;
- case 304:
+ case 304: // Look at the crack.
say(3, museumChapter() ? _museum.safeUsed : _safeOpen);
return kHandled;
- case 308:
+ case 308: // Look at the papers.
say(7, _moneyIdentified);
_moneyIdentified = true;
return kHandled;
- case 309:
+ case 309: // Look at the tape recorder.
say(9, _recorder != kUnexamined);
_recorder = MAX(_recorder, kIdentified);
return kHandled;
- case 310: // Take the recorder.
+ case 310: // Take the tape recorder.
+ if (_recorder == kUnexamined)
+ say(9);
_recorder = kTaken;
_inventory.add(5);
say(10);
say(10, 1);
return kBackgroundChanged;
- case 311:
- say(11, _museum.shelfBooksSeen);
+ case 311: // Look at the right shelves.
+ say(11, _museum.shelfBooksSeen ? _random.getRandomBit() : 0);
_museum.shelfBooksSeen = 1;
return kHandled;
- case 321: // Toggle the safe with the strange key.
+ case 315: // Look at the left shelves.
+ say(_museum.shelfBooksSeen ? 15 : 11);
+ _museum.shelfBooksSeen = 1;
+ return kHandled;
+ case 321: // Open or close the safe with the strange key.
if (museumChapter()) {
byte brian[52], safe[52];
for (uint i = 0; i < ARRAYSIZE(brian); ++i) {
diff --git a/engines/hollywood/runaway/scene4050.cpp b/engines/hollywood/runaway/scene4050.cpp
index ce006be4474..c95a8f314fb 100644
--- a/engines/hollywood/runaway/scene4050.cpp
+++ b/engines/hollywood/runaway/scene4050.cpp
@@ -55,7 +55,7 @@ const RunawayHotspot kHotspots[] = {
{"Wastepaper basket", 703, 575, 1, {312, 313}, {1, 0}},
{"Tank", 844, 505, 1, {314, 315}, {0, 0}},
{"Machine", 884, 580, 1, {316, 317}, {0, 0}},
- {"Laser", 992, 556, 1, {318, 319}, {0, 0}},
+ {"Laser", 992, 556, 1, {318, 319}, {1, 0}},
{"Shelves", 1327, 521, 1, {320, 321}, {0, 0}},
{"Briefcase", 1277, 514, 7, {322, 323}, {1, 1}},
{"Skeleton", 1211, 510, 7, {324, 325}, {0, 0}},
@@ -63,48 +63,48 @@ const RunawayHotspot kHotspots[] = {
};
const RunawayResponse kResponses[] = {
- {kMuseumLaboratory, 301, 1, 0},
- {kMuseumLaboratory, 306, 6, 0},
- {kMuseumLaboratory, 307, 7, 0},
- {kMuseumLaboratory, 308, 8, 0},
- {kMuseumLaboratory, 309, 9, 0},
- {kMuseumLaboratory, 310, 10, 0},
- {kMuseumLaboratory, 311, 11, 0},
- {kMuseumLaboratory, 314, 12, 0},
- {kMuseumLaboratory, 316, 13, 0},
- {kMuseumLaboratory, 319, 15, 0},
- {kMuseumLaboratory, 320, 16, 0},
- {kMuseumLaboratory, 321, 17, 0},
- {kMuseumLaboratory, 322, 18, 0},
- {kMuseumLaboratory, 324, 20, 0},
- {kMuseumLaboratory, 325, 21, 0},
- {kMuseumLaboratory, 326, 22, 2},
- {kMuseumLaboratory, 332, 27, 0},
- {kMuseumLaboratory, 334, 29, 0},
- {kMuseumLaboratory, 337, 31, 0},
+ {kMuseumLaboratory, 301, 1, 0}, // Look at the laboratory door.
+ {kMuseumLaboratory, 306, 6, 0}, // Look at the electric lathe.
+ {kMuseumLaboratory, 307, 7, 0}, // Use the electric lathe.
+ {kMuseumLaboratory, 308, 8, 0}, // Look at the microscope.
+ {kMuseumLaboratory, 309, 9, 0}, // Use the microscope.
+ {kMuseumLaboratory, 310, 10, 0}, // Look at the water dispenser.
+ {kMuseumLaboratory, 311, 11, 0}, // Use the water dispenser.
+ {kMuseumLaboratory, 314, 12, 0}, // Look at the tank.
+ {kMuseumLaboratory, 316, 13, 0}, // Look at the machine.
+ {kMuseumLaboratory, 319, 15, 0}, // Use the laser.
+ {kMuseumLaboratory, 320, 16, 0}, // Look at the right shelves.
+ {kMuseumLaboratory, 321, 17, 0}, // Take objects from the right shelves.
+ {kMuseumLaboratory, 322, 18, 0}, // Look inside the briefcase.
+ {kMuseumLaboratory, 324, 20, 0}, // Look at the skeleton.
+ {kMuseumLaboratory, 325, 21, 0}, // Use the skeleton.
+ {kMuseumLaboratory, 326, 22, 2}, // Leave the crucifix on the restoration shelves.
+ {kMuseumLaboratory, 332, 27, 0}, // Use an item with the electric lathe.
+ {kMuseumLaboratory, 334, 29, 0}, // Use an item with the microscope.
+ {kMuseumLaboratory, 337, 31, 0}, // Look at the talcum powder brush.
};
const RunawayItemAction kItemActions[] = {
- {kMuseumLaboratory, 7, 2, 326},
- {kMuseumLaboratory, 0, 2, 15},
- {kMuseumLaboratory, 5, 3, 328},
- {kMuseumLaboratory, 7, 3, 327},
- {kMuseumLaboratory, 8, 3, 329},
- {kMuseumLaboratory, 11, 3, 330},
- {kMuseumLaboratory, 12, 3, 330},
- {kMuseumLaboratory, 15, 3, 331},
- {kMuseumLaboratory, 0, 3, 30},
- {kMuseumLaboratory, 14, 4, 333},
- {kMuseumLaboratory, 0, 4, 332},
- {kMuseumLaboratory, 0, 5, 334},
- {kMuseumLaboratory, 0, 7, 19},
- {kMuseumLaboratory, 12, 10, 336},
- {kMuseumLaboratory, 0, 10, 335},
- {kMuseumLaboratory, 0, 11, 15},
+ {kMuseumLaboratory, 7, 2, 326}, // Leave the crucifix on the restoration shelves.
+ {kMuseumLaboratory, 0, 2, 15}, // Use an item with shelves.
+ {kMuseumLaboratory, 5, 3, 328}, // Record Susan's voice.
+ {kMuseumLaboratory, 7, 3, 327}, // Give the crucifix to Susan.
+ {kMuseumLaboratory, 8, 3, 329, false}, // Show the Mayan object to Susan.
+ {kMuseumLaboratory, 11, 3, 330, false}, // Show the Mayan mask to Susan.
+ {kMuseumLaboratory, 12, 3, 330, false}, // Show the ruby to Susan.
+ {kMuseumLaboratory, 15, 3, 331}, // Give the coffee to Susan.
+ {kMuseumLaboratory, 0, 3, 30}, // Use an item with susan.
+ {kMuseumLaboratory, 14, 4, 333}, // Grind the coffee beans with the lathe.
+ {kMuseumLaboratory, 0, 4, 332}, // Use an item with the electric lathe.
+ {kMuseumLaboratory, 0, 5, 334}, // Use an item with the microscope.
+ {kMuseumLaboratory, 0, 7, 19}, // Use an item with wastepaper basket.
+ {kMuseumLaboratory, 12, 10, 336}, // Fit the ruby to the laser.
+ {kMuseumLaboratory, 0, 10, 335}, // Use an item with the laser.
+ {kMuseumLaboratory, 0, 11, 15}, // Use an item with shelves.
};
const RunawayExit kExits[] = {
- {kMuseumLaboratory, 339, kMuseumHall, 873, 311, true, true},
+ {kMuseumLaboratory, 339, kMuseumHall, 873, 311, true, true}, // Leave the laboratory.
};
} // End of anonymous namespace
@@ -145,17 +145,17 @@ void RunawayRoomScene::updateMaps4050() {
RunawayRoomScene::ActionResult RunawayRoomScene::execute4050(uint16 action) {
if (museumChapter()) {
switch (action) {
- case 302:
+ case 302: // Look at the restoration shelves.
say(2, !_museum.restoration ? 0 : _museum.restoration == 2 ? 3 : _museum.susan ? 2 : 1);
_museum.shelvesSeen = 1;
return kHandled;
- case 303:
+ case 303: // Take objects from the restoration shelves.
say(3, _museum.restoration == 1);
return kHandled;
- case 304:
+ case 304: // Look at Susan.
say(4, _museum.susan == 3 ? 2 : _museum.susan == 1 ? 1 : _museum.restoration && _museum.leftLabOnce ? 3 : 0);
return kHandled;
- case 305:
+ case 305: // Talk to Susan.
if (_museum.susan == 3)
say(5);
else if (_museum.susan == 1) {
@@ -165,40 +165,44 @@ RunawayRoomScene::ActionResult RunawayRoomScene::execute4050(uint16 action) {
startConversation(1);
}
return kHandled;
- case 312:
+ case 312: // Look in the wastepaper basket.
say(19, 1, true);
return kHandled;
- case 313:
+ case 313: // Use the wastepaper basket.
say(4, 0, true);
return kHandled;
- case 315:
+ case 315: // Use the tank.
say(7, 0, true);
return kHandled;
- case 317: case 335:
+ case 317: // Use the machine.
+ case 335: // Use an item with the laser.
say(14, _random.getRandomNumber(2), true);
return kHandled;
- case 318:
+ case 318: // Look at the laser.
say(14, _museum.laserUpgraded ? 2 : _museum.laserSeen ? 1 : 0);
return kHandled;
- case 322:
+ case 322: // Look inside the briefcase.
say(18, _museum.varnishSeen);
_museum.varnishSeen = 1;
return kHandled;
- case 326:
+ case 326: // Leave the crucifix on the restoration shelves.
if (_inventory.museum().restoredCrucifix) {
say(22, 2);
} else {
if (!_museum.shelvesSeen)
say(2);
+ _museum.shelvesSeen = 1;
say(22);
beginRoomAnimation(326, 17, 43);
}
return kHandled;
- case 327:
- say(_museum.susan == 3 ? 5 : _inventory.museum().restoredCrucifix ? 22 : 23,
- _inventory.museum().restoredCrucifix ? 2 : 0);
+ case 327: // Give the crucifix to Susan.
+ if (_museum.susan == 3)
+ say(5);
+ else
+ say(_inventory.museum().restoredCrucifix ? 22 : 23, _inventory.museum().restoredCrucifix ? 2 : 0);
return kHandled;
- case 328:
+ case 328: // Record Susan's voice.
if (!_museum.voiceLockSeen)
say(1, 0, true);
else if (_museum.susan == 3)
@@ -211,10 +215,11 @@ RunawayRoomScene::ActionResult RunawayRoomScene::execute4050(uint16 action) {
beginRoomAnimation(328, 21, 56, kRecordSusan, 27);
}
return kHandled;
- case 329: case 330:
+ case 329: // Show the Mayan object to Susan.
+ case 330: // Show the mask or ruby to Susan.
say(_museum.susan == 3 ? 5 : 25);
return kHandled;
- case 331:
+ case 331: // Give the coffee to Susan.
if (_museum.susan != 1)
say(1, 0, true);
else {
@@ -228,7 +233,7 @@ RunawayRoomScene::ActionResult RunawayRoomScene::execute4050(uint16 action) {
setRoomAnimationOverlay(15, 170, susan, ARRAYSIZE(susan));
}
return kHandled;
- case 333:
+ case 333: // Grind the coffee beans with the lathe.
if (_inventory.museum().coffee == 2)
say(1, 2, true);
else if (_inventory.museum().coffee || !_museum.needsGroundCoffee)
@@ -238,7 +243,7 @@ RunawayRoomScene::ActionResult RunawayRoomScene::execute4050(uint16 action) {
beginRoomAnimation(333, 18, 35, kGrindCoffee, ARRAYSIZE(kGrindCoffee));
}
return kHandled;
- case 336:
+ case 336: // Fit the ruby to the laser.
if (!_museum.laserSeen)
say(1, 0, true);
else {
@@ -246,15 +251,16 @@ RunawayRoomScene::ActionResult RunawayRoomScene::execute4050(uint16 action) {
beginRoomAnimation(336, 19, 13);
}
return kHandled;
- case 337:
+ case 337: // Look at the talcum powder brush.
say(31, _museum.talcSeen);
_museum.talcSeen = 1;
return kHandled;
- case 339:
+ case 339: // Leave the laboratory.
_museum.leftLabOnce = 1;
leaveMuseumRoom(4061, Common::Point(873, 311), 3, true);
return kHandled;
- default: break;
+ default:
+ break;
}
}
@@ -264,15 +270,22 @@ RunawayRoomScene::ActionResult RunawayRoomScene::execute4050(uint16 action) {
say(19, 2);
return kHandled;
}
+ if (museumChapter() && !_museum.varnishSeen)
+ say(18);
+ _museum.varnishSeen = 1;
_varnishTaken = true;
_inventory.add(9);
say(19);
say(19, 1);
return kHandled;
case 338: // Take the talcum powder.
+ if (!museumChapter() || !_museum.talcSeen)
+ say(31);
+ _museum.talcSeen = 1;
_talcTaken = true;
_inventory.add(10);
- say(31);
+ if (museumChapter())
+ say(18, _random.getRandomNumber(2), true);
return kBackgroundChanged;
default:
break;
@@ -282,70 +295,71 @@ RunawayRoomScene::ActionResult RunawayRoomScene::execute4050(uint16 action) {
void RunawayRoomScene::finish4050(uint16 action) {
switch (action) {
- case 326:
+ case 326: // Leave the crucifix and collect the Mayan object.
_inventory.remove(7);
_inventory.add(8);
_museum.restoration = 1;
say(22, 1);
break;
- case 328:
+ case 328: // Ask Susan to say her name.
say(24);
holdRoomAnimation(428, 21, 56, 29);
break;
- case 428:
+ case 428: // Press the recorder button.
beginRoomAnimation(438, 21, 56, kRecordSusan + 27, 8);
break;
- case 438:
+ case 438: // Record Susan's reply.
say(24, 1, false, 1);
holdRoomAnimation(448, 21, 56, 29);
break;
- case 448:
+ case 448: // Put the recorder away.
beginRoomAnimation(458, 21, 56, kRecordSusan + 35, 29);
break;
- case 458:
+ case 458: // Remember that Susan's voice was recorded.
_inventory.museum().voiceRecorded = 1;
break;
- case 331:
+ case 331: // Susan drinks the coffee.
_inventory.remove(15);
_audio.playEffect(48, 204);
beginRoomAnimationRange(454, 15, 170, 117, 143, false);
return;
- case 454:
+ case 454: // Finish the exchange with Susan.
say(26, 1);
say(26, 2, false, 1);
deferMuseumAction(453);
break;
- case 333:
+ case 333: // Collect the ground coffee.
_inventory.museum().coffee = 1;
say(28, 1);
break;
- case 336:
+ case 336: // Show the ruby installation film.
startMuseumFilm(kRubyFilm);
return;
- case 405:
+ case 405: // Collect the restored crucifix.
_inventory.add(7);
say(32, 2);
say(32, 3);
break;
- case 456:
+ case 456: // Finish installing the ruby and approach Susan.
_inventory.remove(12);
say(30, 1);
walkTo(Common::Point(464, 544), 3, true);
beginRoomAnimation(452, 23, 95, nullptr, 0, false);
return;
- case 450:
+ case 450: // Show the drilling film.
startMuseumFilm(kDrillingFilm);
return;
- case 451:
+ case 451: // Resume the laboratory after drilling.
_nextLaser = _now + 25000 + _random.getRandomNumber(5000);
break;
- case 452:
+ case 452: // Show the upgraded laser film.
startMuseumFilm(kLaserFilm);
return;
- case 453:
+ case 453: // Show the mobsters film.
startMuseumFilm(kMobstersFilm);
return;
- default: return;
+ default:
+ return;
}
refreshMuseum();
}
diff --git a/engines/hollywood/runaway/scene4060.cpp b/engines/hollywood/runaway/scene4060.cpp
index 8ed6647e2ab..e7ff6e90e27 100644
--- a/engines/hollywood/runaway/scene4060.cpp
+++ b/engines/hollywood/runaway/scene4060.cpp
@@ -44,7 +44,7 @@ const RunawayHotspot kHotspots[] = {
{"Wastepaper basket", 696, 319, 7, {313, 314}, {1, 1}},
{"Door to the restoration laboratory", 873, 311, 7, {315, 316}, {0, 1}},
{"Security door", 1118, 309, 7, {317, 318}, {1, 1}},
- {"Panel", 1153, 297, 7, {319, 320}, {0, 1}},
+ {"Panel", 1153, 297, 7, {319, 320}, {1, 1}},
{"Stairs", 1220, 280, 7, {301, 303}, {0, 1}},
{"Telephone", 1473, 312, 7, {324, 325}, {0, 1}},
{"Display case", 1596, 351, 1, {326, 327}, {0, 0}},
@@ -57,69 +57,69 @@ const RunawayHotspot kHotspots[] = {
};
const RunawayResponse kResponses[] = {
- {kMuseumHall, 301, 1, 0},
- {kMuseumHall, 304, 2, 0},
- {kMuseumHall, 309, 4, 0},
- {kMuseumHall, 311, 5, 0},
- {kMuseumHall, 314, 7, 0},
- {kMuseumHall, 315, 8, 0},
- {kMuseumHall, 317, 9, 0},
- {kMuseumHall, 318, 13, 0},
- {kMuseumHall, 319, 10, 0},
- {kMuseumHall, 321, 11, 0},
- {kMuseumHall, 323, 13, 0},
- {kMuseumHall, 324, 14, 0},
- {kMuseumHall, 326, 16, 0},
- {kMuseumHall, 327, 17, 0},
- {kMuseumHall, 328, 18, 0},
- {kMuseumHall, 329, 19, 0},
- {kMuseumHall, 330, 20, 0},
- {kMuseumHall, 331, 19, 0},
- {kMuseumHall, 332, 21, 0},
- {kMuseumHall, 333, 22, 0},
- {kMuseumHall, 336, 25, 0},
- {kMuseumHall, 339, 29, 0},
- {kMuseumHall, 340, 30, 0},
- {kMuseumHall, 341, 31, 0},
- {kMuseumHall, 343, 34, 0},
- {kMuseumHall, 344, 35, 0},
+ {kMuseumHall, 301, 1, 0}, // Look at the stairs from the upper floor.
+ {kMuseumHall, 304, 2, 0}, // Look at the stairs from the lower floor.
+ {kMuseumHall, 309, 4, 0}, // Look at the Mayan exhibition entrance.
+ {kMuseumHall, 311, 5, 0}, // Look at Clive's office door.
+ {kMuseumHall, 314, 7, 0}, // Take the empty coffee package.
+ {kMuseumHall, 315, 8, 0}, // Look at the laboratory door.
+ {kMuseumHall, 317, 9, 0}, // Look at the security door.
+ {kMuseumHall, 318, 13, 0}, // Enter the analysis laboratory.
+ {kMuseumHall, 319, 10, 0}, // Look at the keypad.
+ {kMuseumHall, 321, 11, 0}, // Look at the coffee machine.
+ {kMuseumHall, 323, 13, 0}, // Try the locked security door.
+ {kMuseumHall, 324, 14, 0}, // Look at the telephone.
+ {kMuseumHall, 326, 16, 0}, // Look at the display case.
+ {kMuseumHall, 327, 17, 0}, // Open the display case.
+ {kMuseumHall, 328, 18, 0}, // Read the left plaque.
+ {kMuseumHall, 329, 19, 0}, // Use the left plaque.
+ {kMuseumHall, 330, 20, 0}, // Read the right plaque.
+ {kMuseumHall, 331, 19, 0}, // Use the right plaque.
+ {kMuseumHall, 332, 21, 0}, // Look at the fire extinguisher.
+ {kMuseumHall, 333, 22, 0}, // Take the fire extinguisher.
+ {kMuseumHall, 336, 25, 0}, // Show the crucifix to Willy.
+ {kMuseumHall, 339, 29, 0}, // Show the Mayan mask to Willy.
+ {kMuseumHall, 340, 30, 0}, // Show the ruby to Willy.
+ {kMuseumHall, 341, 31, 0}, // Show Willy his business card.
+ {kMuseumHall, 343, 34, 0}, // Give the cup of coffee to Willy.
+ {kMuseumHall, 344, 35, 0}, // Show the strange key to Willy.
};
const RunawayItemAction kItemActions[] = {
- {kMuseumHall, 19, 2, 346},
- {kMuseumHall, 0, 5, 19},
- {kMuseumHall, 9, 8, 337},
- {kMuseumHall, 10, 8, 338},
- {kMuseumHall, 1, 14, 11},
- {kMuseumHall, 2, 14, 11},
- {kMuseumHall, 3, 14, 11},
- {kMuseumHall, 4, 14, 11},
- {kMuseumHall, 5, 14, 334},
- {kMuseumHall, 6, 14, 335},
- {kMuseumHall, 7, 14, 336},
- {kMuseumHall, 8, 14, 11},
- {kMuseumHall, 9, 14, 11},
- {kMuseumHall, 10, 14, 11},
- {kMuseumHall, 11, 14, 339},
- {kMuseumHall, 12, 14, 340},
- {kMuseumHall, 13, 14, 341},
- {kMuseumHall, 14, 14, 342},
- {kMuseumHall, 15, 14, 343},
- {kMuseumHall, 16, 14, 11},
- {kMuseumHall, 17, 14, 344},
- {kMuseumHall, 18, 14, 11},
- {kMuseumHall, 19, 14, 345},
+ {kMuseumHall, 19, 2, 346, false}, // Use the coffee package with the coffee machine.
+ {kMuseumHall, 0, 5, 19}, // Use an item with wastepaper basket.
+ {kMuseumHall, 9, 8, 337}, // Coat the keypad with varnish.
+ {kMuseumHall, 10, 8, 338}, // Dust the keypad with talcum powder.
+ {kMuseumHall, 1, 14, 11, false}, // Use wallet with maintenance worker.
+ {kMuseumHall, 2, 14, 11, false}, // Use car keys with maintenance worker.
+ {kMuseumHall, 3, 14, 11, false}, // Use condom with maintenance worker.
+ {kMuseumHall, 4, 14, 11, false}, // Use piece of amber with maintenance worker.
+ {kMuseumHall, 5, 14, 334, false}, // Show the tape recorder to Willy.
+ {kMuseumHall, 6, 14, 335, false}, // Show the battery to Willy.
+ {kMuseumHall, 7, 14, 336, false}, // Show the crucifix to Willy.
+ {kMuseumHall, 8, 14, 11, false}, // Use strange mayan object with maintenance worker.
+ {kMuseumHall, 9, 14, 11, false}, // Use colorless varnish with maintenance worker.
+ {kMuseumHall, 10, 14, 11, false}, // Use talcum powder with maintenance worker.
+ {kMuseumHall, 11, 14, 339, false}, // Show the Mayan mask to Willy.
+ {kMuseumHall, 12, 14, 340, false}, // Show the ruby to Willy.
+ {kMuseumHall, 13, 14, 341, false}, // Show Willy his business card.
+ {kMuseumHall, 14, 14, 342}, // Give the bowl of coffee to Willy.
+ {kMuseumHall, 15, 14, 343, false}, // Give the cup of coffee to Willy.
+ {kMuseumHall, 16, 14, 11, false}, // Use pair of books with maintenance worker.
+ {kMuseumHall, 17, 14, 344, false}, // Show the strange key to Willy.
+ {kMuseumHall, 18, 14, 11, false}, // Use ladle with maintenance worker.
+ {kMuseumHall, 19, 14, 345}, // Give the filled coffee package to Willy.
};
const RunawayExit kExits[] = {
- {kMuseumHall, 302, kMuseumHall, 533, 848, false, false},
- {kMuseumHall, 303, kMuseumHall, 1169, 643, false, false},
- {kMuseumHall, 305, kMuseumHall, 69, 372, true, false},
- {kMuseumHall, 306, kMuseumHall, 1290, 300, true, false},
- {kMuseumHall, 310, kMuseumExhibition, 881, 392, false, false},
- {kMuseumHall, 312, kMuseumOffice, 934, 563, true, true},
- {kMuseumHall, 316, kMuseumLaboratory, 382, 529, true, true},
- {kMuseumHall, 320, kMuseumKeypad, 0, 0, true, false},
+ {kMuseumHall, 302, kMuseumHall, 533, 848, false, false}, // Go downstairs on the left.
+ {kMuseumHall, 303, kMuseumHall, 1169, 643, false, false}, // Go downstairs on the right.
+ {kMuseumHall, 305, kMuseumHall, 69, 372, true, false}, // Go upstairs on the left.
+ {kMuseumHall, 306, kMuseumHall, 1290, 300, true, false}, // Go upstairs on the right.
+ {kMuseumHall, 310, kMuseumExhibition, 881, 392, false, false}, // Enter the Mayan exhibition.
+ {kMuseumHall, 312, kMuseumOffice, 934, 563, true, true}, // Enter Clive's office.
+ {kMuseumHall, 316, kMuseumLaboratory, 382, 529, true, true}, // Enter the restoration laboratory.
+ {kMuseumHall, 320, kMuseumKeypad, 0, 0, true, false}, // Examine the keypad close up.
};
} // End of anonymous namespace
@@ -158,13 +158,13 @@ void RunawayRoomScene::changeFloor(bool upper, Common::Point position) {
RunawayRoomScene::ActionResult RunawayRoomScene::execute4060(uint16 action) {
if (museumChapter()) {
switch (action) {
- case 307:
+ case 307: // Look at Willy.
say(3, _museum.willyMet != 0);
return kHandled;
- case 308:
+ case 308: // Talk to Willy.
leaveMuseumRoom(4070, Common::Point(548, 580), 7);
return kHandled;
- case 313:
+ case 313: // Look in the wastepaper basket.
if (!_museum.basketSeen) {
say(6);
say(6, 1);
@@ -173,7 +173,7 @@ RunawayRoomScene::ActionResult RunawayRoomScene::execute4060(uint16 action) {
say(_coffeeTaken ? 7 : 6, _coffeeTaken ? 0 : 2);
}
return kHandled;
- case 314:
+ case 314: // Take the empty coffee package.
if (!_museum.basketSeen || _coffeeTaken)
say(7);
else if (!_museum.needsPackage)
@@ -185,11 +185,11 @@ RunawayRoomScene::ActionResult RunawayRoomScene::execute4060(uint16 action) {
say(114, 0, true);
}
return kHandled;
- case 317:
+ case 317: // Look at the security door.
say(9, _museum.analysisDoorSeen);
_museum.analysisDoorSeen = 1;
return kHandled;
- case 318:
+ case 318: // Enter the analysis laboratory.
if (_museum.keypad != 4)
say(13);
else if (_inventory.museum().restoredCrucifix)
@@ -197,19 +197,20 @@ RunawayRoomScene::ActionResult RunawayRoomScene::execute4060(uint16 action) {
else
leaveMuseumRoom(4100, Common::Point(141, 468));
return kHandled;
- case 320:
+ case 320: // Examine the keypad close up.
if (_museum.willyInLab == 1)
say(15, 5);
else
leaveMuseumRoom(4140, Common::Point(382, 529));
return kHandled;
- case 321:
+ case 321: // Look at the coffee machine.
if (!_museum.coffeeMachine && !_museum.coffeeSeen)
say(11, 1);
- say(11, _museum.coffeeMachine ? 2 : 0);
+ say(11, _museum.coffeeMachine ? 2 : _museum.coffeeSeen ? _random.getRandomBit() : 0);
_museum.coffeeSeen = 1;
return kHandled;
- case 322:
+ case 322: // Use the coffee machine.
+ _museum.coffeeSeen = 1;
if (_museum.coffeeMachine != 1)
say(12, _museum.coffeeMachine ? 3 : 0);
else {
@@ -217,7 +218,7 @@ RunawayRoomScene::ActionResult RunawayRoomScene::execute4060(uint16 action) {
beginRoomAnimation(322, 9, 49, kCoffeeCupFrames, ARRAYSIZE(kCoffeeCupFrames));
}
return kHandled;
- case 325:
+ case 325: // Call Willy.
if (!_inventory.contains(13))
say(15);
else if (_museum.willyInLab == 1)
@@ -231,13 +232,13 @@ RunawayRoomScene::ActionResult RunawayRoomScene::execute4060(uint16 action) {
beginRoomAnimation(325, 13, 27);
}
return kHandled;
- case 334:
+ case 334: // Show the tape recorder to Willy.
say(23, _inventory.museum().voiceRecorded);
return kHandled;
- case 335:
+ case 335: // Show the battery to Willy.
say(24, _inventory.museum().frozenBattery);
return kHandled;
- case 337:
+ case 337: // Coat the keypad with varnish.
if (_museum.willyInLab == 1)
say(28);
else if (!_museum.sawCode)
@@ -249,7 +250,7 @@ RunawayRoomScene::ActionResult RunawayRoomScene::execute4060(uint16 action) {
deferMuseumAction(337);
}
return kHandled;
- case 338:
+ case 338: // Dust the keypad with talcum powder.
if (_museum.willyInLab == 1)
say(28);
else if (!_museum.sawCode)
@@ -263,22 +264,23 @@ RunawayRoomScene::ActionResult RunawayRoomScene::execute4060(uint16 action) {
deferMuseumAction(338);
}
return kHandled;
- case 342:
+ case 342: // Give the bowl of coffee to Willy.
if (_inventory.museum().coffee == 2)
say(32, 2);
else
leaveMuseumRoom(4072, Common::Point(548, 580), 7);
return kHandled;
- case 345:
+ case 345: // Give the filled coffee package to Willy.
if (!_inventory.museum().packageFilled)
say(36);
else
leaveMuseumRoom(4071, Common::Point(548, 580), 7);
return kHandled;
- case 346:
+ case 346: // Use the coffee package with the coffee machine.
say(37, _inventory.museum().packageFilled);
return kHandled;
- default: return kUnhandled;
+ default:
+ return kUnhandled;
}
}
@@ -297,57 +299,57 @@ RunawayRoomScene::ActionResult RunawayRoomScene::execute4060(uint16 action) {
void RunawayRoomScene::finish4060(uint16 action) {
switch (action) {
- case 460:
+ case 460: // Willy approaches the security door.
_camera.y = 0;
beginRoomAnimationRange(461, 16, 216, 0, 178, false);
break;
- case 461: {
+ case 461: { // Open the security door for Willy.
beginRoomAnimationRange(464, 4, 13, 0, 12, false);
const byte willy[] = {178};
setRoomAnimationOverlay(16, 216, willy, ARRAYSIZE(willy));
_audio.playEffect(32, 204);
break;
}
- case 464: {
+ case 464: { // Willy enters the analysis laboratory.
beginRoomAnimationRange(465, 16, 216, 179, 215, false);
const byte door[] = {12};
setRoomAnimationOverlay(4, 13, door, ARRAYSIZE(door));
break;
}
- case 465:
+ case 465: // Close the security door behind Willy.
beginRoomAnimationRange(466, 4, 13, 12, 0, false);
_audio.playEffect(32, 204);
break;
- case 466:
+ case 466: // React to Willy entering the code.
updateCamera();
say(_museum.sawCode == 1 ? 38 : 15, _museum.sawCode == 1 ? 2 : 5);
updateMaps();
break;
- case 462:
+ case 462: // Follow Willy to the coffee machine.
say(36, 4);
walkTo(Common::Point(140, 504), 7, true);
_camera = Common::Point(0, 0);
beginRoomAnimationRange(463, 16, 216, 0, 150, false);
break;
- case 463:
+ case 463: // Finish refilling the coffee machine.
_museum.willyInLab = 0;
changeFloor(true, Common::Point(218, 379));
_facing = 7;
say(36, 5);
break;
- case 322:
+ case 322: // Collect the cup of coffee.
_museum.coffeeMachine = 2;
_inventory.add(15);
say(12, 2);
break;
- case 325:
+ case 325: // Start the telephone conversation.
startMuseumFilm(kPhoneFilm);
break;
- case 337:
+ case 337: // Show the varnished keypad.
_museum.keypad = 1;
leaveMuseumRoom(4141, Common::Point(382, 529));
break;
- case 338:
+ case 338: // Show the fingerprints on the keypad.
_museum.keypad = 3;
leaveMuseumRoom(4142, Common::Point(382, 529));
break;
diff --git a/engines/hollywood/runaway/scene4070.cpp b/engines/hollywood/runaway/scene4070.cpp
index 964ee2be5c4..67002307d4b 100644
--- a/engines/hollywood/runaway/scene4070.cpp
+++ b/engines/hollywood/runaway/scene4070.cpp
@@ -67,10 +67,10 @@ void RunawayRoomScene::start4070() {
void RunawayRoomScene::finish4070(uint16 action) {
switch (action) {
- case 417:
+ case 417: // Offer the coffee package to Willy.
beginRoomAnimationRange(427, 5, 53, 19, 33);
break;
- case 427: {
+ case 427: { // Willy takes the coffee package.
byte willy[31], brian[31];
for (uint i = 0; i < ARRAYSIZE(willy); ++i) {
willy[i] = !i || i == 30 ? 54 : 158 + i;
@@ -80,7 +80,7 @@ void RunawayRoomScene::finish4070(uint16 action) {
setRoomAnimationOverlay(4, 188, willy, ARRAYSIZE(willy));
break;
}
- case 407:
+ case 407: // Willy agrees to refill the coffee machine.
_inventory.remove(19);
say(33, 4, false, 1);
if (_museum.batteryRequested) {
@@ -93,7 +93,7 @@ void RunawayRoomScene::finish4070(uint16 action) {
_museum.willyInLab = 2;
deferMuseumAction(448);
break;
- case 408: {
+ case 408: { // Willy answers his telephone.
byte frames[32];
frames[0] = 54;
for (uint i = 1; i < ARRAYSIZE(frames); ++i)
@@ -102,13 +102,13 @@ void RunawayRoomScene::finish4070(uint16 action) {
beginRoomAnimation(418, 4, 188, frames, ARRAYSIZE(frames), false);
break;
}
- case 418:
+ case 418: // Play Willy's telephone conversation.
_willyPose = 105;
for (uint i = 0; i < 6; ++i)
say(91, i, false, 1);
deferMuseumAction(428);
break;
- case 428: {
+ case 428: { // Willy puts the telephone away.
byte frames[32];
for (uint i = 0; i < ARRAYSIZE(frames) - 1; ++i)
frames[i] = 105 - i;
@@ -116,7 +116,7 @@ void RunawayRoomScene::finish4070(uint16 action) {
beginRoomAnimation(438, 4, 188, frames, ARRAYSIZE(frames), false);
break;
}
- case 438:
+ case 438: // Willy decides to visit the analysis laboratory.
_willyPose = 54;
say(91, 6, false, 1);
say(81);
@@ -125,10 +125,10 @@ void RunawayRoomScene::finish4070(uint16 action) {
_museum.sawCode = 1;
deferMuseumAction(448);
break;
- case 448:
+ case 448: // Willy leaves the close-up.
beginRoomAnimation(409, 6, 72, nullptr, 0, false);
break;
- case 409:
+ case 409: // Return to the exhibition hall.
_upperFloor = false;
leaveMuseumRoom(4064, Common::Point(921, 813), 7);
break;
@@ -254,11 +254,23 @@ void RunawayRoomScene::chooseDialogue(uint choice) {
_dialogue[10][3].response = 21;
}
switch (entry.transition) {
- case 0: _dialogueEnding = true; break;
- case 1: ++_dialogueDepth; _dialogueNode = entry.node; break;
- case 2: _dialogueDepth -= MIN<byte>(_dialogueDepth, 1); _dialogueNode = entry.node; break;
- case 4: _dialogueDepth -= MIN<byte>(_dialogueDepth, 2); _dialogueNode = entry.node; break;
- default: break;
+ case 0: // End the conversation.
+ _dialogueEnding = true;
+ break;
+ case 1: // Enter a topic.
+ ++_dialogueDepth;
+ _dialogueNode = entry.node;
+ break;
+ case 2: // Return to the parent topic.
+ _dialogueDepth -= MIN<byte>(_dialogueDepth, 1);
+ _dialogueNode = entry.node;
+ break;
+ case 4: // Return two topic levels.
+ _dialogueDepth -= MIN<byte>(_dialogueDepth, 2);
+ _dialogueNode = entry.node;
+ break;
+ default:
+ break;
}
}
diff --git a/engines/hollywood/runaway/scene4090.cpp b/engines/hollywood/runaway/scene4090.cpp
index e09118d2ac7..94b74f6bee3 100644
--- a/engines/hollywood/runaway/scene4090.cpp
+++ b/engines/hollywood/runaway/scene4090.cpp
@@ -40,26 +40,26 @@ const RunawayHotspot kHotspots[] = {
};
const RunawayResponse kResponses[] = {
- {kMuseumExhibition, 302, 1, 0},
- {kMuseumExhibition, 303, 2, 0},
- {kMuseumExhibition, 304, 3, 0},
- {kMuseumExhibition, 305, 4, 0},
- {kMuseumExhibition, 306, 3, 0},
- {kMuseumExhibition, 307, 5, 0},
- {kMuseumExhibition, 309, 7, 0},
- {kMuseumExhibition, 310, 8, 0},
- {kMuseumExhibition, 311, 9, 0},
- {kMuseumExhibition, 312, 8, 0},
- {kMuseumExhibition, 313, 10, 0},
- {kMuseumExhibition, 314, 11, 0},
- {kMuseumExhibition, 315, 12, 0},
- {kMuseumExhibition, 316, 11, 0},
- {kMuseumExhibition, 317, 13, 0},
- {kMuseumExhibition, 318, 11, 0},
+ {kMuseumExhibition, 302, 1, 0}, // Look at the exhibition hall exit.
+ {kMuseumExhibition, 303, 2, 0}, // Look at the right statue.
+ {kMuseumExhibition, 304, 3, 0}, // Take the right statue.
+ {kMuseumExhibition, 305, 4, 0}, // Look at the left statue.
+ {kMuseumExhibition, 306, 3, 0}, // Take the left statue.
+ {kMuseumExhibition, 307, 5, 0}, // Look at the Mayan offerings.
+ {kMuseumExhibition, 309, 7, 0}, // Look at the near Mayan arch.
+ {kMuseumExhibition, 310, 8, 0}, // Use the near Mayan arch.
+ {kMuseumExhibition, 311, 9, 0}, // Look at the far Mayan arch.
+ {kMuseumExhibition, 312, 8, 0}, // Use the far Mayan arch.
+ {kMuseumExhibition, 313, 10, 0}, // Look at the first Mayan object.
+ {kMuseumExhibition, 314, 11, 0}, // Take the first Mayan object.
+ {kMuseumExhibition, 315, 12, 0}, // Look at the second Mayan object.
+ {kMuseumExhibition, 316, 11, 0}, // Take the second Mayan object.
+ {kMuseumExhibition, 317, 13, 0}, // Look at the third Mayan object.
+ {kMuseumExhibition, 318, 11, 0}, // Take the third Mayan object.
};
const RunawayExit kExits[] = {
- {kMuseumExhibition, 301, kMuseumHall, 1400, 600, false, false},
+ {kMuseumExhibition, 301, kMuseumHall, 1400, 600, false, false}, // Return to the exhibition hall.
};
} // End of anonymous namespace
@@ -80,7 +80,8 @@ RunawayRoomScene::ActionResult RunawayRoomScene::execute4090(uint16 action) {
if (!museumChapter())
return kUnhandled;
switch (action) {
- case 307: case 308:
+ case 307: // Look at the Mayan offerings.
+ case 308: // Take the bowl of coffee beans.
if (_museum.coffeeBeansTaken) {
say(action == 307 ? 5 : 6, action == 307 ? 2 : 3);
} else if (_museum.susan == 1 && _museum.coffeeSeen) {
@@ -91,16 +92,20 @@ RunawayRoomScene::ActionResult RunawayRoomScene::execute4090(uint16 action) {
return kBackgroundChanged;
} else {
say(action == 307 ? 5 : 6, action == 307 ? _museum.mayanObjectsSeen : 0);
- _museum.mayanObjectsSeen = 1;
+ if (action == 307)
+ _museum.mayanObjectsSeen = 1;
}
return kHandled;
- case 313: case 315: case 317: {
+ case 313: // Look at the first Mayan object.
+ case 315: // Look at the second Mayan object.
+ case 317: { // Look at the third Mayan object.
const uint object = (action - 313) / 2;
say(object == 0 ? 10 : object == 1 ? 12 : 13, _museum.exhibitSeen[object]);
_museum.exhibitSeen[object] = 1;
return kHandled;
}
- default: return kUnhandled;
+ default:
+ return kUnhandled;
}
}
diff --git a/engines/hollywood/runaway/scene4100.cpp b/engines/hollywood/runaway/scene4100.cpp
index afd21201855..580cb63ecd9 100644
--- a/engines/hollywood/runaway/scene4100.cpp
+++ b/engines/hollywood/runaway/scene4100.cpp
@@ -44,49 +44,49 @@ const RunawayHotspot kHotspots[] = {
{"", 0, 0, 0, {0, 0}, {0, 0}},
{"Door", 141, 468, 7, {301, 302}, {0, 1}},
{"First aid kit", 196, 451, 1, {303, 304}, {0, 0}},
- {"Glass display case", 310, 457, 1, {305, 306}, {1, 1}},
+ {"Glass display case", 310, 457, 0, {305, 306}, {1, 1}},
{"Button", 204, 448, 1, {307, 308}, {1, 1}},
- {"Mayan mask", 310, 457, 1, {309, 310}, {1, 1}},
- {"Scanner", 906, 470, 0, {311, 312}, {0, 0}},
+ {"Mayan mask", 310, 457, 0, {309, 310}, {1, 1}},
+ {"Scanner", 906, 470, 0, {311, 312}, {1, 1}},
{"Tank", 1352, 431, 1, {315, 316}, {0, 0}},
{"Golden object", 111, 446, 1, {313, 314}, {1, 1}},
{"Device", 539, 439, 1, {317, 318}, {0, 0}},
- {"Ladle", 1329, 409, 1, {328, 329}, {0, 1}},
+ {"Ladle", 1329, 409, 1, {328, 329}, {1, 1}},
};
const RunawayResponse kResponses[] = {
- {kMuseumSecurity, 301, 1, 0},
- {kMuseumSecurity, 303, 2, 0},
- {kMuseumSecurity, 304, 3, 0},
- {kMuseumSecurity, 307, 6, 0},
- {kMuseumSecurity, 312, 11, 0},
- {kMuseumSecurity, 316, 15, 0},
- {kMuseumSecurity, 318, 17, 0},
- {kMuseumSecurity, 319, 18, 0},
- {kMuseumSecurity, 322, 21, 0},
- {kMuseumSecurity, 323, 11, 0},
- {kMuseumSecurity, 324, 22, 0},
- {kMuseumSecurity, 326, 24, 0},
- {kMuseumSecurity, 327, 25, 0},
- {kMuseumSecurity, 328, 26, 0},
+ {kMuseumSecurity, 301, 1, 0}, // Look at the security door.
+ {kMuseumSecurity, 303, 2, 0}, // Look at the first aid kit.
+ {kMuseumSecurity, 304, 3, 0}, // Open the first aid kit.
+ {kMuseumSecurity, 307, 6, 0}, // Look at the chamber button.
+ {kMuseumSecurity, 312, 11, 0}, // Use the scanner.
+ {kMuseumSecurity, 316, 15, 0}, // Use the liquid nitrogen tank.
+ {kMuseumSecurity, 318, 17, 0}, // Use the electron microscope.
+ {kMuseumSecurity, 319, 18, 0}, // Put an item in the thermal chamber.
+ {kMuseumSecurity, 322, 21, 0}, // Use an item with the scanner.
+ {kMuseumSecurity, 323, 11, 0}, // Use the crucifix with the scanner.
+ {kMuseumSecurity, 324, 22, 0}, // Put an item in the liquid nitrogen.
+ {kMuseumSecurity, 326, 24, 0}, // Use an item with the electron microscope.
+ {kMuseumSecurity, 327, 25, 0}, // Examine the crucifix with the electron microscope.
+ {kMuseumSecurity, 328, 26, 0}, // Look at the ladle.
};
const RunawayItemAction kItemActions[] = {
- {kMuseumSecurity, 5, 3, 321},
- {kMuseumSecurity, 11, 3, 320},
- {kMuseumSecurity, 0, 3, 319},
- {kMuseumSecurity, 5, 4, 321},
- {kMuseumSecurity, 7, 6, 323},
- {kMuseumSecurity, 0, 6, 322},
- {kMuseumSecurity, 6, 7, 330},
- {kMuseumSecurity, 18, 7, 325},
- {kMuseumSecurity, 0, 7, 324},
- {kMuseumSecurity, 7, 9, 327},
- {kMuseumSecurity, 0, 9, 326},
+ {kMuseumSecurity, 5, 3, 321, false}, // Play the recording to the voice lock.
+ {kMuseumSecurity, 11, 3, 320, false}, // Put the Mayan mask back in the chamber.
+ {kMuseumSecurity, 0, 3, 319}, // Put an item in the thermal chamber.
+ {kMuseumSecurity, 5, 4, 321}, // Play the recording to the voice lock.
+ {kMuseumSecurity, 7, 6, 323, false}, // Use the crucifix with the scanner.
+ {kMuseumSecurity, 0, 6, 322}, // Use an item with the scanner.
+ {kMuseumSecurity, 6, 7, 330, false}, // Put the battery directly in the liquid nitrogen.
+ {kMuseumSecurity, 18, 7, 325}, // Freeze the battery in the ladle.
+ {kMuseumSecurity, 0, 7, 324}, // Put an item in the liquid nitrogen.
+ {kMuseumSecurity, 7, 9, 327, false}, // Examine the crucifix with the electron microscope.
+ {kMuseumSecurity, 0, 9, 326}, // Use an item with the electron microscope.
};
const RunawayExit kExits[] = {
- {kMuseumSecurity, 302, kMuseumHall, 1118, 309, true, false}
+ {kMuseumSecurity, 302, kMuseumHall, 1118, 309, true, false} // Return to the exhibition hall.
};
} // End of anonymous namespace
@@ -168,24 +168,24 @@ RunawayRoomScene::ActionResult RunawayRoomScene::execute4100(uint16 action) {
if (!museumChapter())
return kUnhandled;
switch (action) {
- case 302:
+ case 302: // Return to the exhibition hall.
leaveMuseumRoom(4062, Common::Point(1118, 309), 3);
return kHandled;
- case 305:
+ case 305: // Look inside the thermal chamber.
say(4, !_museum.cabinetSeen ? 0 : _museum.maskTaken ? 2 : 1);
_museum.cabinetSeen = 1;
return kBackgroundChanged;
- case 306:
+ case 306: // Try to open the thermal chamber.
say(5, _museum.buttonSeen);
_museum.buttonSeen = 1;
return kBackgroundChanged;
- case 308:
+ case 308: // Press the chamber button and try voice identification.
beginRoomAnimation(308, 29, 12, kPressButtonFrames, ARRAYSIZE(kPressButtonFrames));
return kHandled;
- case 309:
+ case 309: // Look at the Mayan mask.
say(8, _museum.chamberOpen != 0);
return kHandled;
- case 310:
+ case 310: // Take the Mayan mask.
if (!_museum.chamberOpen)
say(9);
else {
@@ -196,15 +196,15 @@ RunawayRoomScene::ActionResult RunawayRoomScene::execute4100(uint16 action) {
deferMuseumAction(432);
}
return kBackgroundChanged;
- case 311:
+ case 311: // Look at the scanner.
say(10, _museum.scannerSeen);
_museum.scannerSeen = 1;
return kHandled;
- case 313:
+ case 313: // Look at the strange key.
say(12, _museum.keySeen);
_museum.keySeen = 1;
return kHandled;
- case 314:
+ case 314: // Take the strange key.
if (!_museum.keySeen)
say(12);
_museum.keySeen = _museum.keyTaken = 1;
@@ -213,18 +213,18 @@ RunawayRoomScene::ActionResult RunawayRoomScene::execute4100(uint16 action) {
say(13, 1);
say(13, 2);
return kBackgroundChanged;
- case 315:
+ case 315: // Look at the liquid nitrogen tank.
say(14, _museum.nitrogenSeen);
_museum.nitrogenSeen = 1;
return kHandled;
- case 317:
+ case 317: // Look at the electron microscope.
say(16, _museum.microscopeSeen);
_museum.microscopeSeen = 1;
return kHandled;
- case 320:
- say(19, _museum.chamberOpen != 0);
+ case 320: // Put the Mayan mask back in the chamber.
+ say(19, _inventory.museum().rubyRemoved);
return kHandled;
- case 321:
+ case 321: // Play the recording to the voice lock.
if (!_museum.voiceLockSeen)
say(2, 0, true);
else if (!_inventory.museum().voiceRecorded)
@@ -240,7 +240,7 @@ RunawayRoomScene::ActionResult RunawayRoomScene::execute4100(uint16 action) {
beginRoomAnimation(340, 29, 12, kPressButtonFrames, ARRAYSIZE(kPressButtonFrames));
}
return kHandled;
- case 325:
+ case 325: // Freeze the battery in the ladle.
if (!_inventory.museum().batteryInLadle)
say(23);
else {
@@ -252,40 +252,41 @@ RunawayRoomScene::ActionResult RunawayRoomScene::execute4100(uint16 action) {
setRoomAnimationOverlay(25, 45, tank, ARRAYSIZE(tank));
}
return kHandled;
- case 329:
+ case 329: // Take the ladle.
_museum.ladleTaken = 1;
_inventory.add(18);
say(113, 0, true);
return kBackgroundChanged;
- case 330:
+ case 330: // Put the battery directly in the liquid nitrogen.
say(27, _inventory.museum().frozenBattery);
return kHandled;
- default: return kUnhandled;
+ default:
+ return kUnhandled;
}
}
void RunawayRoomScene::finish4100(uint16 action) {
switch (action) {
- case 340:
+ case 340: // The voice lock asks for identification.
say(90, 0, false, 1);
deferMuseumAction(341);
break;
- case 341:
+ case 341: // Raise the tape recorder.
beginRoomAnimationRange(342, 27, 21, 0, 20);
break;
- case 342:
+ case 342: // Play Susan's recorded name.
say(91, _inventory.museum().recorderBattery ? 1 : 0, false, 2);
holdRoomAnimation(343, 27, 21, 20);
break;
- case 343:
+ case 343: // Lower the tape recorder.
beginRoomAnimationRange(344, 27, 21, 20, 0);
break;
- case 344:
+ case 344: // The voice lock accepts or rejects the recording.
_computerReject = !_inventory.museum().recorderBattery;
say(90, _computerReject ? 1 : 2, false, 1);
deferMuseumAction(321);
break;
- case 321:
+ case 321: // Remove the dead battery or unlock the chamber.
_computerReject = false;
if (!_inventory.museum().recorderBattery) {
say(20, 4);
@@ -297,83 +298,83 @@ void RunawayRoomScene::finish4100(uint16 action) {
beginRoomAnimation(345, 10, 7, nullptr, 0, false);
}
break;
- case 345:
+ case 345: // Open the unlocked thermal chamber.
beginRoomAnimation(431, _museum.maskTaken ? 33 : 32, 36, nullptr, 0, false);
_audio.playEffect(33, 191);
break;
- case 325:
+ case 325: // Retrieve the frozen battery from the ladle.
_inventory.museum().batteryInLadle = 0;
_inventory.museum().frozenBattery = 1;
_inventory.add(6);
say(23, 2);
say(23, 3);
break;
- case 308:
+ case 308: // Try identifying Brian to the voice lock.
startConversation(3);
break;
- case 409:
+ case 409: // Approach the scanner with the restored crucifix.
say(28, 1);
beginRoomAnimation(410, 26, 46);
break;
- case 410:
+ case 410: // Show the scanner film.
startMuseumFilm(kScannerFilm);
break;
- case 411:
+ case 411: // Show the betrayal film.
startMuseumFilm(kBetrayalFilm);
break;
- case 412:
+ case 412: // Introduce the analysis laboratory.
if (!_museum.labVisited) {
_museum.labVisited = 1;
say(0);
}
break;
- case 413:
+ case 413: // React to the scan results.
say(28);
deferMuseumAction(414);
break;
- case 414:
+ case 414: // Brian turns toward Clive.
beginRoomAnimationRange(415, 24, 28, 0, 4);
break;
- case 415: {
+ case 415: { // Clive enters the laboratory.
_camera.x = 0;
beginRoomAnimationRange(416, 22, 60, 0, 16);
const byte brian[] = {4};
setRoomAnimationOverlay(24, 28, brian, ARRAYSIZE(brian));
break;
}
- case 416:
+ case 416: // Clive calls Brian over.
if (!_npcMouth.load(_archive, 22, 60))
error("Cannot load Runaway Clive animation");
_cliveVisible = true;
say(92, 0, false, 1);
holdRoomAnimation(417, 24, 28, 4);
break;
- case 417:
+ case 417: // Brian turns to listen.
beginRoomAnimationRange(418, 24, 28, 5, 9);
break;
- case 418:
+ case 418: // Clive warns about Gina.
say(92, 1, false, 1);
holdRoomAnimation(419, 24, 28, 9);
break;
- case 419: {
+ case 419: { // Clive leaves the laboratory.
_cliveVisible = false;
beginRoomAnimationRange(420, 22, 60, 44, 59);
const byte brian[] = {9};
setRoomAnimationOverlay(24, 28, brian, ARRAYSIZE(brian));
break;
}
- case 420:
+ case 420: // Brian follows Clive.
beginRoomAnimationRange(411, 24, 28, 10, 27);
break;
- case 432:
+ case 432: // Close the chamber after taking the mask.
closeMuseumChamber();
break;
- case 430:
+ case 430: // Finish closing the thermal chamber.
_museum.chamberOpen = 0;
_museum.chamberTime = 0;
refreshMuseum();
break;
- case 431:
+ case 431: // Start the chamber closing timer.
if (_inventory.museum().recorderBattery == 3)
say(20, 8);
_inventory.museum().recorderBattery = 4;
diff --git a/engines/hollywood/runaway/scene4140.cpp b/engines/hollywood/runaway/scene4140.cpp
index 65271ec85b0..a13f1d1c4e1 100644
--- a/engines/hollywood/runaway/scene4140.cpp
+++ b/engines/hollywood/runaway/scene4140.cpp
@@ -55,13 +55,13 @@ void RunawayRoomScene::clickScene4140(byte id) {
_pressedKey = id;
_keyUntil = _now + 180;
_keyResult = 0;
- if (!id) {
+ if (!id) { // Leave the keypad close-up.
leaveMuseumRoom(4063, Common::Point(1153, 297), 7);
- } else if (id == 10) {
+ } else if (id == 10) { // Clear the entered digits.
_audio.playEffect(museumChapter() ? 30 : 10);
_keyCount = 0;
_museum.keypadDigits = 0;
- } else if (id == 12) {
+ } else if (id == 12) { // Confirm the security code.
if (_keyCount == 4 && _museum.keypad >= 3 && _museum.keypadDigits == 8137) {
_keyResult = 2;
_museum.keypad = 4;
@@ -76,7 +76,7 @@ void RunawayRoomScene::clickScene4140(byte id) {
_keyUntil = _now + 500;
_keyCount = 0;
_museum.keypadDigits = 0;
- } else {
+ } else { // Enter a digit; button 11 is zero.
const byte digit = id == 11 ? 0 : id;
_audio.playEffect(museumChapter() ? 18 + digit : id == 11 ? 11 : 11 + id);
if (_keyCount < 4) {
Commit: 98ef1d659542fa713906a91b33ac5476bb0879b0
https://github.com/scummvm/scummvm/commit/98ef1d659542fa713906a91b33ac5476bb0879b0
Author: neuromancer (gustavo.grieco at gmail.com)
Date: 2026-11-19T19:38:52+01:00
Commit Message:
HOLLYWOOD: RUNAWAY: added missing details for scenes 5010, 5060 and 5100
Changed paths:
engines/hollywood/runaway/scene.cpp
engines/hollywood/runaway/scene.h
engines/hollywood/runaway/scene5010.cpp
engines/hollywood/runaway/scene5060.cpp
engines/hollywood/runaway/scene5100.cpp
diff --git a/engines/hollywood/runaway/scene.cpp b/engines/hollywood/runaway/scene.cpp
index 004a5b001ff..17d5866d9be 100644
--- a/engines/hollywood/runaway/scene.cpp
+++ b/engines/hollywood/runaway/scene.cpp
@@ -90,7 +90,14 @@ const RunawayRoom *findRunawayRoom(uint16 number) {
RunawayRoomScene::RunawayRoomScene(RunawayAudio &audio, RunawayInventory &inventory, const RunawayStrings &strings, RunawayGameType game) :
_audio(audio), _sequence(audio), _inventory(inventory), _strings(strings), _game(game), _random("runaway"),
- _speech(audio, _random, game == kRunawayFullGame ? RunawaySpeech::kRecordedLipSync : RunawaySpeech::kNoLipSync) {}
+ _speech(audio, _random, game == kRunawayFullGame ? RunawaySpeech::kRecordedLipSync : RunawaySpeech::kNoLipSync),
+ _hangarSpeech(audio, _random, RunawaySpeech::kNoLipSync) {}
+
+const Common::U32String &RunawayRoomScene::subtitle() const {
+ if (_sequence.active())
+ return _sequence.subtitle();
+ return speaking() ? _speech.subtitle() : _hangarSpeech.subtitle();
+}
bool RunawayRoomScene::load(uint16 entryScene) {
const RunawayRoom *room = findRoom(entryScene);
@@ -242,6 +249,7 @@ bool RunawayRoomScene::enterRoom(uint16 number, Common::Point position, byte fac
_lines.clear();
_lineIndex = 0;
_speech.reset();
+ _hangarSpeech.reset();
_caption.clear();
_ambient = RunawayAnimation();
_overlay = RunawayAnimation();
@@ -515,6 +523,8 @@ void RunawayRoomScene::showLine() {
}
void RunawayRoomScene::say(uint16 cue, byte variation, bool global, byte speaker) {
+ if (!_hangarSpeech.subtitle().empty())
+ _hangarSpeech.stop();
SceneSpeechCue speech;
if (global)
_text.getStaticSpeechCue(cue, variation, speech.textRecordId, speech.continuationCount, speech.voiceSampleId);
@@ -854,6 +864,7 @@ void RunawayRoomScene::beginRoomAnimation(uint16 action, uint chunk, uint frames
_actionFrames.clear();
_secondaryFrames.clear();
_actionHoldSpeech = false;
+ _actionLoopSpeech = false;
for (uint i = 0; i < (order ? count : frames); ++i)
_actionFrames.push_back(order ? order[i] : i);
_roomAction = action;
@@ -879,6 +890,12 @@ void RunawayRoomScene::holdRoomAnimation(uint16 action, uint chunk, uint frames,
_actionHoldSpeech = true;
}
+void RunawayRoomScene::loopRoomAnimationDuringSpeech(uint16 action, uint chunk, uint frames, uint first, uint last, bool hideActor) {
+ beginRoomAnimationRange(action, chunk, frames, first, last, hideActor);
+ _actionHoldSpeech = true;
+ _actionLoopSpeech = true;
+}
+
void RunawayRoomScene::setRoomAnimationOverlay(uint chunk, uint frames, const byte *order, uint count) {
if (!_secondaryAnimation.load(_archive, chunk, frames))
error("Cannot load Runaway room %u overlay %u", _room, chunk);
@@ -888,13 +905,17 @@ void RunawayRoomScene::setRoomAnimationOverlay(uint chunk, uint frames, const by
void RunawayRoomScene::updateRoomAnimation() {
if (!_roomAction || _actionFrames.empty())
return;
- if (speaking() || _walkPath.active()) {
+ if ((speaking() && !_actionLoopSpeech) || _walkPath.active()) {
_actionStarted = _now;
return;
}
while (_now - _actionStarted >= 80) {
_actionStarted += 80;
if (++_actionStep == _actionFrames.size()) {
+ if (_actionLoopSpeech && speaking()) {
+ _actionStep = 0;
+ continue;
+ }
const uint16 action = _roomAction;
_roomAction = 0;
_actionFrames.clear();
diff --git a/engines/hollywood/runaway/scene.h b/engines/hollywood/runaway/scene.h
index 7f4e94ef9e0..ff1d35f04d3 100644
--- a/engines/hollywood/runaway/scene.h
+++ b/engines/hollywood/runaway/scene.h
@@ -101,9 +101,9 @@ public:
byte hotspotAt(Common::Point mouse) const override;
Common::U32String actionCaption(byte hotspot, RunawayVerb verb, byte item) const override;
const Common::U32String &committedCaption() const override { return _caption; }
- const Common::U32String &subtitle() const override { return _sequence.active() ? _sequence.subtitle() : _speech.subtitle(); }
+ const Common::U32String &subtitle() const override;
bool busy() const override { return _sequence.active() || _pendingHotspot != 0 || _transition.scene || _hospitalExit.scene || _arrivalFacing != 0xff || _hospitalEntryStep || _roomAction || _conversation || speaking(); }
- bool speaking() const override { return !subtitle().empty(); }
+ bool speaking() const override { return _sequence.active() ? !_sequence.subtitle().empty() : !_speech.subtitle().empty(); }
byte speechFrame() const override { return _sequence.active() ? _sequence.speechFrame() : _speech.frame(_now); }
bool playingVideo() const override { return _sequence.active(); }
void skipVideo() override { _sequence.skip(); }
@@ -112,7 +112,8 @@ public:
void sayInventory(const RunawayInventory::Reply &reply) override;
const Common::Array<Common::U32String> &dialogueChoices() const override { return _choices; }
void chooseDialogue(uint choice) override;
- bool canSave() const override { return !busy() && !_walkPath.active() && !_pressedKey; }
+ // The hangar contest's animation progress is transient, like a room action.
+ bool canSave() const override { return !busy() && !_walkPath.active() && !_pressedKey && _desert.guard != 1; }
void captureState(RunawaySaveState &state) const override;
bool restoreState(const RunawaySaveState &state, uint32 now, bool entering = false) override;
void setOptions(bool antialias, bool fastScrolling) override { _antialias = antialias; _fastScrolling = fastScrolling; }
@@ -144,6 +145,7 @@ private:
void beginRoomAnimation(uint16 action, uint chunk, uint frames, const byte *order = nullptr, uint count = 0, bool hideActor = true);
void beginRoomAnimationRange(uint16 action, uint chunk, uint frames, uint first, uint last, bool hideActor = true);
void holdRoomAnimation(uint16 action, uint chunk, uint frames, uint frame, bool hideActor = true);
+ void loopRoomAnimationDuringSpeech(uint16 action, uint chunk, uint frames, uint first, uint last, bool hideActor = true);
void setRoomAnimationOverlay(uint chunk, uint frames, const byte *order, uint count);
bool drawingRoomAnimation() const { return _roomAction && !_actionFrames.empty() && (_actionHoldSpeech || !speaking()) && !_walkPath.active(); }
void updateRoomAnimation();
@@ -252,7 +254,11 @@ private:
void drawScene5080(Graphics::ManagedSurface &viewport);
void updateScene5080();
void drawScene5100(Graphics::ManagedSurface &viewport, bool foreground);
- void updateScene5100();
+ uint studFrame() const;
+ void updateScene5100(uint elapsed, bool inventoryOpen);
+ void startHangarTaunt();
+ void animationFrame5060();
+ void animationFrame5100();
bool applyBackground5100();
void updateMaps5100();
void walkHangar(Common::Point target, byte facing);
@@ -282,6 +288,7 @@ private:
const RunawayGameType _game;
Common::RandomSource _random;
RunawaySpeech _speech;
+ RunawaySpeech _hangarSpeech;
RunawayIdleHead _idleHead;
ChunkArchive _archive;
SceneTextStore _text;
@@ -320,6 +327,11 @@ private:
RunawaySaveState::Desert _desert;
Common::Array<RunawayHotspot> _desertHotspots;
RunawayAnimation _desertAnimations[6];
+ byte _hangarShot = 0, _hangarShotCount = 0, _hangarShotFrame = 88;
+ uint _hangarShotElapsed = 0;
+ bool _hangarThrowing = false;
+ bool _hangarIntroduction = false;
+ byte _hangarLulaPose = 0;
RunawayAnimation _npc, _npcMouth, _machine;
RunawayAnimation _computer, _rejectionLight;
uint32 _nextLaser = 0;
@@ -346,6 +358,7 @@ private:
uint16 _roomAction = 0;
bool _actionHidesActor = true;
bool _actionHoldSpeech = false;
+ bool _actionLoopSpeech = false;
byte _actionStage = 0;
uint _actionStep = 0;
uint32 _actionStarted = 0;
diff --git a/engines/hollywood/runaway/scene5010.cpp b/engines/hollywood/runaway/scene5010.cpp
index 1d867a5da3d..bb7e806cf5f 100644
--- a/engines/hollywood/runaway/scene5010.cpp
+++ b/engines/hollywood/runaway/scene5010.cpp
@@ -83,6 +83,10 @@ void RunawayRoomScene::resumeDesert() {
_walkPath.reset(_position);
walkTo(Common::Point(1000, 451), 5, true);
}
+ if (_entryScene == 5101) {
+ execute(400);
+ return;
+ }
if (_entryScene == 5100)
walkTo(Common::Point(1053, 403), 3);
const uint16 rooms[] = {5010, 5020, 5050, 5060, 5070, 5080, 5100, 5110, 5160, 5170};
@@ -104,6 +108,8 @@ void RunawayRoomScene::leaveDesertRoom(uint16 scene) {
warning("Runaway: scene %u is not implemented yet", scene);
return;
}
+ if (!_hangarSpeech.subtitle().empty())
+ _hangarSpeech.stop();
_hospitalExit.scene = scene;
_hospitalExit.position = room ? room->entry : Common::Point(1167, 468);
_hospitalExit.facing = 3;
@@ -119,6 +125,10 @@ void RunawayRoomScene::finishDesertAnimation(uint16 action) {
}
void RunawayRoomScene::desertAnimationFrame() {
+ if (_room == 5060)
+ animationFrame5060();
+ if (_room == 5100)
+ animationFrame5100();
if (_room == 5080 && _roomAction == 326 && _actionStep == 23)
_audio.playEffect(72);
}
@@ -129,7 +139,7 @@ void RunawayRoomScene::updateDesert(uint elapsed, bool inventoryOpen) {
if (_room == 5080)
updateScene5080();
if (_room == 5100)
- updateScene5100();
+ updateScene5100(elapsed, inventoryOpen);
if (_roomAction && _actionFrames.empty() && !speaking() && !_walkPath.active()) {
const uint16 action = _roomAction;
_roomAction = 0;
@@ -237,7 +247,8 @@ bool RunawayRoomScene::loadDesertRoom() {
return loadForeground(0, 11) && loadForeground(1, 12) && loadForeground(2, 13) && loadForeground(3, 14) &&
_npc.load(_archive, 9, 47);
if (_room == 5100)
- return _npc.load(_archive, 9, 151) && _npcMouth.load(_archive, 12, 126);
+ return _npc.load(_archive, 9, 151) && _npcMouth.load(_archive, 12, 126) &&
+ _machine.load(_archive, 16, 79);
return true;
}
diff --git a/engines/hollywood/runaway/scene5060.cpp b/engines/hollywood/runaway/scene5060.cpp
index a6dd7303e7c..8d403de50eb 100644
--- a/engines/hollywood/runaway/scene5060.cpp
+++ b/engines/hollywood/runaway/scene5060.cpp
@@ -68,8 +68,8 @@ const RunawayResponse kResponses[] = {
};
const RunawayItemAction kItemActions[] = {
- {5060, 15, 2, 319, false},
- {5060, 20, 9, 320, true},
+ {5060, 15, 2, 319, false}, // Show the basketball to Lula.
+ {5060, 20, 9, 320, true}, // Exchange Mariola's sunglasses.
};
const byte kSearchTrunkFrames[] = {
@@ -101,14 +101,13 @@ RunawayRoomScene::ActionResult RunawayRoomScene::execute5060(uint16 action) {
case 304: // Talk to Lula.
if (_desert.guard == 2) {
say(20, 12);
- } else if (_desert.lulaHelped) {
- return kUnhandled;
} else {
say(20);
deferDesertAction(404);
}
break;
- case 404: { // Let Lula finish dancing before talking.
+ case 404: // Let Lula finish dancing before talking.
+ case 419: { // Let Lula notice Brian bouncing the basketball.
Common::Array<byte> frames;
for (uint i = 120 + (_now / 80) % 75; i < 195; ++i)
frames.push_back(i);
@@ -117,11 +116,29 @@ RunawayRoomScene::ActionResult RunawayRoomScene::execute5060(uint16 action) {
if (i == 94)
frames.push_back(i);
}
- beginRoomAnimation(action, 12, 195, frames.data(), frames.size(), false);
+ beginRoomAnimation(action, 12, 195, frames.data(), frames.size(), action == 419);
+ if (action == 419) {
+ Common::Array<byte> brian;
+ for (uint i = 0; i < frames.size(); ++i) {
+ if (i < 29)
+ brian.push_back(i ? i - 1 : 0);
+ else
+ brian.push_back(28 + (i - 29) % 14);
+ }
+ setRoomAnimationOverlay(13, 62, brian.data(), brian.size());
+ }
break;
}
case 1404: // Ask Lula about distracting Stud.
- if (!_desert.guardWeaknessKnown) {
+ if (_desert.lulaHelped) {
+ say(20, 9);
+ say(21, 6, false, 2);
+ say(20, 10);
+ say(21, 7, false, 2);
+ say(20, 11);
+ deferDesertAction(469);
+ break;
+ } else if (!_desert.guardWeaknessKnown) {
if (!_desert.visited[6]) {
say(20, 1);
say(21, 0, false, 2);
@@ -241,12 +258,55 @@ RunawayRoomScene::ActionResult RunawayRoomScene::execute5060(uint16 action) {
say(15, !_inventory.contains(20) ? 0 : _desert.mariolaHelped ? 2 : 1);
break;
case 319: // Give the repaired basketball to Lula.
- if (!_desert.guardWeaknessKnown)
+ if (!_desert.guardWeaknessKnown) {
say(17, 7);
- else if (_inventory.desert().ball < 2)
+ } else if (_inventory.desert().ball < 2) {
say(17, 8);
- else
- return kUnhandled;
+ } else {
+ _inventory.select(0);
+ walkTo(Common::Point(490, 457), 7);
+ deferDesertAction(409);
+ }
+ break;
+ case 409: // Call Lula over to see the basketball.
+ say(17);
+ deferDesertAction(419);
+ break;
+ case 1419: // Keep bouncing the ball while Lula asks for it.
+ say(18, 5, false, 2);
+ loopRoomAnimationDuringSpeech(429, 13, 62, 28, 41);
+ break;
+ case 1429: { // Throw the basketball to Lula.
+ _audio.stopEffect();
+ byte lula[20];
+ for (uint i = 0; i < ARRAYSIZE(lula); ++i)
+ lula[i] = i == ARRAYSIZE(lula) - 1 ? 5 : MIN<uint>(i, 4);
+ beginRoomAnimationRange(439, 13, 62, 42, 61);
+ setRoomAnimationOverlay(21, 102, lula, ARRAYSIZE(lula));
+ break;
+ }
+ case 1439: // Watch Lula demonstrate her basketball skills.
+ beginRoomAnimationRange(449, 21, 102, 6, 96, false);
+ break;
+ case 1449: // Approach Lula after she catches the ball.
+ _inventory.remove(15);
+ walkTo(Common::Point(349, 442), 7);
+ deferDesertAction(459);
+ break;
+ case 459: // Reveal Lula's identity and arrange the distraction.
+ say(18, 6, false, 2);
+ for (uint i = 1; i <= 5; ++i) {
+ say(17, i);
+ say(18, i - 1, false, 2);
+ }
+ say(17, 6);
+ deferDesertAction(479);
+ break;
+ case 479: // Finish enlisting Lula's help.
+ _desert.lulaHelped = 1;
+ // Fall through.
+ case 469: // Take Lula to the hangar, including repeat attempts.
+ leaveDesertRoom(5101);
break;
case 320: // Give the darkened sunglasses to Mariola.
if (!_inventory.desert().glasses) {
@@ -277,12 +337,24 @@ void RunawayRoomScene::drawScene5060(Graphics::ManagedSurface &viewport) {
_npc.draw(viewport, frame, _camera.x, -_camera.y);
}
static const byte mouth[] = {5, 0, 1, 2, 3, 4, 11, 6, 7, 8, 9, 10};
- if (!drawingRoomAnimation() || (_roomAction != 404 && _roomAction != 414)) {
+ if (_roomAction == 459 || _roomAction == 479) {
+ _actionAnimation.draw(viewport, 96 + (speaker() == 2 ? speechFrame() % 6 : 0), _camera.x, -_camera.y);
+ } else if (!drawingRoomAnimation() || (_roomAction != 404 && _roomAction != 414 &&
+ _roomAction != 419 && _roomAction != 439 && _roomAction != 449)) {
uint frame = 120 + (_now / 80) % 75;
- if (_roomAction == 414)
+ if (_roomAction == 414 || _roomAction == 429 || _roomAction == 469)
frame = mouth[speaker() == 2 ? speechFrame() : 0];
_machine.draw(viewport, frame, _camera.x, -_camera.y);
}
}
+void RunawayRoomScene::animationFrame5060() {
+ if (_roomAction == 419 && _actionStep == 28)
+ _audio.playEffect(56, 217, 1, true);
+ if (_roomAction == 449 && (_actionStep == 6 || _actionStep == 11 || _actionStep == 51))
+ _audio.playFootstep(1, _random.getRandomBit(), 153);
+ if (_roomAction == 449 && _actionStep == 57)
+ _audio.playFootstep(1, _random.getRandomBit());
+}
+
} // End of namespace Hollywood
diff --git a/engines/hollywood/runaway/scene5100.cpp b/engines/hollywood/runaway/scene5100.cpp
index 2c152a9e1a3..8f44169aa9b 100644
--- a/engines/hollywood/runaway/scene5100.cpp
+++ b/engines/hollywood/runaway/scene5100.cpp
@@ -19,6 +19,8 @@
*
*/
+#include "common/scummsys.h"
+#include "common/str-enc.h"
#include "common/textconsole.h"
#include "common/util.h"
#include "hollywood/runaway/scene.h"
@@ -43,9 +45,13 @@ const byte kStudFrames[] = {
101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116,
117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132,
133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148,
- 149, 150, 150, 150, 150, 150, 150, 150, 150, 150
+ 149, 150, 150, 150, 150, 150, 150, 150, 150, 150,
+ 150, 150, 150, 150, 150, 150, 150, 150, 150, 150
};
+// The four throws reuse different ranges of the can animation.
+const byte kCanThrows[][2] = {{0, 19}, {21, 40}, {42, 71}, {72, 88}};
+
const RunawayHotspot kHotspots[] = {
{"", 0, 0, 0, {0, 0}, {0, 0}},
{"Path", 1279, 267, 0, {301, 302}, {0, 1}},
@@ -82,9 +88,9 @@ const RunawayResponse kResponses[] = {
};
const RunawayItemAction kItemActions[] = {
- {5100, 2, 5, 327, true},
- {5100, 9, 6, 16, false},
- {5100, 9, 12, 328, true},
+ {5100, 2, 5, 327, true}, // Pry the footrest off the motorcycle.
+ {5100, 9, 6, 16, false}, // Offer the sleeping pill directly to Stud.
+ {5100, 9, 12, 328, true}, // Put the sleeping pill in Stud's beer.
};
} // End of anonymous namespace
@@ -109,6 +115,7 @@ void RunawayRoomScene::updateMaps5100() {
_desertHotspots[6].x = 253;
_desertHotspots[6].y = 418;
_desertHotspots[6].facing = 4;
+ _desertHotspots[14].action[1] = _desert.guard == 1 ? 340 : 325;
} else if (_desert.guard == 2) {
static const Common::Point positions[] = {
{0, 0}, {1279, 267}, {1259, 354}, {271, 598}, {1279, 267},
@@ -130,6 +137,8 @@ void RunawayRoomScene::updateMaps5100() {
id = 0;
if (id == 7 && _desert.peanutButter != 2)
id = 0;
+ if (id == 6 && _desert.guard == 1)
+ id = 14;
}
}
@@ -298,10 +307,206 @@ RunawayRoomScene::ActionResult RunawayRoomScene::execute5100(uint16 action) {
say(17, 1);
return kBackgroundChanged;
case 328: // Put the sleeping pill in Stud's beer.
- if (_desert.guard)
- return kUnhandled;
- say(9);
- _desert.guardWeaknessKnown = 1;
+ if (!_desert.guard) {
+ say(9);
+ _desert.guardWeaknessKnown = 1;
+ } else if (_desert.guard == 1) {
+ say(9, 1);
+ deferDesertAction(548);
+ }
+ break;
+ case 548: // Wait for the current can to land before reaching for the beer.
+ if (_hangarThrowing) {
+ _hangarThrowing = false;
+ beginRoomAnimationRange(558, 8, 89, _hangarShotFrame, kCanThrows[_hangarShot][1], false);
+ } else {
+ deferDesertAction(568);
+ }
+ break;
+ case 1558: // The current throw has finished; Stud is still distracted.
+ case 568: // Reach out and put the sleeping pill in the beer.
+ beginRoomAnimation(328, 13, 38);
+ break;
+ case 1328: // Finish spiking Stud's beer.
+ _inventory.remove(9);
+ say(9, 2);
+ say(9, 3);
+ deferDesertAction(428);
+ break;
+ case 428: // Retreat through the hangar after spiking the beer.
+ walkHangar(Common::Point(680, 355), 0);
+ deferDesertAction(438);
+ break;
+ case 438: // Return to the path while Stud comes back.
+ walkHangar(Common::Point(1279, 267), 3);
+ deferDesertAction(448);
+ break;
+ case 448: // Restore Stud at his post and approach the hiding place.
+ _desert.guard = 0;
+ _desert.insideBarn = 0;
+ walkHangar(Common::Point(1053, 403), 3);
+ deferDesertAction(458);
+ return kBackgroundChanged;
+ case 458: // Hide while waiting for the sleeping pill to work.
+ say(9, 4);
+ beginRoomAnimationRange(action, 10, 29, 0, 18);
+ break;
+ case 1458: { // Watch Stud finish the spiked beer.
+ const uint count = 249 - 129 + 1;
+ byte brian[count];
+ memset(brian, 18, sizeof(brian));
+ setCameraX(0);
+ beginRoomAnimation(468, 9, 151, kStudFrames + 129, count);
+ setRoomAnimationOverlay(10, 29, brian, ARRAYSIZE(brian));
+ break;
+ }
+ case 1468: // Stud notices that the beer has made him dizzy.
+ say(12, 6, false, 1);
+ holdRoomAnimation(478, 10, 29, 18);
+ break;
+ case 1478: { // Let the sleeping pill take effect.
+ byte brian[111];
+ memset(brian, 18, sizeof(brian));
+ _desert.guard = 2;
+ beginRoomAnimationRange(488, 12, 126, 0, 110);
+ setRoomAnimationOverlay(10, 29, brian, ARRAYSIZE(brian));
+ return kBackgroundChanged;
+ }
+ case 1488: // Emerge from the hiding place.
+ beginRoomAnimationRange(498, 10, 29, 19, 28);
+ break;
+ case 1498: // Approach the now harmless guard.
+ walkTo(Common::Point(656, 600), 7);
+ deferDesertAction(508);
+ break;
+ case 508: // Hear Stud's threats and decide to open the hangar.
+ say(9, 5);
+ say(12, 5, false, 1);
+ say(9, 6);
+ say(9, 7);
+ deferDesertAction(518);
+ break;
+ case 518: // Approach the barn doors.
+ walkTo(Common::Point(1259, 354), 7);
+ deferDesertAction(528);
+ break;
+ case 528: // Open the hangar and mark the helicopter ready.
+ _audio.playEffect(49);
+ _desert.barnDoor = 2;
+ _inventory.desert().helicopterReady = 1;
+ if (_inventory.desert().gunReady && _inventory.desert().bombReady) {
+ say(174, 4, true);
+ leaveDesertRoom(5062);
+ }
+ return kBackgroundChanged;
+ case 340: // Abandon the distraction and return to cover outside.
+ say(13);
+ // Fall through.
+ case 500: // Retreat when Lula and Stud finish their five throws.
+ if (action == 500)
+ say(13, 2);
+ _pendingHotspot = 0;
+ walkHangar(Common::Point(1279, 267), 3);
+ deferDesertAction(510);
+ break;
+ case 510: // Let Stud resume guarding the hangar after a failed attempt.
+ _desert.guard = 0;
+ _desert.insideBarn = 0;
+ walkHangar(Common::Point(1322, 339), 5);
+ return kBackgroundChanged;
+ case 400: { // Arrive with Lula and the concealed walkie-talkie.
+ _desert.visited[6] = 1;
+ _desert.insideBarn = 1;
+ _desert.guard = 0;
+ _hangarIntroduction = true;
+ _hangarLulaPose = 12;
+ _position = Common::Point(253, 418);
+ _walkPath.reset(_position);
+ _facing = 4;
+ _camera = Common::Point(0, 0);
+ byte brian[13];
+ for (uint i = 0; i < ARRAYSIZE(brian); ++i)
+ brian[i] = MIN<uint>(i, 11);
+ beginRoomAnimationRange(action, 16, 79, 0, 12);
+ setRoomAnimationOverlay(15, 16, brian, ARRAYSIZE(brian));
+ return kBackgroundChanged;
+ }
+ case 1400: // Coach Lula through her first encounter, or repeat the challenge.
+ if (!_desert.lulaDistractedGuard) {
+ say(94, 0, false, 1);
+ say(95, 0, false, 2);
+ say(81);
+ } else {
+ say(95, 5, false, 2);
+ say(94, 5, false, 1);
+ say(95, 6, false, 2);
+ say(94, 6, false, 1);
+ }
+ holdRoomAnimation(410, 15, 16, 11);
+ break;
+ case 1410: { // Lula lowers her hand from the earpiece.
+ byte brian[13];
+ memset(brian, 11, sizeof(brian));
+ _hangarLulaPose = 0;
+ beginRoomAnimationRange(420, 16, 79, 12, 0);
+ setRoomAnimationOverlay(15, 16, brian, ARRAYSIZE(brian));
+ break;
+ }
+ case 1420: // Compliment Stud's shooting and suggest a challenge.
+ if (_desert.lulaDistractedGuard) {
+ deferDesertAction(450);
+ } else {
+ say(95, 1, false, 2);
+ say(94, 1, false, 1);
+ say(81, 1);
+ holdRoomAnimation(430, 15, 16, 11);
+ }
+ break;
+ case 1430: // Convince Stud to leave his post for the competition.
+ say(95, 2, false, 2);
+ say(94, 2, false, 1);
+ say(95, 3, false, 2);
+ say(94, 3, false, 1);
+ holdRoomAnimation(440, 15, 16, 11);
+ break;
+ case 1440: // Put away the walkie-talkie as Lula leads Stud away.
+ deferDesertAction(450);
+ break;
+ case 450: { // Put away the radio as Lula walks out of the hangar view.
+ byte brian[60];
+ for (uint i = 0; i < ARRAYSIZE(brian); ++i)
+ brian[i] = MIN<uint>(12 + i, 15);
+ _hangarLulaPose = 79;
+ beginRoomAnimationRange(action, 16, 79, 19, 78);
+ setRoomAnimationOverlay(15, 16, brian, ARRAYSIZE(brian));
+ break;
+ }
+ case 1450: // Stud follows Lula away from his beer.
+ _desert.guard = 1;
+ beginRoomAnimation(460, 17, 52, nullptr, 0, false);
+ return kBackgroundChanged;
+ case 1460: // Lula demonstrates her shooting on the first visit.
+ if (_desert.lulaDistractedGuard) {
+ deferDesertAction(490);
+ } else {
+ say(95, 4, false, 2);
+ beginRoomAnimationRange(470, 8, 89, 0, 19, false);
+ }
+ break;
+ case 1470: // Stud responds with a throw of his own.
+ say(94, 4, false, 1);
+ beginRoomAnimationRange(480, 8, 89, 21, 40, false);
+ break;
+ case 1480: // Finish the demonstration before returning control to Brian.
+ deferDesertAction(490);
+ break;
+ case 490: // Give Brian five throws to spike the unattended beer.
+ _hangarIntroduction = false;
+ _desert.lulaDistractedGuard = 1;
+ _hangarShot = _hangarShotCount = _hangarShotFrame = 0;
+ _hangarShotElapsed = 0;
+ _hangarThrowing = true;
+ say(14);
break;
case 329: // Try to walk past Stud.
say(1, _random.getRandomBit());
@@ -312,29 +517,109 @@ RunawayRoomScene::ActionResult RunawayRoomScene::execute5100(uint16 action) {
return kHandled;
}
+uint RunawayRoomScene::studFrame() const {
+ if (_roomAction == 468 && drawingRoomAnimation())
+ return _actionFrames[_actionStep];
+ if (_roomAction == 478)
+ return 150;
+ return kStudFrames[(_now / 80) % ARRAYSIZE(kStudFrames)];
+}
+
void RunawayRoomScene::drawScene5100(Graphics::ManagedSurface &viewport, bool foreground) {
if (foreground != (walkZone() == 7))
return;
- const uint frame = kStudFrames[(_now / 80) % ARRAYSIZE(kStudFrames)];
- if (_desert.guard == 2)
- _npcMouth.draw(viewport, speaker() == 1 ? 118 + speechFrame() % 6 : 110, _camera.x, -_camera.y);
- else if (!_desert.guard)
- _npc.draw(viewport, speaker() == 1 ? 92 + speechFrame() % 6 : frame, _camera.x, -_camera.y);
- if (_desert.guard == 2 || (frame >= 82 && frame <= 92))
+ const uint frame = studFrame();
+ const bool guardAnimation = drawingRoomAnimation() && (_roomAction == 460 || _roomAction == 468 || _roomAction == 488);
+ if (!guardAnimation) {
+ if (_desert.guard == 2)
+ _npcMouth.draw(viewport, speaker() == 1 ? 118 + speechFrame() % 6 : 110, _camera.x, -_camera.y);
+ else if (!_desert.guard) {
+ uint pose = _hangarIntroduction ? 92 : frame;
+ if (speaker() == 1)
+ pose = 92 + speechFrame() % 6;
+ _npc.draw(viewport, pose, _camera.x, -_camera.y);
+ }
+ }
+ if (_desert.guard || _hangarIntroduction || (frame >= 82 && frame <= 92))
_desertAnimations[0].draw(viewport, 0, _camera.x, -_camera.y);
if (_desert.footrest < 2 && (!drawingRoomAnimation() || _roomAction != 327))
_desertAnimations[1].draw(viewport, _desert.footrest ? 26 : 0, _camera.x, -_camera.y);
+ if (_hangarIntroduction && _hangarLulaPose < 79 &&
+ (!drawingRoomAnimation() || (_roomAction != 400 && _roomAction != 420))) {
+ static const byte mouth[] = {18, 13, 14, 15, 16, 17};
+ _machine.draw(viewport, speaker() == 2 ? mouth[speechFrame() % ARRAYSIZE(mouth)] : _hangarLulaPose, _camera.x, -_camera.y);
+ }
+ if (_desert.guard == 1 && !_hangarIntroduction && _hangarThrowing)
+ _desertAnimations[2].draw(viewport, _hangarShotFrame, _camera.x, -_camera.y);
}
-void RunawayRoomScene::updateScene5100() {
- const uint frame = kStudFrames[(_now / 80) % ARRAYSIZE(kStudFrames)];
+void RunawayRoomScene::startHangarTaunt() {
+ // These one-line taunts play in the background while Brian remains controllable.
+ const SceneSpeechCue cue = _text.stageCue(_hangarShotCount & 1 ? 94 : 95, 7 + _random.getRandomNumber(4));
+ if (cue.valid())
+ _hangarSpeech.start(Common::U32String(_text.largeTextRecord(cue.textRecordId), Common::kDos850), cue.voiceSampleId, false, _now);
+}
+
+void RunawayRoomScene::updateScene5100(uint elapsed, bool inventoryOpen) {
+ const uint frame = studFrame();
byte canHotspot = 12;
- if (_desert.guard != 2 && (frame < 82 || frame > 92))
- canHotspot = _desert.guard ? 0 : 14;
+ if (!_desert.guard && (frame < 82 || frame > 92))
+ canHotspot = 14;
for (uint i = 0; i < 256; ++i) {
if (_originalMaps[256 + i] == 12)
_maps[256 + i] = canHotspot;
}
+ if (!_hangarSpeech.subtitle().empty() && _hangarSpeech.finished(_now))
+ _hangarSpeech.stop();
+ if (_desert.guard != 1 || _hangarIntroduction || _roomAction || _hospitalExit.scene || speaking() || inventoryOpen)
+ return;
+ if (!_hangarSpeech.subtitle().empty())
+ return;
+ if (!_hangarThrowing) {
+ _hangarShot = (_hangarShot + 1 + _random.getRandomNumber(2)) % ARRAYSIZE(kCanThrows);
+ _hangarShotFrame = kCanThrows[_hangarShot][0];
+ _hangarThrowing = true;
+ }
+ _hangarShotElapsed += elapsed;
+ while (_hangarShotElapsed >= 80) {
+ _hangarShotElapsed -= 80;
+ if (++_hangarShotFrame > kCanThrows[_hangarShot][1]) {
+ _hangarThrowing = false;
+ if (++_hangarShotCount == 5) {
+ execute(500);
+ return;
+ }
+ startHangarTaunt();
+ return;
+ }
+ if (_hangarShotFrame == 9 || _hangarShotFrame == 32 || _hangarShotFrame == 70 || _hangarShotFrame == 84)
+ _audio.playEffect(43 + _random.getRandomNumber(2));
+ }
+}
+
+void RunawayRoomScene::animationFrame5100() {
+ if (_roomAction == 328 && _actionStep == 21)
+ _audio.playEffect(39, 204);
+ if (_roomAction == 450 && (_actionStep == 7 || _actionStep == 16 || _actionStep == 25 ||
+ _actionStep == 34 || _actionStep == 43 || _actionStep == 52))
+ _audio.playFootstep(1, _random.getRandomBit());
+ if (_roomAction == 460 && (_actionStep == 19 || _actionStep == 30 || _actionStep == 37 || _actionStep == 44 || _actionStep == 51))
+ _audio.playFootstep(1, _random.getRandomBit());
+ if (_roomAction == 470 || _roomAction == 480 || _roomAction == 558) {
+ const byte frame = _actionFrames[_actionStep];
+ if (frame == 9 || frame == 32 || frame == 70 || frame == 84)
+ _audio.playEffect(43 + _random.getRandomNumber(2));
+ }
+ if (_roomAction == 468) {
+ if (_actionStep == 37)
+ _audio.playEffect(47, 230);
+ if (_actionStep == 79)
+ _audio.playEffect(42, 217);
+ if (_actionStep == 100)
+ _audio.playEffect(45);
+ }
+ if (_roomAction == 488 && _actionStep == 27)
+ _audio.playEffect(48, 191);
}
} // End of namespace Hollywood
Commit: 4d5f22dfca4e71b5e069574f5a71b65c8636e940
https://github.com/scummvm/scummvm/commit/4d5f22dfca4e71b5e069574f5a71b65c8636e940
Author: neuromancer (gustavo.grieco at gmail.com)
Date: 2026-11-19T19:38:52+01:00
Commit Message:
HOLLYWOOD: RUNAWAY: implemented scene 5140
Changed paths:
A engines/hollywood/runaway/scene5140.cpp
engines/hollywood/module.mk
engines/hollywood/runaway/scene.cpp
engines/hollywood/runaway/scene.h
engines/hollywood/runaway/scene5010.cpp
engines/hollywood/runaway/scene_data.h
engines/hollywood/runaway/video.cpp
diff --git a/engines/hollywood/module.mk b/engines/hollywood/module.mk
index b1c4f62f8e2..c07b81ad29d 100644
--- a/engines/hollywood/module.mk
+++ b/engines/hollywood/module.mk
@@ -171,6 +171,7 @@ MODULE_OBJS = \
runaway/scene5080.o \
runaway/scene5100.o \
runaway/scene5110.o \
+ runaway/scene5140.o \
runaway/scene5160.o \
runaway/scene5170.o \
runaway/sequence.o \
diff --git a/engines/hollywood/runaway/scene.cpp b/engines/hollywood/runaway/scene.cpp
index 17d5866d9be..9b9e27a3375 100644
--- a/engines/hollywood/runaway/scene.cpp
+++ b/engines/hollywood/runaway/scene.cpp
@@ -37,7 +37,7 @@ const RunawayRoom *const kRooms[] = {
&kRunawayScene2020, &kRunawayScene2060, &kRunawayScene2080,
&kRunawayScene4030, &kRunawayScene4050, &kRunawayScene4060, &kRunawayScene4070, &kRunawayScene4090, &kRunawayScene4100, &kRunawayScene4140,
&kRunawayScene5010, &kRunawayScene5020, &kRunawayScene5050, &kRunawayScene5060, &kRunawayScene5070,
- &kRunawayScene5080, &kRunawayScene5100, &kRunawayScene5110, &kRunawayScene5160, &kRunawayScene5170
+ &kRunawayScene5080, &kRunawayScene5100, &kRunawayScene5110, &kRunawayScene5140, &kRunawayScene5160, &kRunawayScene5170
};
const RunawayResponse kGlobalResponses[] = {
@@ -233,9 +233,15 @@ bool RunawayRoomScene::enterRoom(uint16 number, Common::Point position, byte fac
return false;
const Common::Path path(Common::String::format("RESOURCE.%c%02u", 'A' + number / 1000 - 1, (number % 1000) / 10));
if (!_archive.open(path, 40) ||
- !loadRunawayMask(_archive, room->width, room->height, _mask, _originalMaps) ||
!_text.load("RESOURCE.003", "Runaway room", number == kMuseumWilly ? 406 : number / 10, 0, 0x1135))
return false;
+ if (number == 5140) {
+ // The bus introduction has only a background and four sprite tracks.
+ _mask.resize(room->width * room->height, 0);
+ _originalMaps.resize(1536, 0);
+ } else if (!loadRunawayMask(_archive, room->width, room->height, _mask, _originalMaps)) {
+ return false;
+ }
if (_game == kRunawayFullGame ? !_actor.loadChapter(number < 4000 ? 1 : number < 5000 ? 2 : 3, number != kMuseumHall) :
!_actor.load(number == kMuseumHall ? RunawayActor::kMuseumHall : RunawayActor::kMuseumInterior))
return false;
@@ -703,6 +709,8 @@ void RunawayRoomScene::update(uint32 now, int scrollDirection, bool inventoryOpe
if (!_sequence.active()) {
if (museumChapter())
finishMuseumFilm();
+ else if (_room == 5140)
+ updateScene5140();
else if (!desertChapter())
finishHospitalFilm();
}
@@ -739,7 +747,7 @@ void RunawayRoomScene::update(uint32 now, int scrollDirection, bool inventoryOpe
_actor.setFrame(_facing, 0, speaking() && !speaker() ? speechFrame() : -1);
return;
}
- if (inventoryOpen || _room == kMuseumKeypad || _room == 5010)
+ if (inventoryOpen || _room == kMuseumKeypad || _room == 5010 || _room == 5140)
return;
if (_walkPath.active() && !speaking()) {
_walkPath.advance(elapsed * 0.18f * actorHeight() / 455, _position, _facing);
@@ -781,6 +789,10 @@ void RunawayRoomScene::draw() {
_screen.copyRectToSurface(_background, 0, kRunawayViewportTop,
Common::Rect(_camera.x, _camera.y, _camera.x + kRunawayScreenWidth, _camera.y + kRunawayViewportHeight));
Graphics::ManagedSurface viewport(_screen, Common::Rect(0, kRunawayViewportTop, kRunawayScreenWidth, kRunawayViewportTop + kRunawayViewportHeight));
+ if (_room == 5140) {
+ drawScene5140(viewport);
+ return;
+ }
if (_room == 5010) {
drawDesertRoom(viewport, false);
return;
diff --git a/engines/hollywood/runaway/scene.h b/engines/hollywood/runaway/scene.h
index ff1d35f04d3..45391e88bba 100644
--- a/engines/hollywood/runaway/scene.h
+++ b/engines/hollywood/runaway/scene.h
@@ -257,6 +257,9 @@ private:
uint studFrame() const;
void updateScene5100(uint elapsed, bool inventoryOpen);
void startHangarTaunt();
+ void startScene5140();
+ void updateScene5140();
+ void drawScene5140(Graphics::ManagedSurface &viewport);
void animationFrame5060();
void animationFrame5100();
bool applyBackground5100();
@@ -332,6 +335,14 @@ private:
bool _hangarThrowing = false;
bool _hangarIntroduction = false;
byte _hangarLulaPose = 0;
+ struct BusIntroduction {
+ enum Phase { kArrival, kConversation, kFilm, kReturn, kFarewell };
+ Phase phase = kArrival;
+ uint32 tick = 0;
+ byte nextLine = 0, frame = 0, lastFrame = 51;
+ byte facing = 2, speaker = 6;
+ bool blink = false;
+ } _busIntroduction;
RunawayAnimation _npc, _npcMouth, _machine;
RunawayAnimation _computer, _rejectionLight;
uint32 _nextLaser = 0;
diff --git a/engines/hollywood/runaway/scene5010.cpp b/engines/hollywood/runaway/scene5010.cpp
index bb7e806cf5f..62dbe25b5c3 100644
--- a/engines/hollywood/runaway/scene5010.cpp
+++ b/engines/hollywood/runaway/scene5010.cpp
@@ -61,6 +61,10 @@ void RunawayRoomScene::resumeDesert() {
if (!_entering)
return;
_entering = false;
+ if (_room == 5140) {
+ startScene5140();
+ return;
+ }
if (_entryScene == 5021 && !_desert.escapedCabin) {
_desert.escapedCabin = 1;
say(0);
@@ -134,6 +138,10 @@ void RunawayRoomScene::desertAnimationFrame() {
}
void RunawayRoomScene::updateDesert(uint elapsed, bool inventoryOpen) {
+ if (_room == 5140) {
+ updateScene5140();
+ return;
+ }
updateRoomAnimation();
updateConversation();
if (_room == 5080)
@@ -231,6 +239,7 @@ bool RunawayRoomScene::loadDesertRoom() {
{5080, 18, 769}, {5080, 17, 672}, {5080, 16, 455}, {5080, 20, 631}, {5080, 19, 533}, {5080, 15, 24},
{5100, 4, 1}, {5100, 7, 27}, {5100, 8, 89},
{5110, 8, 1}, {5110, 9, 2},
+ {5140, 1, 130}, {5140, 2, 33}, {5140, 3, 51}, {5140, 4, 32},
{5160, 4, 16}, {5160, 5, 24}, {5160, 6, 24}, {5160, 7, 93},
{5170, 6, 25}, {5170, 5, 24}, {5170, 4, 50}, {5170, 11, 3}
};
diff --git a/engines/hollywood/runaway/scene5140.cpp b/engines/hollywood/runaway/scene5140.cpp
new file mode 100644
index 00000000000..015f04fd9c0
--- /dev/null
+++ b/engines/hollywood/runaway/scene5140.cpp
@@ -0,0 +1,212 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+
+#include "common/util.h"
+#include "hollywood/runaway/scene.h"
+
+namespace Hollywood {
+namespace {
+
+const RunawayHotspot kHotspots[] = {
+ {"", 0, 0, 0, {0, 0}, {0, 0}},
+};
+
+const byte kBrianFrames[] = {
+ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
+ 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31,
+ 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47,
+ 48, 49, 50, 51, 51, 51, 51, 51, 51, 51, 51, 51, 51, 52, 53, 54,
+ 55, 56, 57, 58, 59, 60, 61, 62, 51, 51, 51, 51, 51, 51, 51, 51,
+ 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79,
+ 80, 80, 80, 80, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91,
+ 80, 80, 80, 80, 80, 80, 80, 80, 93, 94, 95, 96, 97, 98, 99, 100,
+ 101, 101, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 101, 101,
+ 101, 101, 101, 101, 101, 101, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123,
+ 124, 125, 126, 127, 128, 80
+};
+
+enum Speaker { kBrianCarla, kBrianLula, kBrianMariola, kCarla, kLula, kMariola, kNobody };
+const byte kNoLine = 0xff;
+const byte kBrianTalkFrames[] = {130, 100, 60};
+
+struct IntroductionLine {
+ byte variation;
+ Speaker speaker;
+ byte firstFrame, lastFrame;
+};
+
+const IntroductionLine kIntroduction[] = {
+ {0, kMariola, 0, 0}, // Greet Brian.
+ {1, kBrianMariola, 0, 0},
+ {2, kCarla, 120, 128}, // Turn toward Carla.
+ {3, kBrianCarla, 0, 0},
+ {4, kLula, 150, 165}, // Turn toward Lula.
+ {5, kBrianLula, 0, 0},
+ {kNoLine, kNobody, 95, 80}, // Turn back to Mariola.
+ {6, kBrianMariola, 0, 0}, // Explain Gina's captivity.
+ {7, kMariola, 0, 0},
+ {8, kCarla, 120, 128},
+ {9, kLula, 150, 165},
+ {10, kMariola, 95, 80},
+ {11, kCarla, 120, 128},
+ {12, kBrianCarla, 0, 0}, // Ask for help.
+ {13, kLula, 150, 165},
+ {14, kBrianLula, 0, 0},
+ {kNoLine, kNobody, 164, 150}, // Turn back to Carla.
+ {15, kBrianCarla, 0, 0}, // Introductions.
+ {16, kCarla, 0, 0},
+ {17, kMariola, 127, 120},
+ {18, kLula, 80, 96},
+ {19, kBrianLula, 0, 0},
+ {20, kMariola, 95, 80},
+ {21, kBrianMariola, 0, 0},
+ {22, kCarla, 120, 128},
+ {23, kLula, 150, 165},
+ {24, kMariola, 95, 80},
+ {25, kBrianMariola, 0, 0},
+ {kNoLine, kNobody, 80, 96},
+ {26, kBrianLula, 0, 0}, // Think of a rescue plan.
+ {kNoLine, kNobody, 164, 150},
+ {27, kBrianCarla, 0, 0},
+ {28, kLula, 150, 165},
+ {29, kMariola, 95, 80},
+ {30, kCarla, 120, 128},
+};
+
+const IntroductionLine kFarewell[] = {
+ {kNoLine, kNobody, 120, 128}, // Brian finds that the others have left.
+ {32, kBrianCarla, 0, 0},
+ {33, kMariola, 0, 0}, // Offscreen reply.
+ {34, kBrianCarla, 0, 0},
+};
+
+} // End of anonymous namespace
+
+const RunawayRoom kRunawayScene5140 = {
+ 5140, 1024, 600, kHotspots, ARRAYSIZE(kHotspots), {},
+ Common::Point(512, 500),
+ nullptr, 0,
+ nullptr, 0,
+ nullptr, 0
+};
+
+void RunawayRoomScene::startScene5140() {
+ _busIntroduction = BusIntroduction();
+ _busIntroduction.tick = _now;
+ _roomAction = 5140;
+}
+
+void RunawayRoomScene::updateScene5140() {
+ BusIntroduction &intro = _busIntroduction;
+ if (intro.phase == BusIntroduction::kFilm) {
+ intro.phase = BusIntroduction::kReturn;
+ intro.frame = 0;
+ intro.lastFrame = 51;
+ intro.tick = _now;
+ intro.nextLine = 0;
+ intro.speaker = kNobody;
+ }
+ const bool arriving = intro.phase == BusIntroduction::kArrival || intro.phase == BusIntroduction::kReturn;
+ if (_now - intro.tick >= 80) {
+ intro.tick = _now;
+ intro.blink = false;
+ if (intro.frame != intro.lastFrame) {
+ if (intro.frame < intro.lastFrame)
+ ++intro.frame;
+ else
+ --intro.frame;
+ if (intro.phase == BusIntroduction::kArrival &&
+ (intro.frame == 1 || intro.frame == 6 || intro.frame == 11 ||
+ intro.frame == 14 || intro.frame == 15 || intro.frame == 24))
+ _audio.playFootstep(2, _random.getRandomBit());
+ } else if (intro.speaker >= kCarla && intro.facing != kBrianLula) {
+ intro.blink = !_random.getRandomNumber(14);
+ }
+ }
+ if (intro.frame != intro.lastFrame || speaking())
+ return;
+ if (arriving) {
+ intro.phase = intro.phase == BusIntroduction::kArrival ? BusIntroduction::kConversation : BusIntroduction::kFarewell;
+ intro.frame = intro.lastFrame = kBrianTalkFrames[kBrianMariola];
+ }
+ const bool farewell = intro.phase == BusIntroduction::kFarewell;
+ const IntroductionLine *lines = farewell ? kFarewell : kIntroduction;
+ const uint count = farewell ? ARRAYSIZE(kFarewell) : ARRAYSIZE(kIntroduction);
+ if (intro.nextLine == count) {
+ if (farewell) {
+ _roomAction = 0;
+ leaveDesertRoom(5060);
+ _transition = _hospitalExit;
+ } else {
+ // Brian pauses to think, then announces that he has a plan.
+ typedef RunawaySequence S;
+ static const S::Command film[] = {
+ {S::kOpen, 6}, {S::kPlay, 0, 0}, {S::kEffect, 20, 255},
+ {S::kPlay, 1, 186}, {S::kTalk, 1, 31, 1}, {S::kEnd}
+ };
+ intro.phase = BusIntroduction::kFilm;
+ _sequence.start(film, _text, _now, 'E');
+ }
+ return;
+ }
+ const IntroductionLine &line = lines[intro.nextLine++];
+ intro.speaker = line.speaker;
+ if (line.firstFrame != line.lastFrame) {
+ intro.frame = line.firstFrame;
+ intro.lastFrame = line.lastFrame;
+ intro.facing = line.lastFrame == 80 || line.lastFrame == 120 ? kBrianMariola :
+ line.lastFrame == 96 || line.lastFrame == 165 ? kBrianLula : kBrianCarla;
+ } else if (line.speaker <= kBrianMariola) {
+ intro.facing = line.speaker;
+ intro.frame = intro.lastFrame = kBrianTalkFrames[intro.facing];
+ }
+ intro.tick = _now;
+ if (line.variation != kNoLine)
+ say(1, line.variation, false, line.speaker + 1);
+}
+
+void RunawayRoomScene::drawScene5140(Graphics::ManagedSurface &viewport) {
+ const BusIntroduction &intro = _busIntroduction;
+ const bool arriving = intro.phase == BusIntroduction::kArrival || intro.phase == BusIntroduction::kReturn;
+ uint frames[] = {kBrianFrames[intro.frame], 27, 44, 25};
+ if (arriving) {
+ frames[1] = MIN<uint>(intro.frame, 27);
+ frames[2] = MIN<uint>(intro.frame, 44);
+ frames[3] = MIN<uint>(intro.frame, 25);
+ } else {
+ const byte mouth = speaking() ? speechFrame() : 0;
+ if (intro.frame == intro.lastFrame)
+ frames[0] = kBrianFrames[kBrianTalkFrames[intro.facing] +
+ (intro.speaker <= kBrianMariola ? mouth : intro.blink ? 6 : 0)];
+ if (intro.speaker >= kCarla && intro.speaker <= kMariola)
+ frames[intro.speaker - kCarla + 1] += mouth % 6;
+ }
+ const bool alone = intro.phase == BusIntroduction::kReturn || intro.phase == BusIntroduction::kFarewell;
+ if (!alone)
+ _desertAnimations[2].draw(viewport, frames[2], 0, 0);
+ _desertAnimations[0].draw(viewport, frames[0], 0, 0);
+ if (!alone) {
+ _desertAnimations[1].draw(viewport, frames[1], 0, 0);
+ _desertAnimations[3].draw(viewport, frames[3], 0, 0);
+ }
+}
+
+} // End of namespace Hollywood
diff --git a/engines/hollywood/runaway/scene_data.h b/engines/hollywood/runaway/scene_data.h
index 930b3a40fbd..45f1a2bcaec 100644
--- a/engines/hollywood/runaway/scene_data.h
+++ b/engines/hollywood/runaway/scene_data.h
@@ -100,6 +100,7 @@ extern const RunawayRoom kRunawayScene5070;
extern const RunawayRoom kRunawayScene5080;
extern const RunawayRoom kRunawayScene5100;
extern const RunawayRoom kRunawayScene5110;
+extern const RunawayRoom kRunawayScene5140;
extern const RunawayRoom kRunawayScene5160;
extern const RunawayRoom kRunawayScene5170;
diff --git a/engines/hollywood/runaway/video.cpp b/engines/hollywood/runaway/video.cpp
index c4a84bb9bc5..576edb634fe 100644
--- a/engines/hollywood/runaway/video.cpp
+++ b/engines/hollywood/runaway/video.cpp
@@ -75,6 +75,7 @@ const FilmOverlay kFilmOverlays[] = {
{'D', 8, 0, 0, 6, 79, 67, 176, 170},
{'D', 10, 0, 0, 6, 180, 46, 698, 600},
{'D', 9, 0, 0, 12, 474, 36, 578, 234},
+ {'E', 6, 0, 0, 12, 388, 196, 530, 408},
};
} // End of anonymous namespace
Commit: 2213538060b014a137d8da02e1e0e1348ce7ef50
https://github.com/scummvm/scummvm/commit/2213538060b014a137d8da02e1e0e1348ce7ef50
Author: neuromancer (gustavo.grieco at gmail.com)
Date: 2026-11-19T19:38:52+01:00
Commit Message:
HOLLYWOOD: RUNAWAY: implemented scene 5130 and refined some other 5xxx scenes
Changed paths:
A engines/hollywood/runaway/scene5130.cpp
engines/hollywood/module.mk
engines/hollywood/runaway/scene.cpp
engines/hollywood/runaway/scene.h
engines/hollywood/runaway/scene5010.cpp
engines/hollywood/runaway/scene5020.cpp
engines/hollywood/runaway/scene5060.cpp
engines/hollywood/runaway/scene_data.h
engines/hollywood/runaway/video.cpp
diff --git a/engines/hollywood/module.mk b/engines/hollywood/module.mk
index c07b81ad29d..304e2097f0b 100644
--- a/engines/hollywood/module.mk
+++ b/engines/hollywood/module.mk
@@ -171,6 +171,7 @@ MODULE_OBJS = \
runaway/scene5080.o \
runaway/scene5100.o \
runaway/scene5110.o \
+ runaway/scene5130.o \
runaway/scene5140.o \
runaway/scene5160.o \
runaway/scene5170.o \
diff --git a/engines/hollywood/runaway/scene.cpp b/engines/hollywood/runaway/scene.cpp
index 9b9e27a3375..164229bc52a 100644
--- a/engines/hollywood/runaway/scene.cpp
+++ b/engines/hollywood/runaway/scene.cpp
@@ -37,7 +37,8 @@ const RunawayRoom *const kRooms[] = {
&kRunawayScene2020, &kRunawayScene2060, &kRunawayScene2080,
&kRunawayScene4030, &kRunawayScene4050, &kRunawayScene4060, &kRunawayScene4070, &kRunawayScene4090, &kRunawayScene4100, &kRunawayScene4140,
&kRunawayScene5010, &kRunawayScene5020, &kRunawayScene5050, &kRunawayScene5060, &kRunawayScene5070,
- &kRunawayScene5080, &kRunawayScene5100, &kRunawayScene5110, &kRunawayScene5140, &kRunawayScene5160, &kRunawayScene5170
+ &kRunawayScene5080, &kRunawayScene5100, &kRunawayScene5110, &kRunawayScene5130, &kRunawayScene5140,
+ &kRunawayScene5160, &kRunawayScene5170
};
const RunawayResponse kGlobalResponses[] = {
@@ -711,6 +712,8 @@ void RunawayRoomScene::update(uint32 now, int scrollDirection, bool inventoryOpe
finishMuseumFilm();
else if (_room == 5140)
updateScene5140();
+ else if (_entryScene == 5022)
+ _chapterComplete = true;
else if (!desertChapter())
finishHospitalFilm();
}
diff --git a/engines/hollywood/runaway/scene.h b/engines/hollywood/runaway/scene.h
index 45391e88bba..0172a606d0e 100644
--- a/engines/hollywood/runaway/scene.h
+++ b/engines/hollywood/runaway/scene.h
@@ -257,6 +257,10 @@ private:
uint studFrame() const;
void updateScene5100(uint elapsed, bool inventoryOpen);
void startHangarTaunt();
+ void startScene5130();
+ void updateScene5130();
+ void drawScene5130(Graphics::ManagedSurface &viewport);
+ void startRescueFilm();
void startScene5140();
void updateScene5140();
void drawScene5140(Graphics::ManagedSurface &viewport);
@@ -343,6 +347,11 @@ private:
byte facing = 2, speaker = 6;
bool blink = false;
} _busIntroduction;
+ struct RescuePlan {
+ uint32 tick = 0, pauseUntil = 0;
+ byte nextLine = 1, groupFrame = 58, carlaFrame = 0;
+ bool blink = false;
+ } _rescuePlan;
RunawayAnimation _npc, _npcMouth, _machine;
RunawayAnimation _computer, _rejectionLight;
uint32 _nextLaser = 0;
diff --git a/engines/hollywood/runaway/scene5010.cpp b/engines/hollywood/runaway/scene5010.cpp
index 62dbe25b5c3..0e7815d2fb7 100644
--- a/engines/hollywood/runaway/scene5010.cpp
+++ b/engines/hollywood/runaway/scene5010.cpp
@@ -61,6 +61,10 @@ void RunawayRoomScene::resumeDesert() {
if (!_entering)
return;
_entering = false;
+ if (_room == 5130) {
+ startScene5130();
+ return;
+ }
if (_room == 5140) {
startScene5140();
return;
@@ -71,10 +75,19 @@ void RunawayRoomScene::resumeDesert() {
leaveDesertRoom(5140);
return;
}
+ if (_entryScene == 5022) {
+ _audio.playMusic(22);
+ _audio.setMusicVolume(255);
+ walkTo(Common::Point(618, 386), 0);
+ deferDesertAction(400);
+ return;
+ }
if (_entryScene == 5062) {
- for (byte variation = 2; variation <= 11; ++variation)
- say(0, variation, false, variation == 2 || variation == 4 || variation == 6 || variation == 11 ? 0 : 1);
- leaveDesertRoom(5130);
+ _position = Common::Point(870, 525);
+ _walkPath.reset(_position);
+ _facing = 7;
+ setCameraX(132);
+ execute(480);
return;
}
if (_entryScene == 5171) {
@@ -138,6 +151,10 @@ void RunawayRoomScene::desertAnimationFrame() {
}
void RunawayRoomScene::updateDesert(uint elapsed, bool inventoryOpen) {
+ if (_room == 5130) {
+ updateScene5130();
+ return;
+ }
if (_room == 5140) {
updateScene5140();
return;
@@ -214,6 +231,8 @@ float RunawayRoomScene::desertActorHeight() const {
return _position.y * 0.668016195f + 87.591095f;
case 5110:
return _position.y * 1.142857194f - 170.571426f;
+ case 5130:
+ return 360;
case 5160:
return _position.y * 1.148148179f - 90.370369f;
case 5170:
@@ -239,6 +258,7 @@ bool RunawayRoomScene::loadDesertRoom() {
{5080, 18, 769}, {5080, 17, 672}, {5080, 16, 455}, {5080, 20, 631}, {5080, 19, 533}, {5080, 15, 24},
{5100, 4, 1}, {5100, 7, 27}, {5100, 8, 89},
{5110, 8, 1}, {5110, 9, 2},
+ {5130, 4, 71}, {5130, 5, 33},
{5140, 1, 130}, {5140, 2, 33}, {5140, 3, 51}, {5140, 4, 32},
{5160, 4, 16}, {5160, 5, 24}, {5160, 6, 24}, {5160, 7, 93},
{5170, 6, 25}, {5170, 5, 24}, {5170, 4, 50}, {5170, 11, 3}
@@ -397,6 +417,11 @@ Common::U32String RunawayRoomScene::desertHotspotName(byte id) const {
}
void RunawayRoomScene::drawDesertRoom(Graphics::ManagedSurface &viewport, bool foreground) {
+ if (_room == 5130) {
+ if (!foreground)
+ drawScene5130(viewport);
+ return;
+ }
if (_room == 5100) {
drawScene5100(viewport, foreground);
return;
diff --git a/engines/hollywood/runaway/scene5020.cpp b/engines/hollywood/runaway/scene5020.cpp
index 791c944d0cd..0b428360642 100644
--- a/engines/hollywood/runaway/scene5020.cpp
+++ b/engines/hollywood/runaway/scene5020.cpp
@@ -19,6 +19,7 @@
*
*/
+#include "common/file.h"
#include "common/util.h"
#include "hollywood/runaway/scene.h"
#include "hollywood/runaway/scene_data.h"
@@ -106,10 +107,59 @@ RunawayRoomScene::ActionResult RunawayRoomScene::execute5020(uint16 action) {
_inventory.add(25);
say(12);
return kBackgroundChanged;
+ case 400: // Check that everyone is in position for the rescue.
+ say(50);
+ deferDesertAction(410);
+ break;
+ case 410: // Rescue Gina and escape in the helicopter.
+ startRescueFilm();
+ break;
default:
return kUnhandled;
}
return kHandled;
}
+void RunawayRoomScene::startRescueFilm() {
+ typedef RunawaySequence S;
+ _filmCommands = {
+ {S::kOpen, 2}, {S::kPlay, 0, 40},
+ // Check Mariola's position at the oil well.
+ {S::kPlay, 91, 92}, {S::kSpeech, 50, 1}, {S::kPlay, 93, 128}, {S::kWaitSpeech},
+ {S::kTalk, 50, 3, 1}, {S::kTalk, 50, 4, 1, 1},
+ // Check Lula's position at the machine gun.
+ {S::kEffect, 77, 255}, {S::kPlay, 162, 163}, {S::kSpeech, 50, 5},
+ {S::kPlay, 164, 253}, {S::kWaitSpeech}, {S::kTalk, 50, 6, 3}, {S::kTalk, 50, 7, 3, 1},
+ // Check Carla's helicopter, then give the signal.
+ {S::kStill, 254}, {S::kTalk, 50, 8, 5, 1}, {S::kTalk, 50, 9, 5}, {S::kTalk, 50, 10, 5, 1},
+ {S::kStill, 40}, {S::kTalk, 50, 11}, {S::kMusic, 23, 255, 1},
+ // The explosion draws the guards outside.
+ {S::kEffect, 78, 255}, {S::kPlay, 346, 374}, {S::kSpeech, 50, 12},
+ {S::kPlay, 375, 430}, {S::kWaitSpeech}, {S::kStill, 430},
+ {S::kTalk, 50, 13, 7}, {S::kTalk, 50, 14, 9},
+ // Gina escapes while Lula covers the retreat.
+ {S::kEffect, 79, 255}, {S::kPlay, 454, 499}, {S::kSpeech, 50, 17, 19},
+ {S::kPlay, 500, 699}, {S::kSpeech, 50, 20}, {S::kPlay, 700, 1173},
+ {S::kSpeech, 50, 21, 22}, {S::kPlay, 1174, 1379},
+ // Carla narrowly avoids the wrecked airplane during takeoff.
+ {S::kSpeech, 50, 23, 24}, {S::kSpeech, 50, 31}, {S::kPlay, 1380, 1524}, {S::kWaitSpeech},
+ {S::kTalk, 50, 32}, {S::kTalk, 50, 33}, {S::kTalk, 50, 34}, {S::kWaitEffect, 5000}, {S::kEnd}
+ };
+ if (Common::File::exists("DATAVC00.000")) {
+ // GOG removes the CD portrait frames and keeps three separate stills
+ // inside the movie. The remaining action retains its original timing.
+ for (uint i = 0; i < _filmCommands.size(); ++i) {
+ S::Command &command = _filmCommands[i];
+ if (command.operation == S::kStill) {
+ command.a = command.a == 254 ? 172 : command.a == 40 ? 173 : 259;
+ } else if (command.operation == S::kPlay) {
+ const uint offset = command.a >= 454 ? 195 : command.a >= 346 ? 172 : command.a >= 162 ? 82 : command.a >= 91 ? 49 : 0;
+ command.a -= offset;
+ command.b -= offset;
+ }
+ }
+ }
+ _sequence.start(_filmCommands.data(), _text, _now, 'E');
+}
+
} // End of namespace Hollywood
diff --git a/engines/hollywood/runaway/scene5060.cpp b/engines/hollywood/runaway/scene5060.cpp
index 8d403de50eb..eeb6cde5881 100644
--- a/engines/hollywood/runaway/scene5060.cpp
+++ b/engines/hollywood/runaway/scene5060.cpp
@@ -92,6 +92,29 @@ const RunawayRoom kRunawayScene5060 = {
RunawayRoomScene::ActionResult RunawayRoomScene::execute5060(uint16 action) {
switch (action) {
+ case 480: { // Gather everyone after all three rescue preparations are complete.
+ static const byte speakers[] = {0, 1, 0, 2, 0, 2, 1, 3};
+ for (uint i = 0; i < ARRAYSIZE(speakers); ++i)
+ say(0, i + 2, false, speakers[i]);
+ deferDesertAction(481);
+ break;
+ }
+ case 481: { // Carla comes out of the bus.
+ Common::Array<byte> frames;
+ frames.push_back(0);
+ for (uint i = 0; i <= 45; ++i)
+ frames.push_back(i);
+ beginRoomAnimation(action, 19, 58, frames.data(), frames.size(), false);
+ break;
+ }
+ case 1481: // Carla reports for duty.
+ say(0, 10, false, 3);
+ say(0, 11);
+ deferDesertAction(491);
+ break;
+ case 491: // Move to the rescue briefing.
+ leaveDesertRoom(5130);
+ break;
case 302: // Go to the desert overview.
leaveDesertRoom(5010);
break;
@@ -330,13 +353,20 @@ RunawayRoomScene::ActionResult RunawayRoomScene::execute5060(uint16 action) {
}
void RunawayRoomScene::drawScene5060(Graphics::ManagedSurface &viewport) {
+ static const byte mouth[] = {5, 0, 1, 2, 3, 4, 11, 6, 7, 8, 9, 10};
+ if (_entryScene == 5062) {
+ if (_roomAction == 491)
+ _actionAnimation.draw(viewport, 45 + (speaker() == 3 ? speechFrame() : 0), _camera.x, -_camera.y);
+ _npc.draw(viewport, 83 + (speaker() == 1 ? speechFrame() : 0), _camera.x, -_camera.y);
+ _machine.draw(viewport, mouth[speaker() == 2 ? speechFrame() : 0], _camera.x, -_camera.y);
+ return;
+ }
if (!drawingRoomAnimation() || (_roomAction != 412 && _roomAction != 432)) {
uint frame = (_now / 80) % 13;
if (_roomAction == 422 || _roomAction == 432)
frame = 83 + (speaker() == 1 ? speechFrame() : 0);
_npc.draw(viewport, frame, _camera.x, -_camera.y);
}
- static const byte mouth[] = {5, 0, 1, 2, 3, 4, 11, 6, 7, 8, 9, 10};
if (_roomAction == 459 || _roomAction == 479) {
_actionAnimation.draw(viewport, 96 + (speaker() == 2 ? speechFrame() % 6 : 0), _camera.x, -_camera.y);
} else if (!drawingRoomAnimation() || (_roomAction != 404 && _roomAction != 414 &&
@@ -349,6 +379,12 @@ void RunawayRoomScene::drawScene5060(Graphics::ManagedSurface &viewport) {
}
void RunawayRoomScene::animationFrame5060() {
+ if (_roomAction == 481) {
+ if (_actionStep == 3 || _actionStep == 12 || _actionStep == 17 || _actionStep == 25 || _actionStep == 29)
+ _audio.playFootstep(4, _random.getRandomBit(), 153);
+ if (_actionStep == 39)
+ _audio.playFootstep(4, _random.getRandomBit(), 230);
+ }
if (_roomAction == 419 && _actionStep == 28)
_audio.playEffect(56, 217, 1, true);
if (_roomAction == 449 && (_actionStep == 6 || _actionStep == 11 || _actionStep == 51))
diff --git a/engines/hollywood/runaway/scene5130.cpp b/engines/hollywood/runaway/scene5130.cpp
new file mode 100644
index 00000000000..80e76979ba4
--- /dev/null
+++ b/engines/hollywood/runaway/scene5130.cpp
@@ -0,0 +1,129 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+
+#include "common/util.h"
+#include "hollywood/runaway/scene.h"
+
+namespace Hollywood {
+namespace {
+
+const RunawayHotspot kHotspots[] = {
+ {"", 0, 0, 0, {0, 0}, {0, 0}},
+};
+
+enum Speaker { kBrian, kLula, kMariola, kCarla };
+const Speaker kSpeakers[] = {
+ kBrian, kLula, kMariola, kBrian, kMariola, // Explain Mariola's part in the rescue.
+ kBrian, kLula, kBrian, kLula, kBrian, kLula, // Distribute the transmitters and brief Lula.
+ kBrian, kBrian, kCarla, kBrian, kCarla, kLula, kCarla, // Get Carla's attention.
+ kBrian, kMariola, kBrian // Send everyone to their positions.
+};
+
+} // End of anonymous namespace
+
+const RunawayRoom kRunawayScene5130 = {
+ 5130, 1024, 600, kHotspots, ARRAYSIZE(kHotspots),
+ {{80, 75, 70}, {80, 75, 70}, {80, 75, 70}, {80, 75, 70}, {80, 75, 70},
+ {80, 75, 70}, {80, 75, 70}, {80, 75, 70}, {80, 75, 70}, {80, 75, 70}},
+ Common::Point(205, 599),
+ nullptr, 0,
+ nullptr, 0,
+ nullptr, 0
+};
+
+void RunawayRoomScene::startScene5130() {
+ _rescuePlan = RescuePlan();
+ _rescuePlan.tick = _now;
+ _facing = 1;
+ _roomAction = 5130;
+}
+
+void RunawayRoomScene::updateScene5130() {
+ RescuePlan &plan = _rescuePlan;
+ const Speaker next = plan.nextLine <= ARRAYSIZE(kSpeakers) ? kSpeakers[plan.nextLine - 1] : kBrian;
+ if (_now - plan.tick >= 80) {
+ plan.tick = _now;
+ if (plan.groupFrame < 58) {
+ if (plan.groupFrame != 32 && plan.groupFrame != 57) {
+ ++plan.groupFrame;
+ } else if (!speaking() && (next == kLula || next == kMariola)) {
+ plan.groupFrame = next == kLula ? 64 : 58;
+ } else {
+ plan.groupFrame = 33;
+ }
+ }
+ if (plan.carlaFrame < 15) {
+ ++plan.carlaFrame;
+ } else if (plan.carlaFrame == 15) {
+ plan.carlaFrame = !speaking() && next == kCarla ? 16 : 0;
+ } else if (plan.carlaFrame < 20) {
+ ++plan.carlaFrame;
+ }
+ plan.blink = !_random.getRandomNumber(14);
+ }
+ if (speaking())
+ return;
+ if (plan.nextLine > ARRAYSIZE(kSpeakers)) {
+ _roomAction = 0;
+ leaveDesertRoom(5022);
+ _transition = _hospitalExit;
+ return;
+ }
+ if ((plan.nextLine == 7 || plan.nextLine == 20) && plan.groupFrame < 58)
+ return;
+ if (plan.nextLine == 14 && plan.carlaFrame < 20)
+ return;
+ if (plan.nextLine == 13) {
+ if (!plan.pauseUntil)
+ plan.pauseUntil = _now + 3000;
+ if ((int32)(_now - plan.pauseUntil) < 0)
+ return;
+ }
+ if (next == kLula || next == kMariola)
+ plan.groupFrame = next == kLula ? 64 : 58;
+ switch (plan.nextLine) {
+ case 6: // Distribute the transmitters.
+ case 19: // Reassure everyone about Carla's flying.
+ plan.groupFrame = 33;
+ break;
+ case 12: // Turn to Carla.
+ case 21: // Finish the briefing.
+ plan.groupFrame = 0;
+ break;
+ default:
+ break;
+ }
+ say(0, plan.nextLine++, false, next);
+}
+
+void RunawayRoomScene::drawScene5130(Graphics::ManagedSurface &viewport) {
+ const RescuePlan &plan = _rescuePlan;
+ uint carla = plan.carlaFrame;
+ if (carla == 20)
+ carla += speaking() && speaker() == kCarla ? speechFrame() : plan.blink ? 6 : 0;
+ uint group = plan.groupFrame;
+ if (speaking() && (speaker() == kLula || speaker() == kMariola))
+ group = (speaker() == kLula ? 64 : 58) + speechFrame() % 6;
+ _desertAnimations[1].draw(viewport, carla, 0, 0);
+ _desertAnimations[0].draw(viewport, group, 0, 0);
+}
+
+} // End of namespace Hollywood
diff --git a/engines/hollywood/runaway/scene_data.h b/engines/hollywood/runaway/scene_data.h
index 45f1a2bcaec..dddcb5d9dc3 100644
--- a/engines/hollywood/runaway/scene_data.h
+++ b/engines/hollywood/runaway/scene_data.h
@@ -100,6 +100,7 @@ extern const RunawayRoom kRunawayScene5070;
extern const RunawayRoom kRunawayScene5080;
extern const RunawayRoom kRunawayScene5100;
extern const RunawayRoom kRunawayScene5110;
+extern const RunawayRoom kRunawayScene5130;
extern const RunawayRoom kRunawayScene5140;
extern const RunawayRoom kRunawayScene5160;
extern const RunawayRoom kRunawayScene5170;
diff --git a/engines/hollywood/runaway/video.cpp b/engines/hollywood/runaway/video.cpp
index 576edb634fe..9d4c83034d8 100644
--- a/engines/hollywood/runaway/video.cpp
+++ b/engines/hollywood/runaway/video.cpp
@@ -75,6 +75,11 @@ const FilmOverlay kFilmOverlays[] = {
{'D', 8, 0, 0, 6, 79, 67, 176, 170},
{'D', 10, 0, 0, 6, 180, 46, 698, 600},
{'D', 9, 0, 0, 12, 474, 36, 578, 234},
+ {'E', 2, 0, 0, 6, 490, 192, 586, 300},
+ {'E', 2, 1, 6, 6, 532, 38, 646, 172},
+ {'E', 2, 2, 12, 12, 627, 170, 840, 388},
+ {'E', 2, 3, 24, 12, 590, 240, 641, 296},
+ {'E', 2, 4, 36, 12, 426, 254, 480, 314},
{'E', 6, 0, 0, 12, 388, 196, 530, 408},
};
Commit: d0af6b0196d2d79a918fe684ca3618fd866b336f
https://github.com/scummvm/scummvm/commit/d0af6b0196d2d79a918fe684ca3618fd866b336f
Author: neuromancer (gustavo.grieco at gmail.com)
Date: 2026-11-19T19:38:52+01:00
Commit Message:
HOLLYWOOD: RUNAWAY: implemented first pass on scenes 6220, 6350 and 6370
Changed paths:
A engines/hollywood/runaway/scene6220.cpp
A engines/hollywood/runaway/scene6350.cpp
A engines/hollywood/runaway/scene6370.cpp
engines/hollywood/module.mk
engines/hollywood/runaway/engine.cpp
engines/hollywood/runaway/graphics.cpp
engines/hollywood/runaway/graphics.h
engines/hollywood/runaway/inventory.cpp
engines/hollywood/runaway/saveload.cpp
engines/hollywood/runaway/saveload.h
engines/hollywood/runaway/scene.cpp
engines/hollywood/runaway/scene.h
engines/hollywood/runaway/scene2010.cpp
engines/hollywood/runaway/scene4070.cpp
engines/hollywood/runaway/scene_data.h
engines/hollywood/runaway/video.cpp
diff --git a/engines/hollywood/module.mk b/engines/hollywood/module.mk
index 304e2097f0b..c8778dcf3a4 100644
--- a/engines/hollywood/module.mk
+++ b/engines/hollywood/module.mk
@@ -175,6 +175,9 @@ MODULE_OBJS = \
runaway/scene5140.o \
runaway/scene5160.o \
runaway/scene5170.o \
+ runaway/scene6220.o \
+ runaway/scene6350.o \
+ runaway/scene6370.o \
runaway/sequence.o \
runaway/speech.o \
runaway/strings.o \
diff --git a/engines/hollywood/runaway/engine.cpp b/engines/hollywood/runaway/engine.cpp
index 8af1400a0d8..c568a29c831 100644
--- a/engines/hollywood/runaway/engine.cpp
+++ b/engines/hollywood/runaway/engine.cpp
@@ -163,7 +163,7 @@ Common::Error RunawayEngine::loadGameStream(Common::SeekableReadStream *stream)
RunawayScene *RunawayEngine::createScene(uint16 entryScene) {
if (findRunawayRoom(entryScene) && ((_museum && entryScene >= 4000) ||
- (_game == kRunawayFullGame && (entryScene / 1000 == 2 || entryScene / 1000 == 4 || entryScene / 1000 == 5))))
+ (_game == kRunawayFullGame && (entryScene / 1000 == 2 || entryScene / 1000 == 4 || entryScene / 1000 == 5 || entryScene / 1000 == 6))))
return new RunawayRoomScene(_audio, *_inventory, _strings, _game);
if ((_game == kRunawayCabinDemo && entryScene == 5030) ||
(_game == kRunawayFullGame && entryScene >= 5030 && entryScene <= 5032))
@@ -302,7 +302,7 @@ Common::Error RunawayEngine::playIntro(RunawayMenu &menu, byte chapter) {
}
Common::Error RunawayEngine::startChapter(RunawayMenu &menu, byte chapter) {
- const uint16 entry = chapter == 2 ? 4010 : 5030;
+ const uint16 entry = chapter == 2 ? 4010 : chapter == 4 ? 6350 : 5030;
Common::ScopedPtr<RunawayScene> scene(createScene(entry));
if (!scene || !scene->load(entry) || !_ui->loadChapter(chapter))
return Common::Error(Common::kReadingFailed, "Cannot load Runaway chapter resources");
@@ -334,6 +334,8 @@ Common::Error RunawayEngine::run() {
const int scene = ConfMan.getInt("boot_param");
if (scene == 4000)
_state.scene = 4010;
+ else if (scene == 6000)
+ _state.scene = 6350;
else if (scene == 5030 || findRunawayRoom(scene))
_state.scene = scene;
}
@@ -364,8 +366,8 @@ Common::Error RunawayEngine::run() {
const Common::Error result = playIntro(menu);
if (result.getCode() != Common::kNoError || shouldQuit())
return result;
- } else if (_game == kRunawayFullGame && _state.scene == 4010) {
- const Common::Error result = playIntro(menu, 2);
+ } else if (_game == kRunawayFullGame && (_state.scene == 4010 || _state.scene == 6350)) {
+ const Common::Error result = playIntro(menu, _state.chapter());
if (result.getCode() != Common::kNoError || shouldQuit())
return result;
}
@@ -507,7 +509,7 @@ Common::Error RunawayEngine::run() {
}
if (_scene->escaped()) {
if (_game == kRunawayFullGame) {
- if (_state.chapter() >= 3)
+ if (_state.chapter() >= 4)
return Common::kNoError;
const Common::Error result = startChapter(menu, _state.chapter() + 1);
if (result.getCode() != Common::kNoError || shouldQuit())
diff --git a/engines/hollywood/runaway/graphics.cpp b/engines/hollywood/runaway/graphics.cpp
index 0a21784315d..cd438667c5b 100644
--- a/engines/hollywood/runaway/graphics.cpp
+++ b/engines/hollywood/runaway/graphics.cpp
@@ -401,7 +401,8 @@ void RunawayActor::draw(Graphics::ManagedSurface &surface, const RenderParams &p
if (params.roomWidth <= 0 || mask.size() % params.roomWidth || maps.size() != 1536)
return;
const int roomHeight = mask.size() / params.roomWidth;
- const int scale = CLIP<int>((int)(params.height * 256 / 455), 64, 256);
+ // Douglasville's distant street positions shrink Brian below quarter size.
+ const int scale = CLIP<int>((int)(params.height * 256 / 455), 1, 256);
const int roomTop = kRunawayViewportTop - params.camera.y;
const int originX = params.position.x - params.camera.x - _anchorX * scale / 256;
const int originY = params.position.y + roomTop - _anchorY * scale / 256;
diff --git a/engines/hollywood/runaway/graphics.h b/engines/hollywood/runaway/graphics.h
index da9f470c4ed..4742c94653f 100644
--- a/engines/hollywood/runaway/graphics.h
+++ b/engines/hollywood/runaway/graphics.h
@@ -77,7 +77,7 @@ public:
int roomWidth = 0;
float height = 455;
// A depth layer hides the actor until his feet pass its Y threshold.
- int16 depthY[7] = {0, 32767, 32767, 32767, 32767, 32767, 32767};
+ int16 depthY[10] = {0, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767};
byte light[3] = {100, 100, 100};
bool antialias = true;
};
diff --git a/engines/hollywood/runaway/inventory.cpp b/engines/hollywood/runaway/inventory.cpp
index 4787c1f73e3..ca67b23e7e8 100644
--- a/engines/hollywood/runaway/inventory.cpp
+++ b/engines/hollywood/runaway/inventory.cpp
@@ -40,6 +40,10 @@ const char *const kHospitalItemNames[] = {
"Pillows", "Syringe", "Blank medical chart", "Head", "Flammable spray can", "Vademecum"
};
+const char *const kTownItemNames[] = {
+ "", "Wallet", "Car keys", "Receipt", "Piece of amber", "Crucifix"
+};
+
const byte kItemCursors[] = {
0, 41, 43, 45, 47, 49, 51, 55, 57, 59, 61, 63, 65, 67, 69,
75, 79, 81, 83, 85, 87, 91, 93, 95, 103, 105, 111
@@ -98,6 +102,10 @@ void RunawayInventory::startChapter(byte chapter) {
for (uint i = 0; i < ARRAYSIZE(initial); ++i)
add(initial[i]);
}
+ if (chapter == 4) {
+ for (uint i = 1; i < ARRAYSIZE(kTownItemNames); ++i)
+ add(i);
+ }
_newItem = 0;
}
@@ -131,6 +139,8 @@ void RunawayInventory::remove(byte item) {
}
Common::U32String RunawayInventory::name(byte item) const {
+ if (_chapter == 4)
+ return item < ARRAYSIZE(kTownItemNames) ? Common::U32String(kTownItemNames[item]) : Common::U32String();
if (_chapter == 1) {
if (item == 11 && _markerInk == 1)
return Common::U32String("Dry marker pen");
@@ -216,6 +226,8 @@ uint RunawayInventory::icon(byte item) const {
}
uint RunawayInventory::cursor(byte item) const {
+ if (_chapter == 4)
+ return item && item < ARRAYSIZE(kTownItemNames) ? 39 + item * 2 : 0;
if (_chapter == 1) {
if (item == 15 && _syringeFilled)
return 77;
@@ -252,6 +264,10 @@ uint RunawayInventory::cursor(byte item) const {
}
RunawayInventory::Reply RunawayInventory::examine(byte item) const {
+ if (_chapter == 4) {
+ const uint16 cues[] = {1, 50, 51, 74, 53, 200};
+ return Reply(item < ARRAYSIZE(cues) ? cues[item] : 1);
+ }
if (_chapter == 1) {
if (item == 11)
return Reply(60, _markerInk >= 2 ? 2 : _markerInk);
diff --git a/engines/hollywood/runaway/saveload.cpp b/engines/hollywood/runaway/saveload.cpp
index 63cc9ab6204..d11ce9ca798 100644
--- a/engines/hollywood/runaway/saveload.cpp
+++ b/engines/hollywood/runaway/saveload.cpp
@@ -202,6 +202,11 @@ void RunawaySaveState::sync(Common::Serializer &s) {
s.syncAsByte(desertItems.gunReady, 7);
s.syncAsByte(desertItems.bombReady, 7);
s.syncAsByte(desertItems.helicopterReady, 7);
+ s.syncAsByte(town.arrived, 8);
+ s.syncAsByte(town.streetVisited, 8);
+ s.syncAsByte(town.strapSeen, 8);
+ s.syncAsByte(town.sushiMet, 8);
+ s.syncAsByte(town.mineMapKnown, 8);
}
byte RunawaySaveState::chapter() const {
@@ -226,7 +231,7 @@ bool RunawaySaveState::valid() const {
if ((game == kRunawayCabinDemo || (game == kRunawayFullGame && scene >= 5030 && scene <= 5032)) &&
(scene < 5030 || scene > (game == kRunawayCabinDemo ? 5030 : 5032) || x >= 1376 || y >= 600 || camera > 352 || cameraY))
return false;
- if (game == kRunawayFullGame && chapter() == 3 && (scene < 5030 || scene > 5032)) {
+ if (game == kRunawayFullGame && ((chapter() == 3 && (scene < 5030 || scene > 5032)) || chapter() == 4)) {
const RunawayRoom *room = findRunawayRoom(scene);
if (!room || x >= room->width || y >= room->height || camera > room->width - 1024 || cameraY > room->height - 600)
return false;
@@ -303,6 +308,8 @@ bool RunawaySaveState::valid() const {
return false;
}
bool owned[27] = {};
+ if (town.arrived > 1 || town.streetVisited > 1 || town.strapSeen > 1 || town.sushiMet > 1 || town.mineMapKnown > 1)
+ return false;
for (uint i = 0; i < itemCount; ++i) {
if (!items[i] || items[i] >= sizeof(owned) || owned[items[i]] ||
(chapter() != 3 && items[i] > 19))
@@ -317,7 +324,7 @@ bool RunawaySaveState::read(Common::SeekableReadStream &stream) {
if (stream.readUint32BE() != MKTAG('R', 'U', 'N', 'A'))
return false;
const uint16 version = stream.readUint16LE();
- if (version < 1 || version > 7)
+ if (version < 1 || version > 8)
return false;
Common::Serializer s(&stream, nullptr);
s.setVersion(version);
@@ -329,9 +336,9 @@ bool RunawaySaveState::write(Common::WriteStream &stream) {
if (!valid())
return false;
stream.writeUint32BE(MKTAG('R', 'U', 'N', 'A'));
- stream.writeUint16LE(7);
+ stream.writeUint16LE(8);
Common::Serializer s(nullptr, &stream);
- s.setVersion(7);
+ s.setVersion(8);
sync(s);
return !s.err();
}
diff --git a/engines/hollywood/runaway/saveload.h b/engines/hollywood/runaway/saveload.h
index ac545794a79..1adb931dd67 100644
--- a/engines/hollywood/runaway/saveload.h
+++ b/engines/hollywood/runaway/saveload.h
@@ -84,6 +84,11 @@ struct RunawaySaveState {
byte gunReady = 0, bombReady = 0, helicopterReady = 0;
} desertItems;
+ struct Town {
+ byte arrived = 0, streetVisited = 0, strapSeen = 0;
+ byte sushiMet = 0, mineMapKnown = 0;
+ } town;
+
uint16 scene = 5030, x = 623, y = 447, camera = 111;
byte facing = 3, lidOpen = 0, unplugged = 0, windowClean = 0;
byte coolerMoved = 0, coolerInspected = 0, peeked = 0, ice = 0, hatch = 0;
diff --git a/engines/hollywood/runaway/scene.cpp b/engines/hollywood/runaway/scene.cpp
index 164229bc52a..e78cb759857 100644
--- a/engines/hollywood/runaway/scene.cpp
+++ b/engines/hollywood/runaway/scene.cpp
@@ -38,7 +38,8 @@ const RunawayRoom *const kRooms[] = {
&kRunawayScene4030, &kRunawayScene4050, &kRunawayScene4060, &kRunawayScene4070, &kRunawayScene4090, &kRunawayScene4100, &kRunawayScene4140,
&kRunawayScene5010, &kRunawayScene5020, &kRunawayScene5050, &kRunawayScene5060, &kRunawayScene5070,
&kRunawayScene5080, &kRunawayScene5100, &kRunawayScene5110, &kRunawayScene5130, &kRunawayScene5140,
- &kRunawayScene5160, &kRunawayScene5170
+ &kRunawayScene5160, &kRunawayScene5170,
+ &kRunawayScene6220, &kRunawayScene6350, &kRunawayScene6370
};
const RunawayResponse kGlobalResponses[] = {
@@ -76,6 +77,8 @@ const RunawayRoom *findRoom(int number) {
else if (number == 5021 || number == 5022 || number == 5061 || number == 5062 ||
number == 5081 || number == 5101 || number == 5171)
number -= number % 10;
+ else if (number >= 6221 && number <= 6225)
+ number = 6220;
for (uint i = 0; i < ARRAYSIZE(kRooms); ++i) {
if (kRooms[i]->number == number)
return kRooms[i];
@@ -113,6 +116,12 @@ bool RunawayRoomScene::load(uint16 entryScene) {
void RunawayRoomScene::start(uint32 now) {
_now = _lastUpdate = now;
_idleHead.reset(now);
+ if (townChapter()) {
+ _inventory.startChapter(4);
+ _entering = true;
+ resumeTown();
+ return;
+ }
if (desertChapter()) {
startDesert();
return;
@@ -134,6 +143,10 @@ void RunawayRoomScene::start(uint32 now) {
}
void RunawayRoomScene::resume() {
+ if (townChapter()) {
+ resumeTown();
+ return;
+ }
if (desertChapter()) {
resumeDesert();
return;
@@ -193,6 +206,7 @@ void RunawayRoomScene::captureState(RunawaySaveState &state) const {
state.hospital = _hospital;
state.museum = _museum;
state.desert = _desert;
+ state.town = _town;
state.randomSeed = _random.getSeed();
}
@@ -202,6 +216,7 @@ bool RunawayRoomScene::restoreState(const RunawaySaveState &state, uint32 now, b
_hospital = state.hospital;
_museum = state.museum;
_desert = state.desert;
+ _town = state.town;
_entering = entering;
_upperFloor = state.upperFloor;
_books = (ObjectState)state.books;
@@ -243,7 +258,8 @@ bool RunawayRoomScene::enterRoom(uint16 number, Common::Point position, byte fac
} else if (!loadRunawayMask(_archive, room->width, room->height, _mask, _originalMaps)) {
return false;
}
- if (_game == kRunawayFullGame ? !_actor.loadChapter(number < 4000 ? 1 : number < 5000 ? 2 : 3, number != kMuseumHall) :
+ if (_game == kRunawayFullGame ? !_actor.loadChapter(number < 4000 ? 1 : number < 5000 ? 2 : number < 6000 ? 3 : 4,
+ number != kMuseumHall && number != 6350 && number != 6370) :
!_actor.load(number == kMuseumHall ? RunawayActor::kMuseumHall : RunawayActor::kMuseumInterior))
return false;
_room = number;
@@ -292,6 +308,12 @@ bool RunawayRoomScene::enterRoom(uint16 number, Common::Point position, byte fac
case kMuseumKeypad:
loaded = loadScene4140();
break;
+ case 6220:
+ loaded = _npc.load(_archive, 7, 170) && _npcMouth.load(_archive, 8, 45) && _machine.load(_archive, 9, 60);
+ break;
+ case 6370:
+ loaded = _npc.load(_archive, 4, 88) && _ambient.load(_archive, 5, 20);
+ break;
default:
break;
}
@@ -351,6 +373,8 @@ bool RunawayRoomScene::rebuildBackground() {
return applyBackground4090();
case kMuseumSecurity:
return applyBackground4100();
+ case 6350:
+ return !_town.arrived || (applyPatch(5) && applyPatch(7));
default:
return true;
}
@@ -358,6 +382,22 @@ bool RunawayRoomScene::rebuildBackground() {
void RunawayRoomScene::updateMaps() {
_maps = _originalMaps;
+ if (_room == 6220) {
+ for (uint i = 0; i < 256; ++i) {
+ // The balcony shares this mask but is reached through Kevin's room.
+ if (_maps[i] < 2 || _maps[i] > 4)
+ _maps[i] = 0;
+ }
+ return;
+ }
+ if (_room == 6350) {
+ for (uint i = 0; i < 256; ++i) {
+ // The route to the Hopi village has not been discovered yet.
+ if (_maps[256 + i] == 5)
+ _maps[256 + i] = 0;
+ }
+ return;
+ }
if (desertChapter()) {
updateDesertMaps();
return;
@@ -410,6 +450,10 @@ byte RunawayRoomScene::hotspotAt(Common::Point mouse) const {
Common::U32String RunawayRoomScene::hotspotName(byte id) const {
if (desertChapter())
return desertHotspotName(id);
+ if (_room == 6350 && id == 2 && _town.arrived)
+ return Common::U32String("Douglasville");
+ if (_room == 6220 && id == 8 && _town.strapSeen)
+ return Common::U32String("Strap");
const RunawayHotspot *spot = hotspot(id);
if (!spot)
return Common::U32String();
@@ -491,6 +535,8 @@ void RunawayRoomScene::click(Common::Point mouse, RunawayVerb verb, byte item) {
_pendingHotspot = id;
_pendingAction = spot->action[index];
bool approach = spot->approach[index] != 0;
+ if (_room == 6220 && id == 8 && index && _town.strapSeen)
+ approach = true;
if (_room == kHospitalBathroom && id == 4 && !index && _hospital.alcohol == 2)
approach = false;
if (item) {
@@ -517,7 +563,7 @@ void RunawayRoomScene::click(Common::Point mouse, RunawayVerb verb, byte item) {
arrive();
}
} else {
- if (_room != 5010)
+ if (_room != 5010 && _room != 6350)
walkTo(Common::Point(mouse.x + _camera.x, mouse.y - kRunawayViewportTop + _camera.y));
}
}
@@ -556,7 +602,7 @@ void RunawayRoomScene::sayInventory(const RunawayInventory::Reply &reply) {
_walkPath.clear();
_pendingHotspot = 0;
_caption.clear();
- if (_game == kRunawayFullGame && !desertChapter() &&
+ if (_game == kRunawayFullGame && !desertChapter() && !townChapter() &&
(museumChapter() ? sayMuseumInventory(reply) : sayHospitalInventory(reply)))
return;
say(reply.cue, reply.variation, true);
@@ -618,6 +664,15 @@ void RunawayRoomScene::execute(uint16 action) {
case kMuseumSecurity:
result = execute4100(action);
break;
+ case 6220:
+ result = execute6220(action);
+ break;
+ case 6350:
+ result = execute6350(action);
+ break;
+ case 6370:
+ result = execute6370(action);
+ break;
default:
break;
}
@@ -696,6 +751,10 @@ float RunawayRoomScene::actorHeight() const {
return actorHeight4090();
case kMuseumSecurity:
return actorHeight4100();
+ case 6220:
+ return _position.y * 0.194835678f - 11.706573f;
+ case 6370:
+ return _position.y * 0.634920657f - 221.190475f;
default:
return 455;
}
@@ -708,7 +767,9 @@ void RunawayRoomScene::update(uint32 now, int scrollDirection, bool inventoryOpe
if (_sequence.active()) {
_sequence.update(now);
if (!_sequence.active()) {
- if (museumChapter())
+ if (townChapter())
+ finishTownFilm();
+ else if (museumChapter())
finishMuseumFilm();
else if (_room == 5140)
updateScene5140();
@@ -727,7 +788,11 @@ void RunawayRoomScene::update(uint32 now, int scrollDirection, bool inventoryOpe
update2020();
else if (_room == kHospitalBathroom)
update2080();
- if (desertChapter()) {
+ if (townChapter()) {
+ updateTown();
+ if (_sequence.active() || _transition.scene)
+ return;
+ } else if (desertChapter()) {
updateDesert(elapsed, inventoryOpen);
if (_sequence.active() || _transition.scene)
return;
@@ -750,7 +815,7 @@ void RunawayRoomScene::update(uint32 now, int scrollDirection, bool inventoryOpe
_actor.setFrame(_facing, 0, speaking() && !speaker() ? speechFrame() : -1);
return;
}
- if (inventoryOpen || _room == kMuseumKeypad || _room == 5010 || _room == 5140)
+ if (inventoryOpen || _room == kMuseumKeypad || _room == 5010 || _room == 5140 || _room == 6350)
return;
if (_walkPath.active() && !speaking()) {
_walkPath.advance(elapsed * 0.18f * actorHeight() / 455, _position, _facing);
@@ -796,6 +861,8 @@ void RunawayRoomScene::draw() {
drawScene5140(viewport);
return;
}
+ if (_room == 6350)
+ return;
if (_room == 5010) {
drawDesertRoom(viewport, false);
return;
@@ -804,7 +871,11 @@ void RunawayRoomScene::draw() {
drawScene4140(viewport);
return;
}
- if (desertChapter()) {
+ if (_room == 6220) {
+ drawScene6220(viewport);
+ } else if (_room == 6370) {
+ drawScene6370(viewport);
+ } else if (desertChapter()) {
drawDesertRoom(viewport, false);
} else if (_room == kMuseumWilly) {
drawScene4070(viewport);
@@ -822,7 +893,9 @@ void RunawayRoomScene::draw() {
_overlay.draw(viewport, 0, _camera.x, -_camera.y);
}
RunawayActor::RenderParams params;
- memset(params.depthY, 0, sizeof(params.depthY));
+ // Earlier rooms use six depth layers; Douglasville also uses layers 7..9.
+ for (uint i = 0; i < 7; ++i)
+ params.depthY[i] = 0;
if (desertChapter())
setupDesertDepth(params);
switch (_room) {
@@ -835,6 +908,25 @@ void RunawayRoomScene::draw() {
case kMuseumSecurity:
setupDepth4100(params);
break;
+ case 6220:
+ params.depthY[1] = 263;
+ params.depthY[2] = 195;
+ params.depthY[3] = 490;
+ params.depthY[4] = 396;
+ params.depthY[5] = 227;
+ params.depthY[6] = 247;
+ params.depthY[7] = 599;
+ params.depthY[8] = 322;
+ params.depthY[9] = 599;
+ break;
+ case 6370:
+ params.depthY[1] = 800;
+ params.depthY[2] = 646;
+ params.depthY[3] = 400;
+ params.depthY[4] = 800;
+ params.depthY[5] = 645;
+ params.depthY[6] = 684;
+ break;
default:
break;
}
@@ -846,7 +938,8 @@ void RunawayRoomScene::draw() {
const byte light = MIN<byte>(9, _maps[768 + _mask[_position.y * _background.w + _position.x]]);
memcpy(params.light, findRoom(_room)->light[light], sizeof(params.light));
const bool roomAnimation = drawingRoomAnimation();
- if ((!roomAnimation || !_actionHidesActor) && (_room != kHospitalBathroom || (_roomAction != 302 && _roomAction != 307)))
+ if ((!roomAnimation || !_actionHidesActor) && _townEncounter.phase == TownEncounter::kInactive &&
+ (_room != kHospitalBathroom || (_roomAction != 302 && _roomAction != 307)))
_actor.draw(_screen, params, _mask, _maps);
if (roomAnimation) {
_actionAnimation.draw(viewport, _actionFrames[MIN<uint>(_actionStep, _actionFrames.size() - 1)], _camera.x, -_camera.y);
@@ -934,7 +1027,9 @@ void RunawayRoomScene::updateRoomAnimation() {
const uint16 action = _roomAction;
_roomAction = 0;
_actionFrames.clear();
- if (desertChapter())
+ if (townChapter())
+ execute(action + 1000);
+ else if (desertChapter())
finishDesertAnimation(action);
else if (museumChapter())
finishMuseumAnimation(action);
@@ -950,6 +1045,11 @@ void RunawayRoomScene::updateRoomAnimation() {
museumAnimationFrame();
continue;
}
+ if (townChapter()) {
+ if (_room == 6370 && _roomAction == 401 && _actionStep == 24)
+ _audio.playEffect(12);
+ continue;
+ }
if ((_roomAction == 335 && _actionStep == 15) || (_roomAction == 339 && _actionStep == 47))
_audio.playEffect(46);
if (_roomAction == 339 && _actionStep == 16)
diff --git a/engines/hollywood/runaway/scene.h b/engines/hollywood/runaway/scene.h
index 0172a606d0e..596ca521982 100644
--- a/engines/hollywood/runaway/scene.h
+++ b/engines/hollywood/runaway/scene.h
@@ -288,6 +288,24 @@ private:
void startCarlaConversation();
ActionResult execute5170(uint16 action);
+ bool townChapter() const { return _game == kRunawayFullGame && _room / 1000 == 6; }
+ void resumeTown();
+ void updateTown();
+ void leaveTownRoom(uint16 scene);
+ void deferTownAction(uint16 action);
+ void startTownFilm(byte film);
+ void finishTownFilm();
+ ActionResult execute6350(uint16 action);
+ ActionResult execute6220(uint16 action);
+ void start6220();
+ void update6220();
+ void drawScene6220(Graphics::ManagedSurface &viewport);
+ void start6370();
+ ActionResult execute6370(uint16 action);
+ void drawScene6370(Graphics::ManagedSurface &viewport);
+ void startSushiConversation(bool introduction);
+ void sushiDialogueChoice(byte effect);
+
RunawayAudio &_audio;
RunawaySequence _sequence;
RunawayInventory &_inventory;
@@ -332,6 +350,14 @@ private:
RunawaySaveState::Hospital _hospital;
RunawaySaveState::Museum _museum;
RunawaySaveState::Desert _desert;
+ RunawaySaveState::Town _town;
+ byte _townFilm = 0;
+ struct TownEncounter {
+ enum Phase { kInactive, kRifle, kConversation, kDeparture };
+ Phase phase = kInactive;
+ uint32 tick = 0;
+ uint frame = 0;
+ } _townEncounter;
Common::Array<RunawayHotspot> _desertHotspots;
RunawayAnimation _desertAnimations[6];
byte _hangarShot = 0, _hangarShotCount = 0, _hangarShotFrame = 88;
diff --git a/engines/hollywood/runaway/scene2010.cpp b/engines/hollywood/runaway/scene2010.cpp
index fd04acdc170..95171918a44 100644
--- a/engines/hollywood/runaway/scene2010.cpp
+++ b/engines/hollywood/runaway/scene2010.cpp
@@ -220,11 +220,20 @@ void RunawayOpening::enter(Step step, uint32 now) {
_chapter == 3 && _chapterVariation == 2 ? 50 : 20;
_headBank = _chapter == 2 && _chapterVariation ? 4 : _chapter == 3 && !_chapterVariation ? 5 :
_chapter == 3 && _chapterVariation == 2 ? 2 : 1;
+ if (_chapter == 4) {
+ const byte poses[] = {109, 20, 177, 20};
+ const byte heads[] = {3, 1, 5, 1};
+ _bodyFrame = poses[_chapterVariation];
+ _headBank = heads[_chapterVariation];
+ }
speak(_chapter, _chapterVariation);
break;
case kChapterGesture:
_headBank = 0;
- if (_chapter == 2) {
+ if (_chapter == 4) {
+ _firstFrame = _chapterVariation == 1 ? 110 : _chapterVariation == 2 ? 161 : 177;
+ _lastFrame = _chapterVariation == 1 ? 127 : _chapterVariation == 2 ? 177 : 161;
+ } else if (_chapter == 2) {
_firstFrame = 128;
_lastFrame = 160;
} else if (_chapterVariation == 1) {
@@ -250,7 +259,7 @@ void RunawayOpening::enter(Step step, uint32 now) {
void RunawayOpening::advance() {
if (_step == kChapter) {
- const uint variations = _chapter == 2 ? 2 : _chapter == 3 ? 5 : 1;
+ const uint variations = _chapter == 2 ? 2 : _chapter == 3 ? 5 : _chapter == 4 ? 4 : 1;
if (++_chapterVariation < variations)
enter(_chapterVariation < 4 ? kChapterGesture : kChapter, _now);
else
@@ -551,7 +560,7 @@ void RunawayOpening::draw(Graphics::ManagedSurface &screen) {
const uint elapsed = _now - _started;
if ((_step == kSitDown || _step == kCity || (_step == kChapter && !_chapterVariation)) && elapsed < 500)
dimRunawayViewport(screen, elapsed * 2);
- else if ((_step == kLastNarration || (_step == kChapter && _chapterVariation + 1 == (_chapter == 2 ? 2 : _chapter == 3 ? 5 : 1))) && _events)
+ else if ((_step == kLastNarration || (_step == kChapter && _chapterVariation + 1 == (_chapter == 2 ? 2 : _chapter == 3 ? 5 : _chapter == 4 ? 4 : 1))) && _events)
dimRunawayViewport(screen, MIN<uint>(500, _deadline - _now) * 2);
else if (_step == kCityExit && elapsed > 3280)
dimRunawayViewport(screen, (3780 - MIN<uint>(3780, elapsed)) * 2);
diff --git a/engines/hollywood/runaway/scene4070.cpp b/engines/hollywood/runaway/scene4070.cpp
index 67002307d4b..e6014456dc0 100644
--- a/engines/hollywood/runaway/scene4070.cpp
+++ b/engines/hollywood/runaway/scene4070.cpp
@@ -249,6 +249,8 @@ void RunawayRoomScene::chooseDialogue(uint choice) {
_museum.batteryRequested = 1;
if (_conversation == 4 && entry.disable == 2)
_desert.ventSeen = 1;
+ if (_conversation == 5)
+ sushiDialogueChoice(entry.disable);
if (_conversation == 2 && entry.disable == 10) {
_dialogue[10][3].player = 22;
_dialogue[10][3].response = 21;
@@ -297,7 +299,10 @@ void RunawayRoomScene::finishConversation() {
_choices.clear();
_choiceIndices.clear();
if (_afterConversation) {
- deferMuseumAction(_afterConversation);
+ if (character == 5)
+ deferTownAction(_afterConversation);
+ else
+ deferMuseumAction(_afterConversation);
_afterConversation = 0;
} else if (character == 2) {
deferMuseumAction(409);
diff --git a/engines/hollywood/runaway/scene6220.cpp b/engines/hollywood/runaway/scene6220.cpp
new file mode 100644
index 00000000000..2c77dfc4f8f
--- /dev/null
+++ b/engines/hollywood/runaway/scene6220.cpp
@@ -0,0 +1,191 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+
+
+#include "common/util.h"
+#include "hollywood/runaway/scene.h"
+
+namespace Hollywood {
+namespace {
+
+const RunawayHotspot kHotspots[] = {
+ {"", 0, 0, 0, {0, 0}, {0, 0}},
+ {"Path", 188, 599, 5, {301, 302}, {0, 3}},
+ {"Saloon", 778, 512, 3, {303, 304}, {0, 1}},
+ {"Hotel", 125, 441, 7, {305, 306}, {0, 1}},
+ {"Sheriff's office", 388, 284, 7, {307, 308}, {0, 1}},
+ {"Liquor store", 574, 242, 7, {309, 310}, {0, 1}},
+ {"Bank", 647, 198, 0, {311, 312}, {0, 3}},
+ {"Locomotive", 722, 192, 0, {313, 314}, {0, 1}},
+ {"Wagon", 293, 350, 7, {315, 316}, {1, 0}},
+ {"North side of town", 722, 192, 0, {318, 319}, {0, 3}}
+};
+
+const RunawayResponse kResponses[] = {
+ {6220, 301, 1, 0}, // Look at the railroad tracks.
+ {6220, 303, 2, 0}, // Look at the saloon.
+ {6220, 305, 3, 0}, // Look at the hotel.
+ {6220, 307, 4, 0}, // Look at the sheriff's office.
+ {6220, 309, 5, 0}, // Look at the liquor store.
+ {6220, 310, 6, 0}, // Try the boarded-up liquor store.
+ {6220, 311, 7, 0}, // Look at the bank.
+ {6220, 313, 8, 0}, // Look at the locomotive.
+ {6220, 318, 1, 1} // Look toward the cemetery.
+};
+
+} // End of anonymous namespace
+
+const RunawayRoom kRunawayScene6220 = {
+ 6220, 1024, 600, kHotspots, ARRAYSIZE(kHotspots),
+ {{100, 100, 100}, {95, 90, 70}, {75, 70, 50}, {55, 50, 30}},
+ Common::Point(188, 599),
+ kResponses, ARRAYSIZE(kResponses), nullptr, 0, nullptr, 0
+};
+
+void RunawayRoomScene::start6220() {
+ struct Entry {
+ int16 x, y, targetX, targetY;
+ byte facing;
+ };
+ static const Entry entries[] = {
+ {188, 599, 275, 530, 1}, // Arrive from the map.
+ {778, 512, 686, 474, 7}, // Leave the saloon.
+ {147, 460, 209, 527, 3}, // Leave Sushi's hotel.
+ {420, 297, 470, 330, 3}, // Leave the sheriff's office.
+ {647, 197, 652, 209, 3}, // Leave the bank.
+ {718, 194, 718, 194, 5} // Leave the locomotive.
+ };
+ const Entry &entry = entries[_entryScene - 6220];
+ _position = Common::Point(entry.x, entry.y);
+ _walkPath.reset(_position);
+ walkTo(Common::Point(entry.targetX, entry.targetY), entry.facing, true);
+ if (!_town.streetVisited) {
+ deferTownAction(400);
+ }
+}
+
+RunawayRoomScene::ActionResult RunawayRoomScene::execute6220(uint16 action) {
+ switch (action) {
+ case 302: // Leave town by the railroad tracks.
+ case 319: // Leave town toward the cemetery.
+ leaveTownRoom(6350);
+ break;
+ case 304: // Enter the saloon.
+ leaveTownRoom(6180);
+ break;
+ case 306: // Visit Sushi in the hotel.
+ leaveTownRoom(6370);
+ break;
+ case 308: // Enter the sheriff's office.
+ leaveTownRoom(6200);
+ break;
+ case 312: // Enter the ruined bank.
+ leaveTownRoom(6190);
+ break;
+ case 314: // Approach the locomotive.
+ leaveTownRoom(6260);
+ break;
+ case 315: // Examine the wagon and identify its strap.
+ say(9, _town.strapSeen);
+ _town.strapSeen = 1;
+ break;
+ case 316: // Try to take the wagon or its attached strap.
+ say(10, _town.strapSeen ? 0 : 1);
+ break;
+ case 400: // First arrival in Douglasville.
+ say(0);
+ deferTownAction(401);
+ break;
+ case 401: // Sushi fires from the hotel and Brian raises his hands.
+ _townEncounter.phase = TownEncounter::kRifle;
+ _townEncounter.tick = _now;
+ _townEncounter.frame = 0;
+ _roomAction = 401;
+ break;
+ default:
+ return kUnhandled;
+ }
+ return kHandled;
+}
+
+void RunawayRoomScene::update6220() {
+ if (_townEncounter.phase == TownEncounter::kInactive) {
+ return;
+ }
+ const uint previous = _townEncounter.frame;
+ const uint frame = (_now - _townEncounter.tick) / 80;
+ if (_townEncounter.phase == TownEncounter::kRifle) {
+ _townEncounter.frame = MIN<uint>(112, frame);
+ if (previous < 45 && frame >= 45) {
+ _audio.playEffect(11);
+ }
+ if (previous < 79 && frame >= 79) {
+ say(0, 1);
+ }
+ if (frame >= 112 && !speaking()) {
+ _townEncounter.phase = TownEncounter::kConversation;
+ say(0, 2, false, 1);
+ say(0, 3);
+ say(0, 4, false, 1);
+ }
+ } else if (_townEncounter.phase == TownEncounter::kConversation) {
+ if (!speaking()) {
+ _townEncounter.phase = TownEncounter::kDeparture;
+ _townEncounter.tick = _now;
+ _townEncounter.frame = 0;
+ }
+ } else {
+ _townEncounter.frame = MIN<uint>(44, frame);
+ if (frame >= 45) {
+ _townEncounter.phase = TownEncounter::kInactive;
+ _roomAction = 0;
+ _town.streetVisited = 1;
+ walkTo(Common::Point(125, 441), 7, true);
+ leaveTownRoom(6370);
+ }
+ }
+}
+
+void RunawayRoomScene::drawScene6220(Graphics::ManagedSurface &viewport) {
+ if (_townEncounter.phase == TownEncounter::kInactive) {
+ return;
+ }
+ const uint frame = _townEncounter.frame;
+ uint sushi, brian, shot;
+ if (_townEncounter.phase == TownEncounter::kRifle) {
+ sushi = frame;
+ shot = frame < 45 ? 59 : MIN<uint>(59, frame - 45);
+ brian = frame <= 45 ? 0 : MIN<uint>(33, frame - 45);
+ } else if (_townEncounter.phase == TownEncounter::kConversation) {
+ sushi = 113 + (speaker() ? speechFrame() : 0);
+ shot = 59;
+ brian = 33;
+ } else {
+ sushi = 125 + frame;
+ shot = 59;
+ brian = MIN<uint>(44, 33 + frame);
+ }
+ _npc.draw(viewport, sushi, _camera.x, -_camera.y);
+ _machine.draw(viewport, shot, _camera.x, -_camera.y);
+ _npcMouth.draw(viewport, brian, _camera.x, -_camera.y);
+}
+
+} // End of namespace Hollywood
diff --git a/engines/hollywood/runaway/scene6350.cpp b/engines/hollywood/runaway/scene6350.cpp
new file mode 100644
index 00000000000..eebe4b3103b
--- /dev/null
+++ b/engines/hollywood/runaway/scene6350.cpp
@@ -0,0 +1,261 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+
+
+#include "common/file.h"
+#include "common/textconsole.h"
+#include "common/util.h"
+#include "hollywood/runaway/scene.h"
+
+namespace Hollywood {
+namespace {
+
+const RunawayHotspot kHotspots[] = {
+ {"", 0, 0, 0, {0, 0}, {0, 0}},
+ {"Entrance to the mine", 0, 0, 0, {1, 301}, {0, 0}},
+ {"Unknown place", 0, 0, 0, {1, 302}, {0, 0}},
+ {"Unknown place", 0, 0, 0, {1, 303}, {0, 0}},
+ {"Unknown place", 0, 0, 0, {1, 304}, {0, 0}},
+ {"Unknown place", 0, 0, 0, {1, 305}, {0, 0}},
+ {"Locomotive", 0, 0, 0, {1, 306}, {0, 0}}
+};
+
+} // End of anonymous namespace
+
+const RunawayRoom kRunawayScene6350 = {
+ 6350, 1024, 600, kHotspots, ARRAYSIZE(kHotspots), {{100, 100, 100}},
+ Common::Point(512, 500), nullptr, 0, nullptr, 0, nullptr, 0
+};
+
+void RunawayRoomScene::resumeTown() {
+ if (!_entering) {
+ if (!_audio.musicPlaying()) {
+ _audio.playMusic(11);
+ }
+ return;
+ }
+ _entering = false;
+ if (_room == 6350 && !_town.arrived) {
+ startTownFilm(1);
+ return;
+ }
+ _town.arrived = 1;
+ if (!_audio.musicPlaying()) {
+ _audio.playMusic(11);
+ }
+ if (_room == 6220) {
+ start6220();
+ } else if (_room == 6370) {
+ _town.streetVisited = 1;
+ start6370();
+ }
+}
+
+void RunawayRoomScene::updateTown() {
+ if (_townEncounter.phase != TownEncounter::kInactive) {
+ update6220();
+ return;
+ }
+ updateRoomAnimation();
+ updateConversation();
+ if (_roomAction && _actionFrames.empty() && !speaking() && !_walkPath.active()) {
+ const uint16 action = _roomAction;
+ _roomAction = 0;
+ execute(action);
+ }
+ if (_hospitalExit.scene && !speaking() && !_roomAction && !_walkPath.active()) {
+ _transition = _hospitalExit;
+ }
+}
+
+void RunawayRoomScene::deferTownAction(uint16 action) {
+ _roomAction = action;
+ _actionFrames.clear();
+}
+
+void RunawayRoomScene::leaveTownRoom(uint16 scene) {
+ const RunawayRoom *room = findRunawayRoom(scene);
+ if (!room) {
+ warning("Runaway: scene %u is not implemented yet", scene);
+ return;
+ }
+ _hospitalExit.scene = scene;
+ _hospitalExit.position = room->entry;
+ _hospitalExit.facing = 3;
+}
+
+RunawayRoomScene::ActionResult RunawayRoomScene::execute6350(uint16 action) {
+ switch (action) {
+ case 1: // Looking at the overview does not start a speech.
+ break;
+ case 301: // Go to the mine entrance.
+ leaveTownRoom(6080);
+ break;
+ case 302: // Go to Douglasville.
+ leaveTownRoom(6220);
+ break;
+ case 303: // Go to the house.
+ leaveTownRoom(6130);
+ break;
+ case 304: // Go to the crater.
+ leaveTownRoom(6270);
+ break;
+ case 306: // Go to the locomotive.
+ leaveTownRoom(6265);
+ break;
+ default:
+ return kUnhandled;
+ }
+ return kHandled;
+}
+
+void RunawayRoomScene::startTownFilm(byte film) {
+ typedef RunawaySequence S;
+ _townFilm = film;
+ const bool gog = Common::File::exists("DATAVC00.000");
+ _filmCommands.clear();
+ // GOG moved the animated portraits out of the main films, changing the
+ // frame numbers after each conversation. Keep both releases' cue points.
+ if (film == 1) {
+ const S::Command commands[] = {
+ {S::kOpen, 1},
+ {S::kMusic, 26, 178, 1},
+ {S::kEffect, 67, 178},
+ {S::kPlay, 0, 688},
+ {S::kEffect, 68, 178, 0, 1},
+ {S::kTalk, 1, 0}, // The helicopter lands.
+ {S::kTalk, 1, 1},
+ {S::kTalk, 1, 2},
+ {S::kTalk, 1, 3},
+ {S::kTalk, 1, 4},
+ {S::kTalk, 1, 5},
+ {S::kTalk, 1, 6},
+ {S::kTalk, 1, 7},
+ {S::kTalk, 1, 8},
+ {S::kSpeech, 1, 9, 9},
+ {S::kEffect, 69, 178},
+ {S::kPlay, 689, 951},
+ {S::kWaitSpeech},
+ {S::kTalk, 1, 10, 3}, // Brian and Gina plan their next move.
+ {S::kTalk, 1, 11, 1},
+ {S::kTalk, 1, 12, 3},
+ {S::kTalk, 1, 13, 1},
+ {S::kTalk, 1, 14, 3},
+ {S::kTalk, 1, 15, 1},
+ {S::kTalk, 1, 16, 3},
+ {S::kMusic, 28, 255},
+ {S::kEffect, 70, 178},
+ {S::kPlay, (uint16)(gog ? 952 : 975), 975},
+ {S::kSpeech, 1, 24, 24},
+ {S::kPlay, 976, (uint16)(gog ? 1875 : 1899)},
+ {S::kSpeech, 1, 17, 17},
+ {S::kPlay, (uint16)(gog ? 1876 : 1900), (uint16)(gog ? 2108 : 2132)},
+ {S::kSpeech, 1, 18, 19}, // Gina falls through the ground.
+ {S::kPlay, (uint16)(gog ? 2109 : 2133), (uint16)(gog ? 2111 : 2135)},
+ {S::kMusic, 29, 255},
+ {S::kPlay, (uint16)(gog ? 2112 : 2136), (uint16)(gog ? 2150 : 2174)},
+ {S::kSpeech, 1, 20, 20},
+ {S::kPlay, (uint16)(gog ? 2151 : 2175), (uint16)(gog ? 2248 : 2272)},
+ {S::kWaitSpeech},
+ {S::kTalk, 1, 21},
+ {S::kDelay, 500},
+ {S::kTalk, 1, 22},
+ {S::kDelay, 500},
+ {S::kTalk, 1, 23},
+ {S::kEnd}
+ };
+ for (uint i = 0; i < ARRAYSIZE(commands); ++i)
+ _filmCommands.push_back(commands[i]);
+ } else {
+ const S::Command commands[] = {
+ {S::kOpen, 2},
+ {S::kMusic, 25, 255},
+ {S::kEffect, 71, 230},
+ {S::kPlay, 0, 9},
+ {S::kSpeech, 2, 0, 0},
+ {S::kPlay, 10, 1943},
+ {S::kMusic, 27, 255, 1},
+ {S::kSpeech, 2, 1, 1},
+ {S::kPlay, 1944, 2014},
+ {S::kSpeech, 2, 2, 2},
+ {S::kPlay, 2015, 2094},
+ {S::kWaitSpeech},
+ {S::kTalk, 2, 3, 1}, // Find Gina below.
+ {S::kEffect, 72, 230},
+ {S::kPlay, (uint16)(gog ? 2095 : 2108), (uint16)(gog ? 2109 : 2121)},
+ {S::kTalk, 2, 4, 3},
+ {S::kTalk, 2, 5, 3, 1},
+ {S::kTalk, 2, 6, 3},
+ {S::kPlay, (uint16)(gog ? 2110 : 2135), (uint16)(gog ? 2133 : 2158)},
+ {S::kTalk, 2, 7, 7},
+ {S::kStill, (uint16)(gog ? 2134 : 2158)},
+ {S::kTalk, 2, 8, 3},
+ {S::kTalk, 2, 9, 3, 1},
+ {S::kStill, (uint16)(gog ? 2135 : 2158)},
+ {S::kTalk, 2, 10, 5},
+ {S::kTalk, 2, 11, 7},
+ {S::kStill, (uint16)(gog ? 2136 : 2158)},
+ {S::kTalk, 2, 12, 3},
+ {S::kEffect, 73, 255},
+ {S::kPlay, (uint16)(gog ? 2137 : 2240), (uint16)(gog ? 2166 : 2269)},
+ {S::kSpeech, 2, 13, 13},
+ {S::kPlay, (uint16)(gog ? 2167 : 2270), (uint16)(gog ? 2252 : 2354)},
+ {S::kWaitSpeech},
+ {S::kStill, (uint16)(gog ? 2253 : 2354)},
+ {S::kTalk, 2, 14, 7}, // Joshua explains the Hopi key.
+ {S::kTalk, 2, 15, 5},
+ {S::kTalk, 2, 16, 7},
+ {S::kTalk, 2, 17, 5},
+ {S::kTalk, 2, 18, 7},
+ {S::kTalk, 2, 19, 5},
+ {S::kTalk, 2, 20, 7},
+ {S::kEffect, 74, 230},
+ {S::kPlay, (uint16)(gog ? 2254 : 2322), (uint16)(gog ? 2340 : 2409)},
+ {S::kSpeech, 2, 21, 21},
+ {S::kPlay, (uint16)(gog ? 2341 : 2410), (uint16)(gog ? 2488 : 2555)},
+ {S::kWaitSpeech},
+ {S::kTalk, 2, 22, 9},
+ {S::kEffect, 75, 230},
+ {S::kPlay, (uint16)(gog ? 2489 : 2567), (uint16)(gog ? 2555 : 2635)},
+ {S::kEnd}
+ };
+ for (uint i = 0; i < ARRAYSIZE(commands); ++i)
+ _filmCommands.push_back(commands[i]);
+ }
+ _sequence.start(_filmCommands.data(), _text, _now, 'F');
+}
+
+void RunawayRoomScene::finishTownFilm() {
+ if (_townFilm == 1) {
+ startTownFilm(2);
+ return;
+ }
+ _townFilm = 0;
+ _town.arrived = 1;
+ if (!rebuildBackground()) {
+ error("Cannot update Runaway chapter 4 map");
+ }
+ _audio.playMusic(11);
+ say(0);
+ leaveTownRoom(6220);
+}
+
+} // End of namespace Hollywood
diff --git a/engines/hollywood/runaway/scene6370.cpp b/engines/hollywood/runaway/scene6370.cpp
new file mode 100644
index 00000000000..8b026ead955
--- /dev/null
+++ b/engines/hollywood/runaway/scene6370.cpp
@@ -0,0 +1,138 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+
+
+#include "common/util.h"
+#include "hollywood/runaway/scene.h"
+
+namespace Hollywood {
+
+const RunawayRoom kRunawayScene6370 = {
+ 6370, 1444, 800, nullptr, 0,
+ {{100, 100, 100}, {80, 80, 80}, {70, 70, 70}, {50, 50, 50}, {60, 60, 60}, {50, 50, 50}, {40, 40, 40}},
+ Common::Point(1443, 648), nullptr, 0, nullptr, 0, nullptr, 0
+};
+
+void RunawayRoomScene::start6370() {
+ _willyPose = 0;
+ walkTo(Common::Point(1292, 689), 7, true);
+ deferTownAction(401);
+}
+
+RunawayRoomScene::ActionResult RunawayRoomScene::execute6370(uint16 action) {
+ switch (action) {
+ case 401: // Sushi turns away from her computer.
+ beginRoomAnimationRange(401, 4, 88, 0, 63, false);
+ break;
+ case 1401: // Introduce Brian or greet him on a return visit.
+ _willyPose = 63;
+ if (!_town.sushiMet) {
+ say(90, 0, false, 1);
+ say(80, 1);
+ say(90, 1, false, 1);
+ startSushiConversation(true);
+ } else {
+ say(80, 11);
+ say(90, 11, false, 1);
+ say(80, 12);
+ say(90, 12, false, 1);
+ startSushiConversation(false);
+ }
+ break;
+ case 402: // Explain the connection between Douglasville and the Hopi village.
+ for (uint i = 5; i <= 10; ++i) {
+ say(80, i);
+ say(90, i, false, 1);
+ }
+ startSushiConversation(false);
+ break;
+ case 403: // Finish the conversation and return to the street.
+ _town.sushiMet = 1;
+ _audio.playMusic(20);
+ _willyPose = 79;
+ _ambientTick = _now;
+ walkTo(Common::Point(1443, 648), 1, true);
+ leaveTownRoom(6222);
+ break;
+ default:
+ return kUnhandled;
+ }
+ return kHandled;
+}
+
+void RunawayRoomScene::drawScene6370(Graphics::ManagedSurface &viewport) {
+ _ambient.draw(viewport, (_now / 80) % 20, _camera.x, -_camera.y);
+ if (!drawingRoomAnimation()) {
+ uint frame = _willyPose;
+ if (_willyPose == 79) {
+ frame += MIN<uint>(8, (_now - _ambientTick) / 80);
+ } else if (_willyPose == 63 && speaker()) {
+ frame += speechFrame();
+ }
+ _npc.draw(viewport, frame, _camera.x, -_camera.y);
+ }
+}
+
+void RunawayRoomScene::startSushiConversation(bool introduction) {
+ _conversation = 5;
+ _dialogueDepth = _dialogueNode = _dialogueIntro = 0;
+ _dialogueEnding = false;
+ _choices.clear();
+ _choiceIndices.clear();
+ memset(_dialogue, 0, sizeof(_dialogue));
+ _afterConversation = introduction ? 402 : 403;
+ if (introduction) {
+ // Original page 40: Brian chooses how to explain his interest in the Hopi.
+ for (uint i = 0; i < 3; ++i) {
+ _dialogue[0][i] = {1, 0, 0, (byte)(i + 2), (byte)(i + 2), 0, 255};
+ }
+ return;
+ }
+ static const DialogueChoice topics[][8] = {
+ {{0, 0, 1, 13, 13, 1, 255}, {0, 0, 1, 14, 14, 1, 255},
+ {1, 0, 3, 15, 15, 2, 255}, {1, 1, 1, 17, 17, 1, 255},
+ {0, 2, 1, 18, 18, 1, 255}, {0, 3, 1, 19, 19, 10, 255},
+ {1, 0, 0, 20, 20, 0, 0}},
+ {{1, 1, 3, 21, 21, 1, 255}, {1, 1, 3, 22, 22, 3, 255},
+ {1, 1, 3, 23, 23, 1, 255}, {1, 0, 2, 24, 24, 0, 0}},
+ {{1, 0, 2, 25, 25, 1, 255}}
+ };
+ memcpy(_dialogue[0], topics[0], sizeof(topics[0]));
+ memcpy(_dialogue[10], topics[1], sizeof(topics[1]));
+ memcpy(_dialogue[11], topics[2], sizeof(topics[2]));
+ _dialogue[0][0].enabled = !_town.sushiMet;
+ _dialogue[0][1].enabled = _town.sushiMet;
+ // The safe and the prisoner become topics after visiting those rooms.
+}
+
+void RunawayRoomScene::sushiDialogueChoice(byte effect) {
+ if (effect == 2) { // Ask Sushi to repeat Douglasville's history.
+ say(90, 6, false, 1);
+ say(80, 7);
+ say(90, 7, false, 1);
+ say(80, 8);
+ say(90, 8, false, 1);
+ } else if (effect == 3) { // Learn where a map of the mine might be kept.
+ _town.mineMapKnown = 1;
+ }
+}
+
+} // End of namespace Hollywood
diff --git a/engines/hollywood/runaway/scene_data.h b/engines/hollywood/runaway/scene_data.h
index dddcb5d9dc3..f8920e47406 100644
--- a/engines/hollywood/runaway/scene_data.h
+++ b/engines/hollywood/runaway/scene_data.h
@@ -104,6 +104,9 @@ extern const RunawayRoom kRunawayScene5130;
extern const RunawayRoom kRunawayScene5140;
extern const RunawayRoom kRunawayScene5160;
extern const RunawayRoom kRunawayScene5170;
+extern const RunawayRoom kRunawayScene6220;
+extern const RunawayRoom kRunawayScene6350;
+extern const RunawayRoom kRunawayScene6370;
const RunawayRoom *findRunawayRoom(uint16 number);
diff --git a/engines/hollywood/runaway/video.cpp b/engines/hollywood/runaway/video.cpp
index 9d4c83034d8..e4f5cb6c189 100644
--- a/engines/hollywood/runaway/video.cpp
+++ b/engines/hollywood/runaway/video.cpp
@@ -81,6 +81,13 @@ const FilmOverlay kFilmOverlays[] = {
{'E', 2, 3, 24, 12, 590, 240, 641, 296},
{'E', 2, 4, 36, 12, 426, 254, 480, 314},
{'E', 6, 0, 0, 12, 388, 196, 530, 408},
+ {'F', 1, 0, 0, 12, 644, 122, 704, 204},
+ {'F', 1, 1, 12, 12, 516, 104, 566, 170},
+ {'F', 2, 0, 0, 12, 618, 198, 668, 282},
+ {'F', 2, 1, 12, 6, 581, 164, 825, 534},
+ {'F', 2, 2, 18, 6, 329, 74, 406, 177},
+ {'F', 2, 3, 24, 6, 772, 278, 916, 506},
+ {'F', 2, 4, 30, 12, 584, 98, 632, 164},
};
} // End of anonymous namespace
Commit: faf0afe45e7556b1670deee47e51c5e3a172903a
https://github.com/scummvm/scummvm/commit/faf0afe45e7556b1670deee47e51c5e3a172903a
Author: neuromancer (gustavo.grieco at gmail.com)
Date: 2026-11-19T19:38:52+01:00
Commit Message:
HOLLYWOOD: RUNAWAY: implemented scenes 6190, 6200 and 6210
Changed paths:
A engines/hollywood/runaway/scene6190.cpp
A engines/hollywood/runaway/scene6200.cpp
A engines/hollywood/runaway/scene6210.cpp
engines/hollywood/module.mk
engines/hollywood/runaway/inventory.cpp
engines/hollywood/runaway/saveload.cpp
engines/hollywood/runaway/saveload.h
engines/hollywood/runaway/scene.cpp
engines/hollywood/runaway/scene.h
engines/hollywood/runaway/scene6350.cpp
engines/hollywood/runaway/scene6370.cpp
engines/hollywood/runaway/scene_data.h
diff --git a/engines/hollywood/module.mk b/engines/hollywood/module.mk
index c8778dcf3a4..69a76b51cb7 100644
--- a/engines/hollywood/module.mk
+++ b/engines/hollywood/module.mk
@@ -175,6 +175,9 @@ MODULE_OBJS = \
runaway/scene5140.o \
runaway/scene5160.o \
runaway/scene5170.o \
+ runaway/scene6190.o \
+ runaway/scene6200.o \
+ runaway/scene6210.o \
runaway/scene6220.o \
runaway/scene6350.o \
runaway/scene6370.o \
diff --git a/engines/hollywood/runaway/inventory.cpp b/engines/hollywood/runaway/inventory.cpp
index ca67b23e7e8..38d45433fef 100644
--- a/engines/hollywood/runaway/inventory.cpp
+++ b/engines/hollywood/runaway/inventory.cpp
@@ -41,7 +41,12 @@ const char *const kHospitalItemNames[] = {
};
const char *const kTownItemNames[] = {
- "", "Wallet", "Car keys", "Receipt", "Piece of amber", "Crucifix"
+ "", "Wallet", "Car keys", "Receipt", "Piece of amber", "Crucifix", "Doctor's bag",
+ "Stethoscope", "Liniment", "Key", "Wrench", "Strap", "Container of concentrated gasoline",
+ "Telepathic helmet", "Firewood", "Blowtorch", "Watering can", "Map of the mine", "Miner's light",
+ "Rope", "Ancient stapler", "Flower pot", "Pruning shears", "Oil can", "One-liter bottle",
+ "Empty 30 c.c. measuring tube", "Empty 50 c.c. measuring tube", "Tobacco leaves", "Chewing tobacco",
+ "Stone", "Sanding block", "Vessel", "Bank stamp"
};
const byte kItemCursors[] = {
@@ -103,8 +108,9 @@ void RunawayInventory::startChapter(byte chapter) {
add(initial[i]);
}
if (chapter == 4) {
- for (uint i = 1; i < ARRAYSIZE(kTownItemNames); ++i)
+ for (uint i = 1; i <= 5; ++i) {
add(i);
+ }
}
_newItem = 0;
}
@@ -118,7 +124,8 @@ bool RunawayInventory::contains(byte item) const {
}
bool RunawayInventory::add(byte item) {
- if (!item || item > kItemCount || (_chapter != 3 && item > 19) || contains(item))
+ const uint maxItem = _chapter == 4 ? ARRAYSIZE(kTownItemNames) - 1 : _chapter == 3 ? kItemCount : 19;
+ if (!item || item > maxItem || contains(item))
return false;
_items.push_back(item);
_newItem = item;
@@ -266,7 +273,23 @@ uint RunawayInventory::cursor(byte item) const {
RunawayInventory::Reply RunawayInventory::examine(byte item) const {
if (_chapter == 4) {
const uint16 cues[] = {1, 50, 51, 74, 53, 200};
- return Reply(item < ARRAYSIZE(cues) ? cues[item] : 1);
+ if (item < ARRAYSIZE(cues)) {
+ return Reply(cues[item]);
+ }
+ switch (item) {
+ case 7: // Stethoscope.
+ case 8: // Liniment.
+ case 9: // Cell key.
+ return Reply(194 + item);
+ case 14: // Firewood.
+ return Reply(207);
+ case 20: // Ancient stapler.
+ return Reply(212);
+ case 32: // Bank stamp.
+ return Reply(222);
+ default:
+ return Reply();
+ }
}
if (_chapter == 1) {
if (item == 11)
diff --git a/engines/hollywood/runaway/saveload.cpp b/engines/hollywood/runaway/saveload.cpp
index d11ce9ca798..a3f92ae52db 100644
--- a/engines/hollywood/runaway/saveload.cpp
+++ b/engines/hollywood/runaway/saveload.cpp
@@ -41,7 +41,7 @@ void RunawaySaveState::sync(Common::Serializer &s) {
s.syncBytes(pickedUp, sizeof(pickedUp));
s.syncBytes(examined, sizeof(examined));
s.syncAsByte(itemCount);
- s.syncBytes(items, sizeof(items));
+ s.syncBytes(items, 26);
s.syncAsByte(selected);
s.syncAsByte(cloth);
s.syncAsByte(inventoryOpen);
@@ -207,6 +207,24 @@ void RunawaySaveState::sync(Common::Serializer &s) {
s.syncAsByte(town.strapSeen, 8);
s.syncAsByte(town.sushiMet, 8);
s.syncAsByte(town.mineMapKnown, 8);
+ // Preserve the original inventory layout when reading older saves.
+ s.syncBytes(items + 26, sizeof(items) - 26, 9);
+ s.syncAsByte(town.bankVisited, 9);
+ s.syncAsByte(town.bankShelves, 9);
+ s.syncAsByte(town.bankStampTaken, 9);
+ s.syncAsByte(town.basementKnown, 9);
+ s.syncAsByte(town.bodySeen, 9);
+ s.syncAsByte(town.doctorKnown, 9);
+ s.syncAsByte(town.firewoodTaken, 9);
+ s.syncAsByte(town.cellOpen, 9);
+ s.syncAsByte(town.bagSearched, 9);
+ s.syncAsByte(town.bucketSeen, 9);
+ s.syncAsByte(town.bottleSeen, 9);
+ s.syncAsByte(town.cellRefusals, 9);
+ s.syncAsByte(town.safeSeen, 9);
+ s.syncAsByte(town.oscarTobacco, 9);
+ s.syncAsByte(town.stethoscopeTaken, 9);
+ s.syncAsByte(town.linimentTaken, 9);
}
byte RunawaySaveState::chapter() const {
@@ -307,12 +325,18 @@ bool RunawaySaveState::valid() const {
if (pickedUp[i] > 1 || examined[i] > 1)
return false;
}
- bool owned[27] = {};
+ bool owned[33] = {};
if (town.arrived > 1 || town.streetVisited > 1 || town.strapSeen > 1 || town.sushiMet > 1 || town.mineMapKnown > 1)
return false;
+ if (town.bankVisited > 1 || town.bankShelves > 2 || town.bankStampTaken > 1 || town.basementKnown > 1 ||
+ town.bodySeen > 1 || town.doctorKnown > 1 || town.firewoodTaken > 1 || town.cellOpen > 1 ||
+ town.bagSearched > 1 || town.bucketSeen > 1 || town.bottleSeen > 1 || town.cellRefusals > 2 ||
+ town.safeSeen > 1 || town.oscarTobacco > 2 || town.stethoscopeTaken > 1 || town.linimentTaken > 1) {
+ return false;
+ }
for (uint i = 0; i < itemCount; ++i) {
if (!items[i] || items[i] >= sizeof(owned) || owned[items[i]] ||
- (chapter() != 3 && items[i] > 19))
+ items[i] > (chapter() == 4 ? 32 : chapter() == 3 ? 26 : 19))
return false;
owned[items[i]] = true;
}
@@ -324,7 +348,7 @@ bool RunawaySaveState::read(Common::SeekableReadStream &stream) {
if (stream.readUint32BE() != MKTAG('R', 'U', 'N', 'A'))
return false;
const uint16 version = stream.readUint16LE();
- if (version < 1 || version > 8)
+ if (version < 1 || version > 9)
return false;
Common::Serializer s(&stream, nullptr);
s.setVersion(version);
@@ -336,9 +360,9 @@ bool RunawaySaveState::write(Common::WriteStream &stream) {
if (!valid())
return false;
stream.writeUint32BE(MKTAG('R', 'U', 'N', 'A'));
- stream.writeUint16LE(8);
+ stream.writeUint16LE(9);
Common::Serializer s(nullptr, &stream);
- s.setVersion(8);
+ s.setVersion(9);
sync(s);
return !s.err();
}
diff --git a/engines/hollywood/runaway/saveload.h b/engines/hollywood/runaway/saveload.h
index 1adb931dd67..cb2e51dbd2d 100644
--- a/engines/hollywood/runaway/saveload.h
+++ b/engines/hollywood/runaway/saveload.h
@@ -87,13 +87,17 @@ struct RunawaySaveState {
struct Town {
byte arrived = 0, streetVisited = 0, strapSeen = 0;
byte sushiMet = 0, mineMapKnown = 0;
+ byte bankVisited = 0, bankShelves = 0, bankStampTaken = 0, basementKnown = 0;
+ byte bodySeen = 0, doctorKnown = 0, firewoodTaken = 0, cellOpen = 0;
+ byte bagSearched = 0, bucketSeen = 0, bottleSeen = 0, cellRefusals = 0;
+ byte safeSeen = 0, oscarTobacco = 0, stethoscopeTaken = 0, linimentTaken = 0;
} town;
uint16 scene = 5030, x = 623, y = 447, camera = 111;
byte facing = 3, lidOpen = 0, unplugged = 0, windowClean = 0;
byte coolerMoved = 0, coolerInspected = 0, peeked = 0, ice = 0, hatch = 0;
byte pickedUp[20] = {}, examined[20] = {};
- byte itemCount = 0, items[26] = {}, selected = 0, cloth = 0;
+ byte itemCount = 0, items[32] = {}, selected = 0, cloth = 0;
byte inventoryOpen = 0, verb = 0;
uint32 randomSeed = 0, playTime = 0;
byte game = kRunawayCabinDemo;
diff --git a/engines/hollywood/runaway/scene.cpp b/engines/hollywood/runaway/scene.cpp
index e78cb759857..81e7c119a00 100644
--- a/engines/hollywood/runaway/scene.cpp
+++ b/engines/hollywood/runaway/scene.cpp
@@ -39,6 +39,7 @@ const RunawayRoom *const kRooms[] = {
&kRunawayScene5010, &kRunawayScene5020, &kRunawayScene5050, &kRunawayScene5060, &kRunawayScene5070,
&kRunawayScene5080, &kRunawayScene5100, &kRunawayScene5110, &kRunawayScene5130, &kRunawayScene5140,
&kRunawayScene5160, &kRunawayScene5170,
+ &kRunawayScene6190, &kRunawayScene6200, &kRunawayScene6210,
&kRunawayScene6220, &kRunawayScene6350, &kRunawayScene6370
};
@@ -79,6 +80,9 @@ const RunawayRoom *findRoom(int number) {
number -= number % 10;
else if (number >= 6221 && number <= 6225)
number = 6220;
+ else if (number == 6201) {
+ number = 6200;
+ }
for (uint i = 0; i < ARRAYSIZE(kRooms); ++i) {
if (kRooms[i]->number == number)
return kRooms[i];
@@ -259,7 +263,7 @@ bool RunawayRoomScene::enterRoom(uint16 number, Common::Point position, byte fac
return false;
}
if (_game == kRunawayFullGame ? !_actor.loadChapter(number < 4000 ? 1 : number < 5000 ? 2 : number < 6000 ? 3 : 4,
- number != kMuseumHall && number != 6350 && number != 6370) :
+ number != kMuseumHall && number != 6190 && number != 6200 && number != 6350 && number != 6370) :
!_actor.load(number == kMuseumHall ? RunawayActor::kMuseumHall : RunawayActor::kMuseumInterior))
return false;
_room = number;
@@ -308,6 +312,9 @@ bool RunawayRoomScene::enterRoom(uint16 number, Common::Point position, byte fac
case kMuseumKeypad:
loaded = loadScene4140();
break;
+ case 6200:
+ loaded = _ambient.load(_archive, 6, 26);
+ break;
case 6220:
loaded = _npc.load(_archive, 7, 170) && _npcMouth.load(_archive, 8, 45) && _machine.load(_archive, 9, 60);
break;
@@ -373,6 +380,10 @@ bool RunawayRoomScene::rebuildBackground() {
return applyBackground4090();
case kMuseumSecurity:
return applyBackground4100();
+ case 6190:
+ return applyBackground6190();
+ case 6200:
+ return !_town.firewoodTaken || applyPatch(4);
case 6350:
return !_town.arrived || (applyPatch(5) && applyPatch(7));
default:
@@ -403,6 +414,12 @@ void RunawayRoomScene::updateMaps() {
return;
}
switch (_room) {
+ case 6190:
+ updateMaps6190();
+ break;
+ case 6200:
+ updateMaps6200();
+ break;
case kHospitalBedroom:
updateMaps2020();
break;
@@ -535,6 +552,11 @@ void RunawayRoomScene::click(Common::Point mouse, RunawayVerb verb, byte item) {
_pendingHotspot = id;
_pendingAction = spot->action[index];
bool approach = spot->approach[index] != 0;
+ if (_room == 6210 && !index) {
+ if ((id == 5 && _town.bucketSeen) || (id == 8 && _town.bottleSeen)) {
+ approach = false;
+ }
+ }
if (_room == 6220 && id == 8 && index && _town.strapSeen)
approach = true;
if (_room == kHospitalBathroom && id == 4 && !index && _hospital.alcohol == 2)
@@ -664,6 +686,15 @@ void RunawayRoomScene::execute(uint16 action) {
case kMuseumSecurity:
result = execute4100(action);
break;
+ case 6190:
+ result = execute6190(action);
+ break;
+ case 6200:
+ result = execute6200(action);
+ break;
+ case 6210:
+ result = execute6210(action);
+ break;
case 6220:
result = execute6220(action);
break;
@@ -751,6 +782,13 @@ float RunawayRoomScene::actorHeight() const {
return actorHeight4090();
case kMuseumSecurity:
return actorHeight4100();
+ case 6190:
+ return (_position.y * 0.426829278f + 16.4634151f + _position.x * 0.0980392173f + 41.7647057f) / 2;
+ case 6200:
+ return _position.y > 501 ? _position.y * 0.618556678f + 84.4845352f :
+ _position.y * 1.38297868f - 299.255310f;
+ case 6210:
+ return _position.y * 0.413793117f + 229.482758f;
case 6220:
return _position.y * 0.194835678f - 11.706573f;
case 6370:
@@ -871,7 +909,9 @@ void RunawayRoomScene::draw() {
drawScene4140(viewport);
return;
}
- if (_room == 6220) {
+ if (_room == 6200) {
+ drawScene6200(viewport);
+ } else if (_room == 6220) {
drawScene6220(viewport);
} else if (_room == 6370) {
drawScene6370(viewport);
@@ -908,6 +948,14 @@ void RunawayRoomScene::draw() {
case kMuseumSecurity:
setupDepth4100(params);
break;
+ case 6190:
+ params.depthY[1] = 599;
+ params.depthY[2] = 388;
+ break;
+ case 6200:
+ case 6210:
+ params.depthY[1] = 599;
+ break;
case 6220:
params.depthY[1] = 263;
params.depthY[2] = 195;
@@ -1046,8 +1094,7 @@ void RunawayRoomScene::updateRoomAnimation() {
continue;
}
if (townChapter()) {
- if (_room == 6370 && _roomAction == 401 && _actionStep == 24)
- _audio.playEffect(12);
+ townAnimationFrame();
continue;
}
if ((_roomAction == 335 && _actionStep == 15) || (_roomAction == 339 && _actionStep == 47))
diff --git a/engines/hollywood/runaway/scene.h b/engines/hollywood/runaway/scene.h
index 596ca521982..84f37c5918f 100644
--- a/engines/hollywood/runaway/scene.h
+++ b/engines/hollywood/runaway/scene.h
@@ -295,6 +295,17 @@ private:
void deferTownAction(uint16 action);
void startTownFilm(byte film);
void finishTownFilm();
+ void start6190();
+ ActionResult execute6190(uint16 action);
+ bool applyBackground6190();
+ void updateMaps6190();
+ void start6200();
+ ActionResult execute6200(uint16 action);
+ void updateMaps6200();
+ void drawScene6200(Graphics::ManagedSurface &viewport);
+ void start6210();
+ ActionResult execute6210(uint16 action);
+ void townAnimationFrame();
ActionResult execute6350(uint16 action);
ActionResult execute6220(uint16 action);
void start6220();
diff --git a/engines/hollywood/runaway/scene6190.cpp b/engines/hollywood/runaway/scene6190.cpp
new file mode 100644
index 00000000000..8d1edc6a681
--- /dev/null
+++ b/engines/hollywood/runaway/scene6190.cpp
@@ -0,0 +1,145 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+
+
+#include "common/util.h"
+#include "hollywood/runaway/scene.h"
+
+namespace Hollywood {
+namespace {
+
+const RunawayHotspot kHotspots[] = {
+ {"", 0, 0, 0, {0, 0}, {0, 0}},
+ {"Town", 1250, 347, 3, {301, 302}, {0, 3}},
+ {"Bucket of paint", 560, 282, 0, {303, 304}, {1, 0}},
+ {"Hole", 757, 446, 5, {306, 307}, {1, 0}},
+ {"Shelves", 778, 314, 7, {308, 309}, {1, 1}},
+ {"Metal object", 778, 314, 7, {310, 311}, {0, 1}},
+ {"Desk", 479, 232, 5, {312, 313}, {1, 1}},
+ {"Cash register", 759, 334, 4, {314, 315}, {0, 1}},
+ {"Couch", 601, 391, 5, {316, 317}, {1, 0}}
+};
+
+const RunawayResponse kResponses[] = {
+ {6190, 301, 1, 0}, // Look toward town.
+ {6190, 303, 2, 0}, // Look at the bucket of paint.
+ {6190, 304, 3, 0}, // Try to take the bucket of paint.
+ {6190, 306, 5, 0}, // Look at the hole in the floor.
+ {6190, 310, 9, 0}, // Look at the metal object.
+ {6190, 312, 11, 0}, // Look at Douglas's desk.
+ {6190, 314, 13, 0}, // Look at the cash register.
+ {6190, 315, 14, 0}, // Open the empty cash register.
+ {6190, 316, 15, 0}, // Look at the couch.
+ {6190, 317, 16, 0} // Try to sit on the couch.
+};
+
+} // End of anonymous namespace
+
+const RunawayRoom kRunawayScene6190 = {
+ 6190, 1460, 600, kHotspots, ARRAYSIZE(kHotspots),
+ {{100, 100, 100}, {95, 90, 70}, {65, 60, 40}, {65, 60, 40}, {75, 70, 50}, {90, 85, 65}, {95, 90, 70}},
+ Common::Point(1250, 347),
+ kResponses, ARRAYSIZE(kResponses), nullptr, 0, nullptr, 0
+};
+
+void RunawayRoomScene::start6190() {
+ if (!_town.bankVisited) {
+ walkTo(Common::Point(1075, 330), 7);
+ deferTownAction(400);
+ } else {
+ walkTo(Common::Point(669, 413), 7);
+ }
+}
+
+bool RunawayRoomScene::applyBackground6190() {
+ return (!_town.bankStampTaken || applyPatch(8)) &&
+ (_town.bankShelves != 2 || applyPatch(9));
+}
+
+void RunawayRoomScene::updateMaps6190() {
+ for (uint i = 0; i < 256; ++i) {
+ byte &id = _maps[256 + i];
+ // The bucket only appears after the catapult has hit the bank.
+ if (id == 2) {
+ id = 0;
+ } else if (id == 5 && _town.bankShelves != 1) {
+ id = 4;
+ }
+ }
+}
+
+RunawayRoomScene::ActionResult RunawayRoomScene::execute6190(uint16 action) {
+ switch (action) {
+ case 302: // Return to the street.
+ leaveTownRoom(6224);
+ break;
+ case 307: // Try to enter the rubble-filled hole.
+ say(6, _town.basementKnown);
+ break;
+ case 308: // Examine the shelves and reveal the metal object.
+ say(7, _town.bankShelves);
+ if (!_town.bankShelves) {
+ _town.bankShelves = 1;
+ }
+ return kBackgroundChanged;
+ case 309: // Search the shelves.
+ say(8, _town.bankShelves == 2);
+ if (_town.bankShelves != 2) {
+ _town.bankShelves = 1;
+ }
+ return kBackgroundChanged;
+ case 311: // Take the ancient stapler and its staples.
+ say(10);
+ deferTownAction(411);
+ break;
+ case 411:
+ _town.bankShelves = 2;
+ _inventory.add(20);
+ say(10, 1);
+ return kBackgroundChanged;
+ case 313: // Search the desk and take the bank stamp.
+ if (_town.bankStampTaken) {
+ say(12, 2);
+ } else {
+ _town.bankStampTaken = 1;
+ _inventory.add(32);
+ say(12, 1);
+ }
+ return kBackgroundChanged;
+ case 400: // First visit: inspect the damage from the locomotive.
+ say(0);
+ deferTownAction(401);
+ break;
+ case 401:
+ walkTo(Common::Point(669, 413), 7);
+ deferTownAction(402);
+ break;
+ case 402:
+ say(0, 1);
+ _town.bankVisited = 1;
+ break;
+ default:
+ return kUnhandled;
+ }
+ return kHandled;
+}
+
+} // End of namespace Hollywood
diff --git a/engines/hollywood/runaway/scene6200.cpp b/engines/hollywood/runaway/scene6200.cpp
new file mode 100644
index 00000000000..dd7cccec051
--- /dev/null
+++ b/engines/hollywood/runaway/scene6200.cpp
@@ -0,0 +1,156 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+
+
+#include "common/util.h"
+#include "hollywood/runaway/scene.h"
+
+namespace Hollywood {
+namespace {
+
+const RunawayHotspot kHotspots[] = {
+ {"", 0, 0, 0, {0, 0}, {0, 0}},
+ {"Town", 1379, 491, 0, {301, 302}, {0, 3}},
+ {"Cell", 285, 501, 0, {303, 304}, {1, 0}},
+ {"", 0, 0, 0, {0, 0}, {0, 0}},
+ {"Firewood", 536, 504, 0, {306, 307}, {0, 1}},
+ {"Desk", 1020, 483, 0, {308, 309}, {0, 0}},
+ {"Gun cabinet", 1020, 483, 0, {310, 311}, {0, 0}},
+ {"Bulletin board", 857, 490, 0, {312, 313}, {0, 0}}
+};
+
+const RunawayResponse kResponses[] = {
+ {6200, 301, 1, 0}, // Look out toward the saloon.
+ {6200, 306, 4, 0}, // Look at the firewood.
+ {6200, 308, 6, 0}, // Examine the desk.
+ {6200, 309, 7, 0}, // Search the desk.
+ {6200, 310, 8, 0}, // Look at the gun cabinet.
+ {6200, 311, 9, 0}, // Try to take its chain.
+ {6200, 312, 10, 0}, // Read the wanted posters.
+ {6200, 313, 11, 0} // Try to take the wanted posters.
+};
+
+const RunawayItemAction kItemActions[] = {
+ {6200, 9, 2, 314} // Unlock the cell with the sheriff's key.
+};
+
+} // End of anonymous namespace
+
+const RunawayRoom kRunawayScene6200 = {
+ 6200, 1380, 600, kHotspots, ARRAYSIZE(kHotspots),
+ {{100, 100, 100}, {85, 80, 80}, {65, 60, 65}, {55, 50, 55}, {45, 40, 45}, {55, 50, 55}},
+ Common::Point(1227, 510),
+ kResponses, ARRAYSIZE(kResponses), kItemActions, ARRAYSIZE(kItemActions), nullptr, 0
+};
+
+void RunawayRoomScene::start6200() {
+ if (_entryScene == 6201) {
+ _position = Common::Point(258, 445);
+ _walkPath.reset(_position);
+ updateCamera();
+ walkTo(Common::Point(211, 506), 5, true);
+ } else if (!_town.bodySeen) {
+ _facing = 5;
+ say(0);
+ deferTownAction(400);
+ }
+}
+
+void RunawayRoomScene::updateMaps6200() {
+ for (uint i = 0; i < 256; ++i) {
+ // The approach to the cell is scripted; free walking stays in the office.
+ if (_maps[i] > 1) {
+ _maps[i] = 0;
+ }
+ if (_town.firewoodTaken && _maps[256 + i] == 4) {
+ _maps[256 + i] = 0;
+ }
+ }
+}
+
+void RunawayRoomScene::drawScene6200(Graphics::ManagedSurface &viewport) {
+ if (!drawingRoomAnimation() || _roomAction != 314) {
+ _ambient.draw(viewport, _town.cellOpen ? 25 : 0, _camera.x, -_camera.y);
+ }
+}
+
+RunawayRoomScene::ActionResult RunawayRoomScene::execute6200(uint16 action) {
+ switch (action) {
+ case 302: // Return to the street.
+ leaveTownRoom(6223);
+ break;
+ case 303: // Examine the prisoner before or after learning his identity.
+ say(2, !_town.doctorKnown ? 2 : !_town.cellOpen ? 1 : 0);
+ break;
+ case 304: // Try the cell door.
+ if (!_town.cellOpen) {
+ say(3);
+ break;
+ }
+ // fall through
+ case 305: // Enter the unlocked cell.
+ walkTo(Common::Point(258, 445), 0, true);
+ leaveTownRoom(6210);
+ break;
+ case 307: // Take the firewood.
+ say(5);
+ deferTownAction(407);
+ break;
+ case 407:
+ _town.firewoodTaken = 1;
+ _inventory.add(14);
+ say(5, 1);
+ return kBackgroundChanged;
+ case 314: // Unlock the cell.
+ if (_town.cellOpen) {
+ execute6200(305);
+ } else {
+ byte brian[47], door[47];
+ for (uint i = 0; i < ARRAYSIZE(door); ++i) {
+ brian[i] = i ? i - 1 : 0;
+ door[i] = i > 21 ? i - 21 : 0;
+ }
+ say(12);
+ beginRoomAnimation(314, 7, 47, brian, ARRAYSIZE(brian));
+ setRoomAnimationOverlay(6, 26, door, ARRAYSIZE(door));
+ _inventory.select(0);
+ }
+ break;
+ case 1314:
+ _town.cellOpen = 1;
+ _inventory.remove(9);
+ say(12, 1);
+ break;
+ case 400: // Walk up to the cell on the first visit.
+ walkTo(Common::Point(285, 501), 0);
+ deferTownAction(401);
+ break;
+ case 401: // Discover the dead prisoner.
+ say(0, 1);
+ _town.bodySeen = 1;
+ break;
+ default:
+ return kUnhandled;
+ }
+ return kHandled;
+}
+
+} // End of namespace Hollywood
diff --git a/engines/hollywood/runaway/scene6210.cpp b/engines/hollywood/runaway/scene6210.cpp
new file mode 100644
index 00000000000..8eb82ca46e5
--- /dev/null
+++ b/engines/hollywood/runaway/scene6210.cpp
@@ -0,0 +1,149 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+
+
+#include "common/util.h"
+#include "hollywood/runaway/scene.h"
+
+namespace Hollywood {
+namespace {
+
+const RunawayHotspot kHotspots[] = {
+ {"", 0, 0, 0, {0, 0}, {0, 0}},
+ {"Door", 430, 540, 4, {301, 302}, {0, 3}},
+ {"Door", 430, 540, 4, {301, 302}, {0, 3}},
+ {"Doctor's bag", 294, 513, 0, {303, 304}, {1, 1}},
+ {"Dead body", 449, 504, 0, {305, 306}, {0, 0}},
+ {"Bucket", 757, 508, 1, {307, 308}, {1, 0}},
+ {"Plate", 660, 507, 0, {309, 310}, {0, 0}},
+ {"Pitcher", 449, 504, 0, {311, 312}, {0, 0}},
+ {"Bottle", 341, 502, 0, {313, 314}, {1, 0}}
+};
+
+const RunawayResponse kResponses[] = {
+ {6210, 301, 1, 0}, // Look toward the exit.
+ {6210, 303, 2, 0}, // Examine the doctor's bag.
+ {6210, 305, 4, 0}, // Examine the dead body.
+ {6210, 306, 5, 0}, // Refuse to search the dead man's pockets.
+ {6210, 309, 8, 0}, // Examine the plate.
+ {6210, 311, 9, 0} // Examine the pitcher.
+};
+
+} // End of anonymous namespace
+
+const RunawayRoom kRunawayScene6210 = {
+ 6210, 1024, 600, kHotspots, ARRAYSIZE(kHotspots),
+ {{100, 100, 100}, {65, 60, 65}, {55, 50, 55}},
+ Common::Point(430, 540),
+ kResponses, ARRAYSIZE(kResponses), nullptr, 0, nullptr, 0
+};
+
+void RunawayRoomScene::start6210() {
+ _facing = 0;
+ _town.cellOpen = _town.bodySeen = 1;
+ _town.cellRefusals = 0;
+}
+
+RunawayRoomScene::ActionResult RunawayRoomScene::execute6210(uint16 action) {
+ switch (action) {
+ case 302: // Return to the sheriff's office.
+ leaveTownRoom(6201);
+ break;
+ case 304: // Search the doctor's bag.
+ say(3, _town.bagSearched);
+ _town.bagSearched = 1;
+ beginRoomAnimationRange(304, 4, 28, 0, 16);
+ break;
+ case 1304: { // Rummage inside the open bag.
+ byte frames[16];
+ memset(frames, 16, sizeof(frames));
+ beginRoomAnimation(410, 4, 28, frames, ARRAYSIZE(frames));
+ _audio.playEffect(60);
+ break;
+ }
+ case 1410: // Only take medical tools once their purpose is known.
+ if (_town.safeSeen && !_town.stethoscopeTaken) {
+ _town.stethoscopeTaken = 1;
+ _inventory.add(7);
+ say(3, 3);
+ if (_town.oscarTobacco && !_town.linimentTaken) {
+ deferTownAction(411);
+ }
+ } else if (_town.oscarTobacco && !_town.linimentTaken) {
+ execute6210(411);
+ } else {
+ say(3, 2);
+ holdRoomAnimation(412, 4, 28, 16);
+ }
+ break;
+ case 411: // Take the mint liniment for the chewing tobacco.
+ _town.linimentTaken = 1;
+ _inventory.add(8);
+ say(3, 4);
+ break;
+ case 1412: // Close the bag after an unsuccessful search.
+ beginRoomAnimationRange(413, 4, 28, 16, 27);
+ break;
+ case 1413:
+ break;
+ case 307: // Discover what the bucket was used for.
+ _facing = 4;
+ if (!_town.bucketSeen) {
+ say(6);
+ say(6, 1);
+ _town.bucketSeen = 1;
+ } else {
+ say(6, 2);
+ }
+ break;
+ case 308: // Refuse to take the bucket.
+ if (!_town.bucketSeen) {
+ walkTo(Common::Point(757, 508), 4, true);
+ deferTownAction(408);
+ } else {
+ execute6210(310);
+ }
+ break;
+ case 408:
+ execute6210(307);
+ deferTownAction(310);
+ break;
+ case 310: // Refuse to take the plate.
+ case 312: // Refuse to take the pitcher.
+ case 314: // Refuse to take the bottle.
+ if (_town.cellRefusals < 2) {
+ say(7, _town.cellRefusals);
+ ++_town.cellRefusals;
+ } else {
+ say(7, 2 + _random.getRandomBit());
+ }
+ break;
+ case 313: // Identify the empty whisky bottle.
+ say(10, _town.bottleSeen);
+ _town.bottleSeen = 1;
+ break;
+ default:
+ return kUnhandled;
+ }
+ return kHandled;
+}
+
+} // End of namespace Hollywood
diff --git a/engines/hollywood/runaway/scene6350.cpp b/engines/hollywood/runaway/scene6350.cpp
index eebe4b3103b..2be4a8030a9 100644
--- a/engines/hollywood/runaway/scene6350.cpp
+++ b/engines/hollywood/runaway/scene6350.cpp
@@ -48,7 +48,10 @@ const RunawayRoom kRunawayScene6350 = {
void RunawayRoomScene::resumeTown() {
if (!_entering) {
if (!_audio.musicPlaying()) {
- _audio.playMusic(11);
+ _audio.playMusic(_room == 6200 || _room == 6210 ? 18 : 11);
+ if (_room == 6200 || _room == 6210) {
+ _audio.setMusicVolume(191);
+ }
}
return;
}
@@ -58,10 +61,23 @@ void RunawayRoomScene::resumeTown() {
return;
}
_town.arrived = 1;
- if (!_audio.musicPlaying()) {
+ if (_room == 6200 || _room == 6210) {
+ if (_entryScene == 6200 || !_audio.musicPlaying()) {
+ _audio.playMusic(18);
+ }
+ _audio.setMusicVolume(191);
+ } else if (_entryScene == 6223) {
+ _audio.playMusic(12 + _random.getRandomNumber(4));
+ } else if (!_audio.musicPlaying()) {
_audio.playMusic(11);
}
- if (_room == 6220) {
+ if (_room == 6190) {
+ start6190();
+ } else if (_room == 6200) {
+ start6200();
+ } else if (_room == 6210) {
+ start6210();
+ } else if (_room == 6220) {
start6220();
} else if (_room == 6370) {
_town.streetVisited = 1;
@@ -91,6 +107,20 @@ void RunawayRoomScene::deferTownAction(uint16 action) {
_actionFrames.clear();
}
+void RunawayRoomScene::townAnimationFrame() {
+ if (_room == 6200 && _roomAction == 314) {
+ if (_actionStep == 13) {
+ _audio.playEffect(58);
+ } else if (_actionStep == 22) {
+ _audio.playEffect(59);
+ }
+ } else if (_room == 6210 && _roomAction == 410 && _actionStep == 8) {
+ _audio.playEffect(61, 204);
+ } else if (_room == 6370 && _roomAction == 401 && _actionStep == 24) {
+ _audio.playEffect(12);
+ }
+}
+
void RunawayRoomScene::leaveTownRoom(uint16 scene) {
const RunawayRoom *room = findRunawayRoom(scene);
if (!room) {
diff --git a/engines/hollywood/runaway/scene6370.cpp b/engines/hollywood/runaway/scene6370.cpp
index 8b026ead955..e2ca4528dac 100644
--- a/engines/hollywood/runaway/scene6370.cpp
+++ b/engines/hollywood/runaway/scene6370.cpp
@@ -113,14 +113,22 @@ void RunawayRoomScene::startSushiConversation(bool introduction) {
{1, 0, 0, 20, 20, 0, 0}},
{{1, 1, 3, 21, 21, 1, 255}, {1, 1, 3, 22, 22, 3, 255},
{1, 1, 3, 23, 23, 1, 255}, {1, 0, 2, 24, 24, 0, 0}},
- {{1, 0, 2, 25, 25, 1, 255}}
+ {{1, 0, 2, 25, 25, 1, 255}},
+ {{1, 0, 2, 26, 26, 4, 0}, {0, 0, 2, 27, 27, 1, 0}},
+ {{1, 3, 3, 28, 28, 1, 255}, {1, 3, 3, 29, 29, 1, 255},
+ {1, 3, 3, 30, 30, 1, 255}, {1, 0, 2, 31, 31, 0, 0}}
};
memcpy(_dialogue[0], topics[0], sizeof(topics[0]));
memcpy(_dialogue[10], topics[1], sizeof(topics[1]));
memcpy(_dialogue[11], topics[2], sizeof(topics[2]));
+ memcpy(_dialogue[12], topics[3], sizeof(topics[3]));
+ memcpy(_dialogue[13], topics[4], sizeof(topics[4]));
_dialogue[0][0].enabled = !_town.sushiMet;
_dialogue[0][1].enabled = _town.sushiMet;
- // The safe and the prisoner become topics after visiting those rooms.
+ _dialogue[0][4].enabled = _town.mineMapKnown && _town.bankVisited;
+ _dialogue[0][5].enabled = _town.bodySeen;
+ _dialogue[12][0].enabled = !_town.safeSeen;
+ _dialogue[12][1].enabled = _town.safeSeen;
}
void RunawayRoomScene::sushiDialogueChoice(byte effect) {
@@ -132,6 +140,10 @@ void RunawayRoomScene::sushiDialogueChoice(byte effect) {
say(90, 8, false, 1);
} else if (effect == 3) { // Learn where a map of the mine might be kept.
_town.mineMapKnown = 1;
+ } else if (effect == 4) { // Learn that the bank's safe is in its basement.
+ _town.basementKnown = 1;
+ } else if (effect == 10) { // Identify the prisoner as Douglasville's doctor.
+ _town.doctorKnown = 1;
}
}
diff --git a/engines/hollywood/runaway/scene_data.h b/engines/hollywood/runaway/scene_data.h
index f8920e47406..e2763ee4e5a 100644
--- a/engines/hollywood/runaway/scene_data.h
+++ b/engines/hollywood/runaway/scene_data.h
@@ -104,6 +104,9 @@ extern const RunawayRoom kRunawayScene5130;
extern const RunawayRoom kRunawayScene5140;
extern const RunawayRoom kRunawayScene5160;
extern const RunawayRoom kRunawayScene5170;
+extern const RunawayRoom kRunawayScene6190;
+extern const RunawayRoom kRunawayScene6200;
+extern const RunawayRoom kRunawayScene6210;
extern const RunawayRoom kRunawayScene6220;
extern const RunawayRoom kRunawayScene6350;
extern const RunawayRoom kRunawayScene6370;
Commit: 55f5e57ff412da42aa2f87cf3515b1535a2c58d9
https://github.com/scummvm/scummvm/commit/55f5e57ff412da42aa2f87cf3515b1535a2c58d9
Author: neuromancer (gustavo.grieco at gmail.com)
Date: 2026-11-19T19:38:52+01:00
Commit Message:
HOLLYWOOD: RUNAWAY: implemented scenes 6260 and 6263
Changed paths:
A engines/hollywood/runaway/scene6260.cpp
A engines/hollywood/runaway/scene6263.cpp
engines/hollywood/module.mk
engines/hollywood/runaway/audio.cpp
engines/hollywood/runaway/audio.h
engines/hollywood/runaway/saveload.cpp
engines/hollywood/runaway/saveload.h
engines/hollywood/runaway/scene.cpp
engines/hollywood/runaway/scene.h
engines/hollywood/runaway/scene6350.cpp
engines/hollywood/runaway/scene_data.h
diff --git a/engines/hollywood/module.mk b/engines/hollywood/module.mk
index 69a76b51cb7..0c8a70cbf47 100644
--- a/engines/hollywood/module.mk
+++ b/engines/hollywood/module.mk
@@ -179,6 +179,8 @@ MODULE_OBJS = \
runaway/scene6200.o \
runaway/scene6210.o \
runaway/scene6220.o \
+ runaway/scene6260.o \
+ runaway/scene6263.o \
runaway/scene6350.o \
runaway/scene6370.o \
runaway/sequence.o \
diff --git a/engines/hollywood/runaway/audio.cpp b/engines/hollywood/runaway/audio.cpp
index 17eaca452b2..b86f46fa357 100644
--- a/engines/hollywood/runaway/audio.cpp
+++ b/engines/hollywood/runaway/audio.cpp
@@ -186,6 +186,11 @@ void RunawayAudio::stopEffect() {
_mixer->stopHandle(_effects[i]);
}
+void RunawayAudio::stopEffect(byte channel) {
+ assert(channel < ARRAYSIZE(_effects));
+ _mixer->stopHandle(_effects[channel]);
+}
+
bool RunawayAudio::musicPlaying() const {
return _mixer->isSoundHandleActive(_music);
}
diff --git a/engines/hollywood/runaway/audio.h b/engines/hollywood/runaway/audio.h
index 66720687e6b..d877d6d3d56 100644
--- a/engines/hollywood/runaway/audio.h
+++ b/engines/hollywood/runaway/audio.h
@@ -43,6 +43,7 @@ public:
void stopMusic();
void stopSpeech();
void stopEffect();
+ void stopEffect(byte channel);
bool musicPlaying() const;
bool speechPlaying() const;
bool effectPlaying(byte channel = 0) const;
diff --git a/engines/hollywood/runaway/saveload.cpp b/engines/hollywood/runaway/saveload.cpp
index a3f92ae52db..8f38d491035 100644
--- a/engines/hollywood/runaway/saveload.cpp
+++ b/engines/hollywood/runaway/saveload.cpp
@@ -225,6 +225,18 @@ void RunawaySaveState::sync(Common::Serializer &s) {
s.syncAsByte(town.oscarTobacco, 9);
s.syncAsByte(town.stethoscopeTaken, 9);
s.syncAsByte(town.linimentTaken, 9);
+ s.syncAsByte(town.locomotiveVisited, 10);
+ s.syncAsByte(town.locomotiveKey, 10);
+ s.syncAsByte(town.waterTank, 10);
+ s.syncAsByte(town.cabVisited, 10);
+ s.syncAsByte(town.cabExited, 10);
+ s.syncAsByte(town.boiler, 10);
+ s.syncAsByte(town.steamLever, 10);
+ s.syncAsByte(town.pressureWheel, 10);
+ s.syncAsByte(town.drainSeen, 10);
+ s.syncAsByte(town.oilCanFull, 10);
+ s.syncAsByte(town.bottleContents, 10);
+ s.syncAsByte(town.craterSeen, 10);
}
byte RunawaySaveState::chapter() const {
@@ -326,6 +338,12 @@ bool RunawaySaveState::valid() const {
return false;
}
bool owned[33] = {};
+ if (town.locomotiveVisited > 1 || town.locomotiveKey > 3 || town.waterTank > 5 ||
+ town.cabVisited > 1 || town.cabExited > 1 || town.boiler > 3 ||
+ town.steamLever > 2 || town.pressureWheel > 2 || town.drainSeen > 1 ||
+ town.oilCanFull > 1 || town.bottleContents > 2 || town.craterSeen > 1) {
+ return false;
+ }
if (town.arrived > 1 || town.streetVisited > 1 || town.strapSeen > 1 || town.sushiMet > 1 || town.mineMapKnown > 1)
return false;
if (town.bankVisited > 1 || town.bankShelves > 2 || town.bankStampTaken > 1 || town.basementKnown > 1 ||
@@ -348,7 +366,7 @@ bool RunawaySaveState::read(Common::SeekableReadStream &stream) {
if (stream.readUint32BE() != MKTAG('R', 'U', 'N', 'A'))
return false;
const uint16 version = stream.readUint16LE();
- if (version < 1 || version > 9)
+ if (version < 1 || version > 10)
return false;
Common::Serializer s(&stream, nullptr);
s.setVersion(version);
@@ -360,9 +378,9 @@ bool RunawaySaveState::write(Common::WriteStream &stream) {
if (!valid())
return false;
stream.writeUint32BE(MKTAG('R', 'U', 'N', 'A'));
- stream.writeUint16LE(9);
+ stream.writeUint16LE(10);
Common::Serializer s(nullptr, &stream);
- s.setVersion(9);
+ s.setVersion(10);
sync(s);
return !s.err();
}
diff --git a/engines/hollywood/runaway/saveload.h b/engines/hollywood/runaway/saveload.h
index cb2e51dbd2d..35beb6cc3bc 100644
--- a/engines/hollywood/runaway/saveload.h
+++ b/engines/hollywood/runaway/saveload.h
@@ -91,6 +91,10 @@ struct RunawaySaveState {
byte bodySeen = 0, doctorKnown = 0, firewoodTaken = 0, cellOpen = 0;
byte bagSearched = 0, bucketSeen = 0, bottleSeen = 0, cellRefusals = 0;
byte safeSeen = 0, oscarTobacco = 0, stethoscopeTaken = 0, linimentTaken = 0;
+ byte locomotiveVisited = 0, locomotiveKey = 0, waterTank = 0;
+ byte cabVisited = 0, cabExited = 0, boiler = 0;
+ byte steamLever = 0, pressureWheel = 0, drainSeen = 0;
+ byte oilCanFull = 0, bottleContents = 0, craterSeen = 0;
} town;
uint16 scene = 5030, x = 623, y = 447, camera = 111;
diff --git a/engines/hollywood/runaway/scene.cpp b/engines/hollywood/runaway/scene.cpp
index 81e7c119a00..3bfbc5653b2 100644
--- a/engines/hollywood/runaway/scene.cpp
+++ b/engines/hollywood/runaway/scene.cpp
@@ -40,7 +40,8 @@ const RunawayRoom *const kRooms[] = {
&kRunawayScene5080, &kRunawayScene5100, &kRunawayScene5110, &kRunawayScene5130, &kRunawayScene5140,
&kRunawayScene5160, &kRunawayScene5170,
&kRunawayScene6190, &kRunawayScene6200, &kRunawayScene6210,
- &kRunawayScene6220, &kRunawayScene6350, &kRunawayScene6370
+ &kRunawayScene6220, &kRunawayScene6260, &kRunawayScene6263,
+ &kRunawayScene6350, &kRunawayScene6370
};
const RunawayResponse kGlobalResponses[] = {
@@ -82,6 +83,10 @@ const RunawayRoom *findRoom(int number) {
number = 6220;
else if (number == 6201) {
number = 6200;
+ } else if (number == 6261 || number == 6262 || number == 6265) {
+ number = 6260;
+ } else if (number == 6264) {
+ number = 6263;
}
for (uint i = 0; i < ARRAYSIZE(kRooms); ++i) {
if (kRooms[i]->number == number)
@@ -259,11 +264,12 @@ bool RunawayRoomScene::enterRoom(uint16 number, Common::Point position, byte fac
// The bus introduction has only a background and four sprite tracks.
_mask.resize(room->width * room->height, 0);
_originalMaps.resize(1536, 0);
- } else if (!loadRunawayMask(_archive, room->width, room->height, _mask, _originalMaps)) {
+ } else if (!loadRunawayMask(_archive, room->width, room->height, _mask, _originalMaps, number == 6263 ? 21 : 1)) {
return false;
}
if (_game == kRunawayFullGame ? !_actor.loadChapter(number < 4000 ? 1 : number < 5000 ? 2 : number < 6000 ? 3 : 4,
- number != kMuseumHall && number != 6190 && number != 6200 && number != 6350 && number != 6370) :
+ number != kMuseumHall && number != 6190 && number != 6200 && number != 6260 && number != 6263 &&
+ number != 6350 && number != 6370) :
!_actor.load(number == kMuseumHall ? RunawayActor::kMuseumHall : RunawayActor::kMuseumInterior))
return false;
_room = number;
@@ -318,6 +324,12 @@ bool RunawayRoomScene::enterRoom(uint16 number, Common::Point position, byte fac
case 6220:
loaded = _npc.load(_archive, 7, 170) && _npcMouth.load(_archive, 8, 45) && _machine.load(_archive, 9, 60);
break;
+ case 6260:
+ loaded = loadForeground(0, 6);
+ break;
+ case 6263:
+ loaded = loadScene6263();
+ break;
case 6370:
loaded = _npc.load(_archive, 4, 88) && _ambient.load(_archive, 5, 20);
break;
@@ -361,7 +373,7 @@ bool RunawayRoomScene::applyPatch(uint chunk) {
bool RunawayRoomScene::rebuildBackground() {
const RunawayRoom *room = findRoom(_room);
- if (!loadRunawaySurface(_archive, 0, room->width, room->height, _background))
+ if (!loadRunawaySurface(_archive, _room == 6263 ? 20 : 0, room->width, room->height, _background))
return false;
if (desertChapter())
return applyDesertBackground();
@@ -384,6 +396,8 @@ bool RunawayRoomScene::rebuildBackground() {
return applyBackground6190();
case 6200:
return !_town.firewoodTaken || applyPatch(4);
+ case 6260:
+ return applyBackground6260();
case 6350:
return !_town.arrived || (applyPatch(5) && applyPatch(7));
default:
@@ -420,6 +434,9 @@ void RunawayRoomScene::updateMaps() {
case 6200:
updateMaps6200();
break;
+ case 6260:
+ updateMaps6260();
+ break;
case kHospitalBedroom:
updateMaps2020();
break;
@@ -471,6 +488,14 @@ Common::U32String RunawayRoomScene::hotspotName(byte id) const {
return Common::U32String("Douglasville");
if (_room == 6220 && id == 8 && _town.strapSeen)
return Common::U32String("Strap");
+ if (_room == 6263) {
+ if (id == 3 && _town.steamLever) {
+ return Common::U32String("Steam outlet lever");
+ }
+ if (id == 4 && _town.pressureWheel) {
+ return Common::U32String("Pressure wheel");
+ }
+ }
const RunawayHotspot *spot = hotspot(id);
if (!spot)
return Common::U32String();
@@ -506,10 +531,13 @@ Common::U32String RunawayRoomScene::actionCaption(byte id, RunawayVerb verb, byt
}
void RunawayRoomScene::walkTo(Common::Point target, byte facing, bool scripted) {
- if (scripted)
+ if (scripted) {
_walkPath.setTarget(target);
- else
+ } else if (_room == 6260) {
+ walk6260(target);
+ } else {
_walkPath.findPath(RunawayWalkMap(_background.w, _background.h, _mask, _maps), target);
+ }
_arrivalFacing = facing;
_walkElapsed = _lastFootstep = 0;
if (!_walkPath.active())
@@ -559,6 +587,9 @@ void RunawayRoomScene::click(Common::Point mouse, RunawayVerb verb, byte item) {
}
if (_room == 6220 && id == 8 && index && _town.strapSeen)
approach = true;
+ if (_room == 6260 && id == 5 && !index && _town.locomotiveKey == 2) {
+ approach = false;
+ }
if (_room == kHospitalBathroom && id == 4 && !index && _hospital.alcohol == 2)
approach = false;
if (item) {
@@ -698,6 +729,12 @@ void RunawayRoomScene::execute(uint16 action) {
case 6220:
result = execute6220(action);
break;
+ case 6260:
+ result = execute6260(action);
+ break;
+ case 6263:
+ result = execute6263(action);
+ break;
case 6350:
result = execute6350(action);
break;
@@ -791,6 +828,10 @@ float RunawayRoomScene::actorHeight() const {
return _position.y * 0.413793117f + 229.482758f;
case 6220:
return _position.y * 0.194835678f - 11.706573f;
+ case 6260:
+ return _position.y * 0.95f - 175;
+ case 6263:
+ return _position.y * 1.04838705f - 175.645157f;
case 6370:
return _position.y * 0.634920657f - 221.190475f;
default:
@@ -913,6 +954,8 @@ void RunawayRoomScene::draw() {
drawScene6200(viewport);
} else if (_room == 6220) {
drawScene6220(viewport);
+ } else if (_room == 6263) {
+ drawScene6263(viewport);
} else if (_room == 6370) {
drawScene6370(viewport);
} else if (desertChapter()) {
@@ -954,6 +997,7 @@ void RunawayRoomScene::draw() {
break;
case 6200:
case 6210:
+ case 6263:
params.depthY[1] = 599;
break;
case 6220:
@@ -1004,6 +1048,9 @@ void RunawayRoomScene::draw() {
drawForeground4030(viewport);
else if (_room == kMuseumLaboratory)
drawForeground4050(viewport);
+ else if (_room == 6260) {
+ drawForeground(viewport, 0);
+ }
}
void RunawayRoomScene::drawForeground(Graphics::ManagedSurface &viewport, uint layer) {
@@ -1014,7 +1061,8 @@ void RunawayRoomScene::drawForeground(Graphics::ManagedSurface &viewport, uint l
}
}
-void RunawayRoomScene::beginRoomAnimation(uint16 action, uint chunk, uint frames, const byte *order, uint count, bool hideActor) {
+void RunawayRoomScene::beginRoomAnimation(uint16 action, uint chunk, uint frames, const byte *order, uint count, bool hideActor, uint frameDuration) {
+ assert(frameDuration);
if (!_actionAnimation.load(_archive, chunk, frames))
error("Cannot load Runaway room %u animation %u", _room, chunk);
_actionFrames.clear();
@@ -1027,6 +1075,7 @@ void RunawayRoomScene::beginRoomAnimation(uint16 action, uint chunk, uint frames
_actionHidesActor = hideActor;
_actionStage = 0;
_actionStep = 0;
+ _actionFrameDuration = frameDuration;
_actionStarted = _now;
}
@@ -1065,8 +1114,8 @@ void RunawayRoomScene::updateRoomAnimation() {
_actionStarted = _now;
return;
}
- while (_now - _actionStarted >= 80) {
- _actionStarted += 80;
+ while (_now - _actionStarted >= _actionFrameDuration) {
+ _actionStarted += _actionFrameDuration;
if (++_actionStep == _actionFrames.size()) {
if (_actionLoopSpeech && speaking()) {
_actionStep = 0;
diff --git a/engines/hollywood/runaway/scene.h b/engines/hollywood/runaway/scene.h
index 84f37c5918f..c82b5a10531 100644
--- a/engines/hollywood/runaway/scene.h
+++ b/engines/hollywood/runaway/scene.h
@@ -142,7 +142,7 @@ private:
void startHospitalFilm(HospitalFilm film);
void finishHospitalFilm();
void adaptGogFilm(const RunawaySequence::Command *commands);
- void beginRoomAnimation(uint16 action, uint chunk, uint frames, const byte *order = nullptr, uint count = 0, bool hideActor = true);
+ void beginRoomAnimation(uint16 action, uint chunk, uint frames, const byte *order = nullptr, uint count = 0, bool hideActor = true, uint frameDuration = 80);
void beginRoomAnimationRange(uint16 action, uint chunk, uint frames, uint first, uint last, bool hideActor = true);
void holdRoomAnimation(uint16 action, uint chunk, uint frames, uint frame, bool hideActor = true);
void loopRoomAnimationDuringSpeech(uint16 action, uint chunk, uint frames, uint first, uint last, bool hideActor = true);
@@ -306,6 +306,17 @@ private:
void start6210();
ActionResult execute6210(uint16 action);
void townAnimationFrame();
+ void start6260();
+ ActionResult execute6260(uint16 action);
+ bool applyBackground6260();
+ void updateMaps6260();
+ void walk6260(Common::Point target);
+ bool loadScene6263();
+ void resume6263();
+ void update6263();
+ void drawScene6263(Graphics::ManagedSurface &viewport);
+ ActionResult execute6263(uint16 action);
+ void locomotiveAnimationFrame();
ActionResult execute6350(uint16 action);
ActionResult execute6220(uint16 action);
void start6220();
@@ -362,6 +373,8 @@ private:
RunawaySaveState::Museum _museum;
RunawaySaveState::Desert _desert;
RunawaySaveState::Town _town;
+ RunawayAnimation _locomotiveGauges[4];
+ byte _locomotiveGaugeFrames[4] = {};
byte _townFilm = 0;
struct TownEncounter {
enum Phase { kInactive, kRifle, kConversation, kDeparture };
@@ -418,6 +431,7 @@ private:
bool _actionLoopSpeech = false;
byte _actionStage = 0;
uint _actionStep = 0;
+ uint _actionFrameDuration = 80;
uint32 _actionStarted = 0;
Transition _hospitalExit;
HospitalFilm _hospitalFilm = kGinaStoryFilm;
diff --git a/engines/hollywood/runaway/scene6260.cpp b/engines/hollywood/runaway/scene6260.cpp
new file mode 100644
index 00000000000..250fbfb547e
--- /dev/null
+++ b/engines/hollywood/runaway/scene6260.cpp
@@ -0,0 +1,217 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+
+
+#include "common/util.h"
+#include "hollywood/runaway/scene.h"
+
+namespace Hollywood {
+namespace {
+
+const RunawayHotspot kHotspots[] = {
+ {"", 0, 0, 0, {0, 0}, {0, 0}},
+ {"Town", 0, 510, 5, {301, 302}, {0, 3}},
+ {"Driver's cab", 363, 395, 7, {303, 304}, {0, 1}},
+ {"Smokestack", 495, 433, 1, {305, 306}, {0, 1}},
+ {"Water tank opening", 432, 411, 0, {307, 308}, {0, 0}},
+ {"Key", 413, 485, 7, {309, 310}, {1, 1}},
+ {"Whistle", 257, 430, 1, {311, 312}, {0, 0}},
+ {"Outskirts of town", 1023, 437, 2, {315, 316}, {0, 3}}
+};
+
+const RunawayResponse kResponses[] = {
+ {6260, 301, 1, 0}, // Look toward Douglasville.
+ {6260, 303, 2, 0}, // Examine the damaged cab.
+ {6260, 305, 4, 0}, // Examine the smokestack.
+ {6260, 306, 5, 0}, // Look inside the sooty smokestack.
+ {6260, 307, 6, 0}, // Identify the water inlet.
+ {6260, 308, 7, 0}, // The inlet has no cap to open.
+ {6260, 311, 10, 0}, // Examine the whistle.
+ {6260, 312, 11, 0} // The whistle is operated from the cab.
+};
+
+const RunawayItemAction kItemActions[] = {
+ {6260, 23, 4, 313}, // Pour water from the oil can into the tank.
+ {6260, 24, 4, 314} // Try to pour from the bottle.
+};
+
+} // End of anonymous namespace
+
+const RunawayRoom kRunawayScene6260 = {
+ 6260, 1024, 600, kHotspots, ARRAYSIZE(kHotspots),
+ {{100, 100, 100}, {100, 90, 80}},
+ Common::Point(123, 469),
+ kResponses, ARRAYSIZE(kResponses), kItemActions, ARRAYSIZE(kItemActions), nullptr, 0
+};
+
+void RunawayRoomScene::start6260() {
+ if (_entryScene == 6261) {
+ beginRoomAnimation(401, 5, 88, nullptr, 0, true, 60);
+ } else if (_entryScene == 6262) {
+ // The steam shot is seen outside before returning to the cab.
+ beginRoomAnimation(402, 9, 45, nullptr, 0, true, 60);
+ _actionFrames.insert_at(0, 0);
+ } else {
+ const bool outskirts = _entryScene == 6265;
+ _position = outskirts ? Common::Point(825, 458) : Common::Point(123, 469);
+ _walkPath.reset(_position);
+ _facing = outskirts ? 7 : 1;
+ if (!_town.locomotiveVisited) {
+ say(0);
+ deferTownAction(400);
+ }
+ }
+}
+
+bool RunawayRoomScene::applyBackground6260() {
+ const bool keyVisible = _town.locomotiveKey == 1 || _town.locomotiveKey == 2;
+ return applyPatch(keyVisible ? 8 : 7);
+}
+
+void RunawayRoomScene::updateMaps6260() {
+ for (uint i = 0; i < 256; ++i) {
+ // The upper zone is reserved for approaches to the cab and inlet.
+ if (_maps[i] == 2) {
+ _maps[i] = 0;
+ }
+ if (_maps[256 + i] == 5 && (_town.locomotiveKey == 0 || _town.locomotiveKey == 3)) {
+ _maps[256 + i] = 0;
+ }
+ }
+}
+
+void RunawayRoomScene::walk6260(Common::Point target) {
+ if (!_pendingHotspot) {
+ // Ordinary clicks stay on the ground, even when Brian starts above it.
+ target.x = CLIP<int>(target.x, 0, _background.w - 1);
+ target.y = CLIP<int>(target.y, 0, _background.h - 1);
+ while (target.y < _background.h - 1 && !_maps[_mask[target.y * _background.w + target.x]]) {
+ ++target.y;
+ }
+ while (target.y > 0 && !_maps[_mask[target.y * _background.w + target.x]]) {
+ --target.y;
+ }
+ }
+ _walkPath.findPath(RunawayWalkMap(_background.w, _background.h, _mask, _originalMaps), target);
+}
+
+RunawayRoomScene::ActionResult RunawayRoomScene::execute6260(uint16 action) {
+ switch (action) {
+ case 302: // Return to the street.
+ leaveTownRoom(6225);
+ break;
+ case 304: // Climb through the cab's broken window.
+ if (!_town.cabVisited) {
+ say(3);
+ }
+ beginRoomAnimation(304, 4, 131, nullptr, 0, true, 60);
+ break;
+ case 1304:
+ leaveTownRoom(6263);
+ break;
+ case 309: // Identify the key ejected from the smokestack.
+ _facing = 4;
+ say(8);
+ if (_town.locomotiveKey == 1) {
+ _town.locomotiveKey = 2;
+ }
+ break;
+ case 310: // Pick up the cell key.
+ if (_town.locomotiveKey == 1) {
+ execute6260(309);
+ }
+ deferTownAction(410);
+ break;
+ case 410:
+ _town.locomotiveKey = 3;
+ _inventory.add(9);
+ say(9);
+ return kBackgroundChanged;
+ case 313: // Fill the tank, one oil can at a time.
+ if (!_town.oilCanFull) {
+ say(12);
+ } else if (_town.waterTank == 5) {
+ say(12, 1);
+ } else {
+ say(12, _town.waterTank ? 3 : 2);
+ byte frames[114];
+ for (uint i = 0; i < ARRAYSIZE(frames); ++i) {
+ if (i <= 37) {
+ frames[i] = i;
+ } else if (i < 80) {
+ frames[i] = 37;
+ } else if (i < 85) {
+ frames[i] = i - 42;
+ } else {
+ frames[i] = i < 104 ? 104 - i : 0;
+ }
+ }
+ beginRoomAnimation(313, 10, 43, frames, ARRAYSIZE(frames), true, 60);
+ _inventory.select(0);
+ }
+ break;
+ case 1313:
+ ++_town.waterTank;
+ _town.oilCanFull = 0;
+ break;
+ case 314: // The bottle cannot reach the tank opening.
+ if (_town.bottleContents == 1) {
+ say(13, 2);
+ deferTownAction(414);
+ } else {
+ say(13, _town.bottleContents == 2 ? 1 : 0);
+ }
+ break;
+ case 414:
+ _facing = 4;
+ say(13, _town.waterTank ? 4 : 3);
+ break;
+ case 315: // Look toward the crater.
+ say(16, _town.craterSeen);
+ break;
+ case 316: // Leave through the outskirts.
+ leaveTownRoom(6350);
+ break;
+ case 400: // First visit: explain the locomotive's fittings.
+ walkTo(_entryScene == 6265 ? Common::Point(524, 475) : Common::Point(222, 435),
+ _entryScene == 6265 ? 7 : 1);
+ deferTownAction(403);
+ break;
+ case 403:
+ say(0, 1);
+ _town.locomotiveVisited = 1;
+ break;
+ case 1401: // Finish climbing out of the cab.
+ _position = Common::Point(363, 395);
+ _walkPath.reset(_position);
+ _facing = 3;
+ break;
+ case 1402: // The burst has dislodged the sheriff's key.
+ _town.locomotiveKey = 1;
+ leaveTownRoom(6264);
+ return kBackgroundChanged;
+ default:
+ return kUnhandled;
+ }
+ return kHandled;
+}
+
+} // End of namespace Hollywood
diff --git a/engines/hollywood/runaway/scene6263.cpp b/engines/hollywood/runaway/scene6263.cpp
new file mode 100644
index 00000000000..c5978243d46
--- /dev/null
+++ b/engines/hollywood/runaway/scene6263.cpp
@@ -0,0 +1,304 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+
+
+#include "common/util.h"
+#include "hollywood/runaway/scene.h"
+
+namespace Hollywood {
+namespace {
+
+const RunawayHotspot kHotspots[] = {
+ {"", 0, 0, 0, {0, 0}, {0, 0}},
+ {"Window", 252, 492, 0, {301, 302}, {0, 1}},
+ {"Boiler", 223, 483, 1, {303, 304}, {0, 0}},
+ {"Lever", 287, 505, 1, {305, 306}, {0, 1}},
+ {"Wheel", 287, 505, 1, {307, 308}, {0, 1}},
+ {"Gauges", 287, 505, 1, {311, 312}, {0, 0}},
+ {"Lever", 0, 0, 0, {314, 315}, {0, 0}},
+ {"Lever", 0, 0, 1, {316, 317}, {0, 0}}
+};
+
+const RunawayResponse kResponses[] = {
+ {6263, 301, 21, 0}, // Examine the window.
+ {6263, 311, 31, 0}, // Identify the pressure and water gauges.
+ {6263, 312, 32, 0}, // Leave the gauges alone.
+ {6263, 314, 34, 0}, // Identify the driving lever.
+ {6263, 317, 37, 0} // Refuse to drain the tank.
+};
+
+const RunawayItemAction kItemActions[] = {
+ {6263, 14, 2, 309}, // Put firewood into the boiler.
+ {6263, 15, 2, 313}, // Light the boiler with the blowtorch.
+ {6263, 0, 2, 310, false} // Reject other objects as fuel.
+};
+
+const byte kSteamLeverFrames[] = {
+ 0, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
+ 15, 16, 17, 18, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
+ 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 20, 21, 22,
+ 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34
+};
+
+const byte kPressureWheelFrames[] = {
+ 35, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47,
+ 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61,
+ 62, 63, 56, 55, 54, 53, 52, 51, 50, 49, 48, 47, 46, 45,
+ 44, 43, 42, 41, 40, 39, 38, 37, 36, 35,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
+};
+
+} // End of anonymous namespace
+
+const RunawayRoom kRunawayScene6263 = {
+ 6263, 1024, 600, kHotspots, ARRAYSIZE(kHotspots),
+ {{100, 100, 100}, {60, 60, 60}},
+ Common::Point(252, 492),
+ kResponses, ARRAYSIZE(kResponses), kItemActions, ARRAYSIZE(kItemActions), nullptr, 0
+};
+
+bool RunawayRoomScene::loadScene6263() {
+ if (!_ambient.load(_archive, 30, 101) || !_overlay.load(_archive, 27, 1)) {
+ return false;
+ }
+ for (uint i = 0; i < ARRAYSIZE(_locomotiveGauges); ++i) {
+ if (!_locomotiveGauges[i].load(_archive, 31 + i, 31)) {
+ return false;
+ }
+ }
+ return true;
+}
+
+void RunawayRoomScene::resume6263() {
+ _ambientFrame = _town.boiler >= 2 ? 41 : 0;
+ _ambientTick = _now;
+ if (_town.boiler >= 2) {
+ _audio.playEffect(53, 178, 1, true);
+ }
+ if (!_entering) {
+ return;
+ }
+ if (_entryScene == 6264) {
+ beginRoomAnimation(401, 26, 64, kSteamLeverFrames + 40, ARRAYSIZE(kSteamLeverFrames) - 40, true, 60);
+ } else {
+ beginRoomAnimation(400, 24, 24, nullptr, 0, true, 60);
+ }
+}
+
+void RunawayRoomScene::update6263() {
+ if (_town.boiler < 2 || _now - _ambientTick < 80) {
+ return;
+ }
+ _ambientTick = _now;
+ _ambientFrame = _ambientFrame < 40 ? _ambientFrame + 1 : 41 + _random.getRandomNumber(59);
+ for (uint i = 0; i < 4; i += 3) {
+ const int step = _random.getRandomBit() ? 1 : -1;
+ _locomotiveGaugeFrames[i] = CLIP<int>(_locomotiveGaugeFrames[i] + step, 0, 30);
+ }
+}
+
+void RunawayRoomScene::drawScene6263(Graphics::ManagedSurface &viewport) {
+ _ambient.draw(viewport, _ambientFrame, 0, 0);
+ _locomotiveGaugeFrames[1] = _town.boiler == 3 ? 30 : _town.boiler == 2 ? 15 : 0;
+ _locomotiveGaugeFrames[2] = _town.waterTank * 6;
+ if (drawingRoomAnimation()) {
+ if (_roomAction == 313 && _town.boiler == 2) {
+ _locomotiveGaugeFrames[1] = CLIP<int>((int)_actionStep - 41, 0, 15);
+ } else if (_roomAction == 308) {
+ _locomotiveGaugeFrames[1] = CLIP<int>((int)_actionStep - 23 + 15, 15, 30);
+ }
+ }
+ for (uint i = 0; i < ARRAYSIZE(_locomotiveGauges); ++i) {
+ _locomotiveGauges[i].draw(viewport, _locomotiveGaugeFrames[i], 0, 0);
+ }
+ if (!drawingRoomAnimation() || (_roomAction != 306 && _roomAction != 308 && _roomAction != 401)) {
+ _overlay.draw(viewport, 0, 0, 0);
+ }
+}
+
+RunawayRoomScene::ActionResult RunawayRoomScene::execute6263(uint16 action) {
+ switch (action) {
+ case 302: // Climb back out through the window.
+ if (!_town.cabExited) {
+ say(22);
+ }
+ beginRoomAnimation(302, 25, 29, nullptr, 0, true, 60);
+ break;
+ case 1302:
+ _town.cabExited = 1;
+ leaveTownRoom(6261);
+ break;
+ case 303: // Examine the boiler and its fuel.
+ say(23, MIN<byte>(_town.boiler, 2));
+ break;
+ case 304: // Try to open the boiler.
+ say(24, _town.boiler >= 2);
+ break;
+ case 305: // Identify the steam outlet lever.
+ say(25, _town.steamLever);
+ if (!_town.steamLever) {
+ _town.steamLever = 1;
+ }
+ break;
+ case 306: // Release steam, if the boiler has enough pressure.
+ if (!_town.steamLever) {
+ execute6263(305);
+ }
+ beginRoomAnimation(306, 26, 64, kSteamLeverFrames,
+ _town.boiler == 3 && !_town.locomotiveKey ? 41 : ARRAYSIZE(kSteamLeverFrames), true, 60);
+ break;
+ case 1306:
+ if (_town.boiler == 3 && !_town.locomotiveKey) {
+ leaveTownRoom(6262);
+ } else {
+ say(26, _town.boiler < 2 ? 0 : _town.boiler == 2 ? 1 : 3);
+ }
+ break;
+ case 307: // Identify the pressure wheel.
+ say(27, _town.pressureWheel != 0);
+ if (!_town.pressureWheel) {
+ _town.pressureWheel = 1;
+ }
+ break;
+ case 308: // Increase the boiler pressure once.
+ if (!_town.pressureWheel) {
+ execute6263(307);
+ }
+ if (_town.boiler == 2) {
+ say(28, 1);
+ beginRoomAnimation(308, 26, 64, kPressureWheelFrames, ARRAYSIZE(kPressureWheelFrames), true, 60);
+ } else {
+ say(28, _town.boiler == 3 ? 3 : 0);
+ }
+ break;
+ case 1308:
+ _town.pressureWheel = 2;
+ _town.boiler = 3;
+ say(28, 2);
+ break;
+ case 309: // Load the sheriff's firewood into the boiler.
+ say(29);
+ beginRoomAnimation(309, 28, 162);
+ _actionFrames.insert_at(0, 0);
+ _inventory.select(0);
+ break;
+ case 1309:
+ _town.boiler = 1;
+ _inventory.remove(14);
+ break;
+ case 310: // Reject unsuitable fuel.
+ say(30, _town.boiler >= 2);
+ break;
+ case 313: // Light a fueled boiler only when the water tank is full.
+ if (!_town.boiler) {
+ say(33);
+ } else if (_town.boiler >= 2) {
+ say(33, 5);
+ } else if (_town.waterTank < 5) {
+ say(33, _town.waterTank ? 2 : 1);
+ } else {
+ say(33, 3);
+ byte frames[92];
+ for (uint i = 0; i < ARRAYSIZE(frames); ++i) {
+ frames[i] = i < 24 ? (i ? i - 1 : 0) : i < 70 ? 22 : 91 - i;
+ }
+ beginRoomAnimation(313, 29, 23, frames, ARRAYSIZE(frames));
+ _inventory.select(0);
+ }
+ break;
+ case 1313:
+ say(33, 4);
+ break;
+ case 315: // Refuse to drive the derailed locomotive.
+ say(35, _town.boiler >= 2);
+ break;
+ case 316: // Identify the tank's drainage lever.
+ say(36, _town.drainSeen);
+ _town.drainSeen = 1;
+ break;
+ case 1400: // Finish entering the cab.
+ _position = Common::Point(252, 492);
+ _walkPath.reset(_position);
+ _facing = 4;
+ if (!_town.cabVisited) {
+ say(20);
+ _town.cabVisited = 1;
+ }
+ break;
+ case 1401: // Release the lever after the exterior steam shot.
+ _position = Common::Point(287, 505);
+ _walkPath.reset(_position);
+ _facing = 1;
+ say(26, 2);
+ break;
+ default:
+ return kUnhandled;
+ }
+ return kHandled;
+}
+
+void RunawayRoomScene::locomotiveAnimationFrame() {
+ if (_room == 6260) {
+ if (_roomAction == 304 && _actionStep == 20) {
+ _audio.playEffect(20);
+ } else if (_roomAction == 401 && _actionStep == 32) {
+ _audio.playEffect(22);
+ } else if (_roomAction == 313 && _actionStep == 37) {
+ _audio.playEffect(21, 178);
+ } else if (_roomAction == 402) {
+ if (_actionStep == 3) {
+ _audio.playEffect(56, 230);
+ } else if (_actionStep == 17) {
+ _audio.playEffect(57, 255, 1);
+ }
+ }
+ return;
+ }
+ if (_roomAction == 400 && _actionStep == 13) {
+ _audio.playEffect(23, 204);
+ } else if (_roomAction == 302 && _actionStep == 10) {
+ _audio.playEffect(81, 204);
+ } else if ((_roomAction == 306 && (_actionStep == 16 || _actionStep == 43)) ||
+ (_roomAction == 401 && _actionStep == 3)) {
+ _audio.playEffect(54);
+ } else if (_roomAction == 308 && _actionStep == 23) {
+ _audio.playEffect(55);
+ } else if (_roomAction == 309) {
+ if (_actionStep == 12) {
+ _audio.playEffect(24);
+ } else if (_actionStep == 53) {
+ _audio.playEffect(25);
+ }
+ } else if (_roomAction == 313) {
+ if (_actionStep == 23) {
+ _audio.playEffect(52, 255, 0, true);
+ } else if (_actionStep == 35) {
+ _town.boiler = 2;
+ _ambientFrame = 0;
+ _ambientTick = _now;
+ _audio.playEffect(53, 178, 1, true);
+ } else if (_actionStep == 70) {
+ _audio.stopEffect(0);
+ }
+ }
+}
+
+} // End of namespace Hollywood
diff --git a/engines/hollywood/runaway/scene6350.cpp b/engines/hollywood/runaway/scene6350.cpp
index 2be4a8030a9..a5c4327b943 100644
--- a/engines/hollywood/runaway/scene6350.cpp
+++ b/engines/hollywood/runaway/scene6350.cpp
@@ -46,6 +46,9 @@ const RunawayRoom kRunawayScene6350 = {
};
void RunawayRoomScene::resumeTown() {
+ if (_room == 6263) {
+ resume6263();
+ }
if (!_entering) {
if (!_audio.musicPlaying()) {
_audio.playMusic(_room == 6200 || _room == 6210 ? 18 : 11);
@@ -79,6 +82,8 @@ void RunawayRoomScene::resumeTown() {
start6210();
} else if (_room == 6220) {
start6220();
+ } else if (_room == 6260) {
+ start6260();
} else if (_room == 6370) {
_town.streetVisited = 1;
start6370();
@@ -86,6 +91,9 @@ void RunawayRoomScene::resumeTown() {
}
void RunawayRoomScene::updateTown() {
+ if (_room == 6263) {
+ update6263();
+ }
if (_townEncounter.phase != TownEncounter::kInactive) {
update6220();
return;
@@ -108,6 +116,10 @@ void RunawayRoomScene::deferTownAction(uint16 action) {
}
void RunawayRoomScene::townAnimationFrame() {
+ if (_room == 6260 || _room == 6263) {
+ locomotiveAnimationFrame();
+ return;
+ }
if (_room == 6200 && _roomAction == 314) {
if (_actionStep == 13) {
_audio.playEffect(58);
diff --git a/engines/hollywood/runaway/scene_data.h b/engines/hollywood/runaway/scene_data.h
index e2763ee4e5a..515404ea6f1 100644
--- a/engines/hollywood/runaway/scene_data.h
+++ b/engines/hollywood/runaway/scene_data.h
@@ -108,6 +108,8 @@ extern const RunawayRoom kRunawayScene6190;
extern const RunawayRoom kRunawayScene6200;
extern const RunawayRoom kRunawayScene6210;
extern const RunawayRoom kRunawayScene6220;
+extern const RunawayRoom kRunawayScene6260;
+extern const RunawayRoom kRunawayScene6263;
extern const RunawayRoom kRunawayScene6350;
extern const RunawayRoom kRunawayScene6370;
Commit: 149d592b748f52f16cda79db27c63eb08d321374
https://github.com/scummvm/scummvm/commit/149d592b748f52f16cda79db27c63eb08d321374
Author: neuromancer (gustavo.grieco at gmail.com)
Date: 2026-11-19T19:38:52+01:00
Commit Message:
HOLLYWOOD: RUNAWAY: implemented scenes 6014, 6080, 6090 and 6130
Changed paths:
A engines/hollywood/runaway/scene6014.cpp
A engines/hollywood/runaway/scene6080.cpp
A engines/hollywood/runaway/scene6090.cpp
A engines/hollywood/runaway/scene6130.cpp
engines/hollywood/module.mk
engines/hollywood/runaway/inventory.cpp
engines/hollywood/runaway/saveload.cpp
engines/hollywood/runaway/saveload.h
engines/hollywood/runaway/scene.cpp
engines/hollywood/runaway/scene.h
engines/hollywood/runaway/scene4070.cpp
engines/hollywood/runaway/scene6260.cpp
engines/hollywood/runaway/scene6350.cpp
engines/hollywood/runaway/scene_data.h
diff --git a/engines/hollywood/module.mk b/engines/hollywood/module.mk
index 0c8a70cbf47..cdc926a95e2 100644
--- a/engines/hollywood/module.mk
+++ b/engines/hollywood/module.mk
@@ -175,6 +175,10 @@ MODULE_OBJS = \
runaway/scene5140.o \
runaway/scene5160.o \
runaway/scene5170.o \
+ runaway/scene6014.o \
+ runaway/scene6080.o \
+ runaway/scene6090.o \
+ runaway/scene6130.o \
runaway/scene6190.o \
runaway/scene6200.o \
runaway/scene6210.o \
diff --git a/engines/hollywood/runaway/inventory.cpp b/engines/hollywood/runaway/inventory.cpp
index 38d45433fef..0d44aa5e33a 100644
--- a/engines/hollywood/runaway/inventory.cpp
+++ b/engines/hollywood/runaway/inventory.cpp
@@ -285,6 +285,12 @@ RunawayInventory::Reply RunawayInventory::examine(byte item) const {
return Reply(207);
case 20: // Ancient stapler.
return Reply(212);
+ case 23: // Oil can.
+ return Reply(214);
+ case 29: // Stone with a hole.
+ return Reply(219);
+ case 31: // Clay vessel.
+ return Reply(221);
case 32: // Bank stamp.
return Reply(222);
default:
diff --git a/engines/hollywood/runaway/saveload.cpp b/engines/hollywood/runaway/saveload.cpp
index 8f38d491035..9cee9262372 100644
--- a/engines/hollywood/runaway/saveload.cpp
+++ b/engines/hollywood/runaway/saveload.cpp
@@ -237,6 +237,15 @@ void RunawaySaveState::sync(Common::Serializer &s) {
s.syncAsByte(town.oilCanFull, 10);
s.syncAsByte(town.bottleContents, 10);
s.syncAsByte(town.craterSeen, 10);
+ s.syncAsByte(town.mineVisited, 11);
+ s.syncAsByte(town.oilCan, 11);
+ s.syncAsByte(town.rockMoved, 11);
+ s.syncAsByte(town.houseVisited, 11);
+ s.syncAsByte(town.stone, 11);
+ s.syncAsByte(town.vessel, 11);
+ s.syncAsByte(town.oscarMet, 11);
+ s.syncAsByte(town.oscarHelpRefused, 11);
+ s.syncAsByte(town.rawTobaccoRefused, 11);
}
byte RunawaySaveState::chapter() const {
@@ -338,6 +347,11 @@ bool RunawaySaveState::valid() const {
return false;
}
bool owned[33] = {};
+ if (town.mineVisited > 1 || town.oilCan > 2 || town.rockMoved > 1 ||
+ town.houseVisited > 1 || town.stone > 2 || town.vessel > 2 ||
+ town.oscarMet > 1 || town.oscarHelpRefused > 1 || town.rawTobaccoRefused > 1) {
+ return false;
+ }
if (town.locomotiveVisited > 1 || town.locomotiveKey > 3 || town.waterTank > 5 ||
town.cabVisited > 1 || town.cabExited > 1 || town.boiler > 3 ||
town.steamLever > 2 || town.pressureWheel > 2 || town.drainSeen > 1 ||
@@ -366,7 +380,7 @@ bool RunawaySaveState::read(Common::SeekableReadStream &stream) {
if (stream.readUint32BE() != MKTAG('R', 'U', 'N', 'A'))
return false;
const uint16 version = stream.readUint16LE();
- if (version < 1 || version > 10)
+ if (version < 1 || version > 11)
return false;
Common::Serializer s(&stream, nullptr);
s.setVersion(version);
@@ -378,9 +392,9 @@ bool RunawaySaveState::write(Common::WriteStream &stream) {
if (!valid())
return false;
stream.writeUint32BE(MKTAG('R', 'U', 'N', 'A'));
- stream.writeUint16LE(10);
+ stream.writeUint16LE(11);
Common::Serializer s(nullptr, &stream);
- s.setVersion(10);
+ s.setVersion(11);
sync(s);
return !s.err();
}
diff --git a/engines/hollywood/runaway/saveload.h b/engines/hollywood/runaway/saveload.h
index 35beb6cc3bc..a8c88184697 100644
--- a/engines/hollywood/runaway/saveload.h
+++ b/engines/hollywood/runaway/saveload.h
@@ -95,6 +95,9 @@ struct RunawaySaveState {
byte cabVisited = 0, cabExited = 0, boiler = 0;
byte steamLever = 0, pressureWheel = 0, drainSeen = 0;
byte oilCanFull = 0, bottleContents = 0, craterSeen = 0;
+ byte mineVisited = 0, oilCan = 0, rockMoved = 0;
+ byte houseVisited = 0, stone = 0, vessel = 0;
+ byte oscarMet = 0, oscarHelpRefused = 0, rawTobaccoRefused = 0;
} town;
uint16 scene = 5030, x = 623, y = 447, camera = 111;
diff --git a/engines/hollywood/runaway/scene.cpp b/engines/hollywood/runaway/scene.cpp
index 3bfbc5653b2..27347bfd66f 100644
--- a/engines/hollywood/runaway/scene.cpp
+++ b/engines/hollywood/runaway/scene.cpp
@@ -39,6 +39,7 @@ const RunawayRoom *const kRooms[] = {
&kRunawayScene5010, &kRunawayScene5020, &kRunawayScene5050, &kRunawayScene5060, &kRunawayScene5070,
&kRunawayScene5080, &kRunawayScene5100, &kRunawayScene5110, &kRunawayScene5130, &kRunawayScene5140,
&kRunawayScene5160, &kRunawayScene5170,
+ &kRunawayScene6014, &kRunawayScene6080, &kRunawayScene6090, &kRunawayScene6130,
&kRunawayScene6190, &kRunawayScene6200, &kRunawayScene6210,
&kRunawayScene6220, &kRunawayScene6260, &kRunawayScene6263,
&kRunawayScene6350, &kRunawayScene6370
@@ -81,7 +82,13 @@ const RunawayRoom *findRoom(int number) {
number -= number % 10;
else if (number >= 6221 && number <= 6225)
number = 6220;
- else if (number == 6201) {
+ else if (number == 6015) {
+ number = 6014;
+ } else if (number == 6081 || number == 6082) {
+ number = 6080;
+ } else if (number == 6131) {
+ number = 6130;
+ } else if (number == 6201) {
number = 6200;
} else if (number == 6261 || number == 6262 || number == 6265) {
number = 6260;
@@ -256,12 +263,13 @@ bool RunawayRoomScene::enterRoom(uint16 number, Common::Point position, byte fac
const RunawayRoom *room = findRoom(number);
if (!room || position.x < 0 || position.x >= room->width || position.y < 0 || position.y >= room->height)
return false;
- const Common::Path path(Common::String::format("RESOURCE.%c%02u", 'A' + number / 1000 - 1, (number % 1000) / 10));
+ const Common::Path path(Common::String::format("RESOURCE.%c%02u", 'A' + number / 1000 - 1,
+ number == 6014 ? 3 : (number % 1000) / 10));
if (!_archive.open(path, 40) ||
- !_text.load("RESOURCE.003", "Runaway room", number == kMuseumWilly ? 406 : number / 10, 0, 0x1135))
+ !_text.load("RESOURCE.003", "Runaway room", number == kMuseumWilly ? 406 : number == 6014 ? 608 : number / 10, 0, 0x1135))
return false;
- if (number == 5140) {
- // The bus introduction has only a background and four sprite tracks.
+ if (number == 5140 || number == 6014) {
+ // These cutscenes contain a background and sprite tracks, without a mask.
_mask.resize(room->width * room->height, 0);
_originalMaps.resize(1536, 0);
} else if (!loadRunawayMask(_archive, room->width, room->height, _mask, _originalMaps, number == 6263 ? 21 : 1)) {
@@ -318,6 +326,16 @@ bool RunawayRoomScene::enterRoom(uint16 number, Common::Point position, byte fac
case kMuseumKeypad:
loaded = loadScene4140();
break;
+ case 6080:
+ loaded = _ambient.load(_archive, 6, 2) && loadForeground(0, 4) && loadForeground(1, 7) &&
+ (_entryScene != 6082 || _npc.load(_archive, 9, 135));
+ break;
+ case 6090:
+ loaded = _npc.load(_archive, 6, 113) && loadForeground(0, 4);
+ break;
+ case 6130:
+ loaded = _npc.load(_archive, 6, 106);
+ break;
case 6200:
loaded = _ambient.load(_archive, 6, 26);
break;
@@ -392,6 +410,12 @@ bool RunawayRoomScene::rebuildBackground() {
return applyBackground4090();
case kMuseumSecurity:
return applyBackground4100();
+ case 6080:
+ return _town.oilCan != 2 || applyPatch(5);
+ case 6090:
+ return _town.vessel != 2 || applyPatch(5);
+ case 6130:
+ return (_town.stone != 2 || applyPatch(4)) && (_town.vessel != 2 || applyPatch(5));
case 6190:
return applyBackground6190();
case 6200:
@@ -428,6 +452,18 @@ void RunawayRoomScene::updateMaps() {
return;
}
switch (_room) {
+ case 6080:
+ updateMaps6080();
+ break;
+ case 6090:
+ case 6130:
+ for (uint i = 0; i < 256; ++i) {
+ if ((_room == 6090 && _maps[256 + i] == 6 && _town.vessel == 2) ||
+ (_room == 6130 && _maps[256 + i] == 4 && _town.stone == 2)) {
+ _maps[256 + i] = 0;
+ }
+ }
+ break;
case 6190:
updateMaps6190();
break;
@@ -486,6 +522,15 @@ Common::U32String RunawayRoomScene::hotspotName(byte id) const {
return desertHotspotName(id);
if (_room == 6350 && id == 2 && _town.arrived)
return Common::U32String("Douglasville");
+ if (_room == 6350 && id == 3 && _town.houseVisited) {
+ return Common::U32String("Mama Dorita's house");
+ }
+ if (_room == 6080 && id == 2 && _town.oilCan) {
+ return Common::U32String("Oil can");
+ }
+ if (_room == 6090 && id == 4 && _town.oscarTobacco) {
+ return Common::U32String("Oscar");
+ }
if (_room == 6220 && id == 8 && _town.strapSeen)
return Common::U32String("Strap");
if (_room == 6263) {
@@ -533,8 +578,8 @@ Common::U32String RunawayRoomScene::actionCaption(byte id, RunawayVerb verb, byt
void RunawayRoomScene::walkTo(Common::Point target, byte facing, bool scripted) {
if (scripted) {
_walkPath.setTarget(target);
- } else if (_room == 6260) {
- walk6260(target);
+ } else if (_room == 6080 || _room == 6260) {
+ walkTown(target);
} else {
_walkPath.findPath(RunawayWalkMap(_background.w, _background.h, _mask, _maps), target);
}
@@ -590,6 +635,9 @@ void RunawayRoomScene::click(Common::Point mouse, RunawayVerb verb, byte item) {
if (_room == 6260 && id == 5 && !index && _town.locomotiveKey == 2) {
approach = false;
}
+ if (_room == 6130 && id == 4 && !index && _town.stone) {
+ approach = false;
+ }
if (_room == kHospitalBathroom && id == 4 && !index && _hospital.alcohol == 2)
approach = false;
if (item) {
@@ -655,6 +703,10 @@ void RunawayRoomScene::sayInventory(const RunawayInventory::Reply &reply) {
_walkPath.clear();
_pendingHotspot = 0;
_caption.clear();
+ if (townChapter() && reply.cue == 214) {
+ say(214, _town.oilCanFull, true);
+ return;
+ }
if (_game == kRunawayFullGame && !desertChapter() && !townChapter() &&
(museumChapter() ? sayMuseumInventory(reply) : sayHospitalInventory(reply)))
return;
@@ -717,6 +769,18 @@ void RunawayRoomScene::execute(uint16 action) {
case kMuseumSecurity:
result = execute4100(action);
break;
+ case 6014:
+ result = execute6014(action);
+ break;
+ case 6080:
+ result = execute6080(action);
+ break;
+ case 6090:
+ result = execute6090(action);
+ break;
+ case 6130:
+ result = execute6130(action);
+ break;
case 6190:
result = execute6190(action);
break;
@@ -819,6 +883,13 @@ float RunawayRoomScene::actorHeight() const {
return actorHeight4090();
case kMuseumSecurity:
return actorHeight4100();
+ case 6080:
+ return _position.y * 1.12355208f - 218.007721f;
+ case 6090:
+ return _position.y < 510 ? _position.y * 0.840707958f - 38.7610626f :
+ _position.y * 0.730337083f + 17.5280895f;
+ case 6130:
+ return _position.y * 1.027668f - 160.57312f;
case 6190:
return (_position.y * 0.426829278f + 16.4634151f + _position.x * 0.0980392173f + 41.7647057f) / 2;
case 6200:
@@ -940,6 +1011,10 @@ void RunawayRoomScene::draw() {
drawScene5140(viewport);
return;
}
+ if (_room == 6014) {
+ drawScene6014(viewport);
+ return;
+ }
if (_room == 6350)
return;
if (_room == 5010) {
@@ -950,7 +1025,13 @@ void RunawayRoomScene::draw() {
drawScene4140(viewport);
return;
}
- if (_room == 6200) {
+ if (_room == 6080) {
+ drawScene6080(viewport, false);
+ } else if (_room == 6090) {
+ drawScene6090(viewport, false);
+ } else if (_room == 6130) {
+ _npc.draw(viewport, oscarFrame(), _camera.x, -_camera.y);
+ } else if (_room == 6200) {
drawScene6200(viewport);
} else if (_room == 6220) {
drawScene6220(viewport);
@@ -991,6 +1072,10 @@ void RunawayRoomScene::draw() {
case kMuseumSecurity:
setupDepth4100(params);
break;
+ case 6130:
+ params.depthY[1] = 480;
+ params.depthY[2] = 599;
+ break;
case 6190:
params.depthY[1] = 599;
params.depthY[2] = 388;
@@ -1048,7 +1133,11 @@ void RunawayRoomScene::draw() {
drawForeground4030(viewport);
else if (_room == kMuseumLaboratory)
drawForeground4050(viewport);
- else if (_room == 6260) {
+ else if (_room == 6080) {
+ drawScene6080(viewport, true);
+ } else if (_room == 6090) {
+ drawScene6090(viewport, true);
+ } else if (_room == 6260) {
drawForeground(viewport, 0);
}
}
@@ -1079,7 +1168,7 @@ void RunawayRoomScene::beginRoomAnimation(uint16 action, uint chunk, uint frames
_actionStarted = _now;
}
-void RunawayRoomScene::beginRoomAnimationRange(uint16 action, uint chunk, uint frames, uint first, uint last, bool hideActor) {
+void RunawayRoomScene::beginRoomAnimationRange(uint16 action, uint chunk, uint frames, uint first, uint last, bool hideActor, uint frameDuration) {
Common::Array<byte> order;
assert(first < frames && last < frames && frames <= 256);
for (int frame = first;; frame += first <= last ? 1 : -1) {
@@ -1087,7 +1176,7 @@ void RunawayRoomScene::beginRoomAnimationRange(uint16 action, uint chunk, uint f
if (frame == (int)last)
break;
}
- beginRoomAnimation(action, chunk, frames, order.data(), order.size(), hideActor);
+ beginRoomAnimation(action, chunk, frames, order.data(), order.size(), hideActor, frameDuration);
}
void RunawayRoomScene::holdRoomAnimation(uint16 action, uint chunk, uint frames, uint frame, bool hideActor) {
diff --git a/engines/hollywood/runaway/scene.h b/engines/hollywood/runaway/scene.h
index c82b5a10531..63a9ae01fa1 100644
--- a/engines/hollywood/runaway/scene.h
+++ b/engines/hollywood/runaway/scene.h
@@ -143,7 +143,7 @@ private:
void finishHospitalFilm();
void adaptGogFilm(const RunawaySequence::Command *commands);
void beginRoomAnimation(uint16 action, uint chunk, uint frames, const byte *order = nullptr, uint count = 0, bool hideActor = true, uint frameDuration = 80);
- void beginRoomAnimationRange(uint16 action, uint chunk, uint frames, uint first, uint last, bool hideActor = true);
+ void beginRoomAnimationRange(uint16 action, uint chunk, uint frames, uint first, uint last, bool hideActor = true, uint frameDuration = 80);
void holdRoomAnimation(uint16 action, uint chunk, uint frames, uint frame, bool hideActor = true);
void loopRoomAnimationDuringSpeech(uint16 action, uint chunk, uint frames, uint first, uint last, bool hideActor = true);
void setRoomAnimationOverlay(uint chunk, uint frames, const byte *order, uint count);
@@ -293,8 +293,25 @@ private:
void updateTown();
void leaveTownRoom(uint16 scene);
void deferTownAction(uint16 action);
+ void walkTown(Common::Point target);
void startTownFilm(byte film);
void finishTownFilm();
+ ActionResult execute6014(uint16 action);
+ void drawScene6014(Graphics::ManagedSurface &viewport);
+ void start6080();
+ ActionResult execute6080(uint16 action);
+ void updateMaps6080();
+ void drawScene6080(Graphics::ManagedSurface &viewport, bool foreground);
+ void mineAnimationFrame();
+ void start6090();
+ ActionResult execute6090(uint16 action);
+ void drawScene6090(Graphics::ManagedSurface &viewport, bool foreground);
+ void startOscarConversation();
+ void oscarDialogueChoice(byte effect);
+ void updateOscar();
+ uint oscarFrame() const;
+ void start6130();
+ ActionResult execute6130(uint16 action);
void start6190();
ActionResult execute6190(uint16 action);
bool applyBackground6190();
@@ -310,7 +327,6 @@ private:
ActionResult execute6260(uint16 action);
bool applyBackground6260();
void updateMaps6260();
- void walk6260(Common::Point target);
bool loadScene6263();
void resume6263();
void update6263();
@@ -373,6 +389,10 @@ private:
RunawaySaveState::Museum _museum;
RunawaySaveState::Desert _desert;
RunawaySaveState::Town _town;
+ uint16 _oscarStep = 130;
+ byte _oscarIdle = 3;
+ uint32 _oscarTick = 0;
+ bool _oscarTalking = false, _mineOscarPresent = false;
RunawayAnimation _locomotiveGauges[4];
byte _locomotiveGaugeFrames[4] = {};
byte _townFilm = 0;
diff --git a/engines/hollywood/runaway/scene4070.cpp b/engines/hollywood/runaway/scene4070.cpp
index e6014456dc0..e4339a9d927 100644
--- a/engines/hollywood/runaway/scene4070.cpp
+++ b/engines/hollywood/runaway/scene4070.cpp
@@ -207,7 +207,7 @@ void RunawayRoomScene::buildDialogueChoices() {
for (uint i = 0; i < 8; ++i) {
if (!_dialogue[page][i].enabled)
continue;
- const SceneSpeechCue cue = _text.stageCue(80, _dialogue[page][i].player);
+ const SceneSpeechCue cue = _text.stageCue(_conversation == 6 ? 81 : 80, _dialogue[page][i].player);
const Common::U32String text(_text.largeTextRecord(cue.textRecordId), Common::kDos850);
if (!text.empty()) {
_choices.push_back(text);
@@ -233,14 +233,14 @@ void RunawayRoomScene::chooseDialogue(uint choice) {
DialogueChoice &entry = _dialogue[page][index];
_choices.clear();
_choiceIndices.clear();
- say(80, entry.player);
+ say(_conversation == 6 ? 81 : 80, entry.player);
if (_conversation == 2 && _museum.willyMet == 1) {
_dialogueEnding = true;
_afterConversation = 408;
return;
}
if (entry.response != 255)
- say(90, entry.response, false, 1);
+ say(_conversation == 6 ? 91 : 90, entry.response, false, 1);
if (_conversation == 3)
_computerReject = true;
if (entry.disable)
@@ -251,6 +251,9 @@ void RunawayRoomScene::chooseDialogue(uint choice) {
_desert.ventSeen = 1;
if (_conversation == 5)
sushiDialogueChoice(entry.disable);
+ if (_conversation == 6) {
+ oscarDialogueChoice(entry.disable);
+ }
if (_conversation == 2 && entry.disable == 10) {
_dialogue[10][3].player = 22;
_dialogue[10][3].response = 21;
@@ -299,7 +302,7 @@ void RunawayRoomScene::finishConversation() {
_choices.clear();
_choiceIndices.clear();
if (_afterConversation) {
- if (character == 5)
+ if (townChapter())
deferTownAction(_afterConversation);
else
deferMuseumAction(_afterConversation);
diff --git a/engines/hollywood/runaway/scene6014.cpp b/engines/hollywood/runaway/scene6014.cpp
new file mode 100644
index 00000000000..1b22561b6c5
--- /dev/null
+++ b/engines/hollywood/runaway/scene6014.cpp
@@ -0,0 +1,63 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+
+
+#include "common/util.h"
+#include "hollywood/runaway/scene.h"
+
+namespace Hollywood {
+
+// Both shaft actions use RESOURCE.F03 and the mine entrance's text.
+const RunawayRoom kRunawayScene6014 = {
+ 6014, 1024, 600, nullptr, 0, {{100, 100, 100}},
+ Common::Point(512, 500), nullptr, 0, nullptr, 0, nullptr, 0
+};
+
+RunawayRoomScene::ActionResult RunawayRoomScene::execute6014(uint16 action) {
+ switch (action) {
+ case 400: // Lean over the shaft.
+ beginRoomAnimationRange(400, 1, 41, 0, 29, true, 60);
+ break;
+ case 1400: // Look down, or explain why the ladder cannot be used.
+ say(_entryScene == 6015 ? 3 : 2, _entryScene == 6015 ? 0 : _random.getRandomNumber(3));
+ holdRoomAnimation(401, 1, 41, 29);
+ break;
+ case 1401: // Withdraw from the opening.
+ beginRoomAnimationRange(402, 1, 41, 29, 0, true, 60);
+ break;
+ case 1402:
+ leaveTownRoom(6081);
+ break;
+ default:
+ return kUnhandled;
+ }
+ return kHandled;
+}
+
+void RunawayRoomScene::drawScene6014(Graphics::ManagedSurface &viewport) {
+ if (drawingRoomAnimation()) {
+ const uint frame = _roomAction == 401 ? 29 + speechFrame() :
+ _actionFrames[MIN<uint>(_actionStep, _actionFrames.size() - 1)];
+ _actionAnimation.draw(viewport, frame, 0, 0);
+ }
+}
+
+} // End of namespace Hollywood
diff --git a/engines/hollywood/runaway/scene6080.cpp b/engines/hollywood/runaway/scene6080.cpp
new file mode 100644
index 00000000000..7141e6a4eb0
--- /dev/null
+++ b/engines/hollywood/runaway/scene6080.cpp
@@ -0,0 +1,225 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+
+
+#include "common/util.h"
+#include "hollywood/runaway/scene.h"
+
+namespace Hollywood {
+namespace {
+
+const RunawayHotspot kHotspots[] = {
+ {"", 0, 0, 0, {0, 0}, {0, 0}},
+ {"Path", 0, 550, 0, {301, 302}, {0, 3}},
+ {"Recipient", 95, 358, 7, {305, 306}, {0, 1}},
+ {"Hole that Gina fell into", 483, 318, 0, {303, 304}, {1, 1}},
+ {"Stone", 656, 347, 1, {307, 308}, {0, 0}},
+ {"Entrance to the mine", 656, 347, 1, {309, 310}, {0, 1}},
+ {"Mining car", 0, 0, 0, {311, 312}, {0, 0}},
+ {"Chest", 0, 0, 4, {313, 314}, {0, 0}}
+};
+
+const RunawayResponse kResponses[] = {
+ {6080, 301, 1, 0}, // Look toward the helicopter's landing place.
+ {6080, 311, 10, 0}, // Examine the mining car's broken wheel.
+ {6080, 312, 11, 0}, // Try to move the car.
+ {6080, 313, 12, 0}, // Examine the empty tool chest.
+ {6080, 314, 13, 0}, // Refuse to take the chest.
+ {6080, 315, 14, 0}, // Throw an item down the shaft.
+ {6080, 316, 15, 0}, // Try to lower the rope.
+ {6080, 317, 16, 0} // The strap is too short for the shaft.
+};
+
+const RunawayItemAction kItemActions[] = {
+ {6080, 11, 3, 317, false}, // Use the strap at the shaft.
+ {6080, 19, 3, 316, false}, // Use the rope at the shaft.
+ {6080, 0, 3, 315, false} // Throw another item down the shaft.
+};
+
+} // End of anonymous namespace
+
+const RunawayRoom kRunawayScene6080 = {
+ 6080, 1412, 600, kHotspots, ARRAYSIZE(kHotspots),
+ {{100, 100, 100}, {95, 90, 80}}, Common::Point(141, 457),
+ kResponses, ARRAYSIZE(kResponses), kItemActions, ARRAYSIZE(kItemActions), nullptr, 0
+};
+
+void RunawayRoomScene::start6080() {
+ if (_entryScene == 6081) {
+ _position = Common::Point(483, 318);
+ _walkPath.reset(_position);
+ _facing = 0;
+ } else if (_entryScene == 6082) {
+ _position = Common::Point(844, 362);
+ _walkPath.reset(_position);
+ _facing = 7;
+ _mineOscarPresent = true;
+ say(20, 0, false, 1);
+ say(20, 1);
+ say(20, 2, false, 1);
+ beginRoomAnimationRange(403, 9, 135, 6, 133, false, 60);
+ } else {
+ _facing = 1;
+ if (!_town.mineVisited) {
+ say(0);
+ deferTownAction(400);
+ }
+ }
+}
+
+void RunawayRoomScene::updateMaps6080() {
+ for (uint i = 0; i < 256; ++i) {
+ // Zone 6 is only used by scripted approaches to the mine.
+ if (_maps[i] == 6) {
+ _maps[i] = 0;
+ }
+ byte &id = _maps[256 + i];
+ if (id == 2 && _town.oilCan == 2) {
+ id = 0;
+ } else if (id == 4 && _town.rockMoved) {
+ id = 5;
+ }
+ }
+}
+
+void RunawayRoomScene::drawScene6080(Graphics::ManagedSurface &viewport, bool foreground) {
+ if (foreground) {
+ if (_position.x > 737) {
+ drawForeground(viewport, 0);
+ }
+ if (_position.x > 754 && _position.y < 398) {
+ drawForeground(viewport, 1);
+ }
+ return;
+ }
+ if (!_mineOscarPresent || _town.rockMoved) {
+ _ambient.draw(viewport, _town.rockMoved, _camera.x, -_camera.y);
+ }
+ if (_mineOscarPresent && !drawingRoomAnimation()) {
+ const byte mouth = speaker() ? speechFrame() % 6 : 0;
+ const uint frame = _town.rockMoved ? (mouth ? 128 + mouth : 134) : mouth;
+ _npc.draw(viewport, frame, _camera.x, -_camera.y);
+ }
+}
+
+RunawayRoomScene::ActionResult RunawayRoomScene::execute6080(uint16 action) {
+ switch (action) {
+ case 302: // Return to the overview.
+ leaveTownRoom(6350);
+ break;
+ case 303: // Look down the shaft.
+ case 304: // Try to descend its broken ladder.
+ leaveTownRoom(action == 303 ? 6014 : 6015);
+ break;
+ case 305: // Identify the oil can.
+ say(4, _town.oilCan != 0);
+ if (!_town.oilCan) {
+ _town.oilCan = 1;
+ }
+ break;
+ case 306: // Take the oil can.
+ if (!_town.oilCan) {
+ execute6080(305);
+ }
+ deferTownAction(406);
+ break;
+ case 406:
+ _town.oilCan = 2;
+ _inventory.add(23);
+ say(5);
+ return kBackgroundChanged;
+ case 307: // Examine the rock blocking the mine.
+ say(6, _town.rockMoved ? 1 : _town.sushiMet ? 2 : 0);
+ break;
+ case 308: // Try to move the rock.
+ say(7, _town.rockMoved);
+ break;
+ case 309: // Examine the entrance.
+ say(8, _town.rockMoved);
+ break;
+ case 310: // Enter only with the map, light and rope.
+ if (!_town.rockMoved) {
+ say(9);
+ } else if (!_inventory.contains(17)) {
+ say(9, 1);
+ } else if (!_inventory.contains(18) || !_inventory.contains(19)) {
+ say(9, 2);
+ } else {
+ leaveTownRoom(7000);
+ }
+ break;
+ case 400: // First visit: approach the blocked entrance.
+ walkTo(Common::Point(656, 347), 1);
+ deferTownAction(401);
+ break;
+ case 401:
+ say(6, 2);
+ _town.mineVisited = 1;
+ break;
+ case 1403: // Oscar has pushed the rock aside.
+ _town.rockMoved = 1;
+ say(20, 3, false, 1);
+ say(20, 4);
+ say(20, 5, false, 1);
+ say(20, 6);
+ say(20, 7, false, 1);
+ deferTownAction(404);
+ return kBackgroundChanged;
+ case 404: // Watch Oscar head back to the house.
+ _facing = 5;
+ beginRoomAnimation(404, 10, 128, nullptr, 0, false, 60);
+ break;
+ case 1404:
+ _mineOscarPresent = false;
+ walkTo(Common::Point(734, 402), 5, true);
+ deferTownAction(405);
+ break;
+ case 405:
+ say(20, 8);
+ break;
+ default:
+ return kUnhandled;
+ }
+ return kHandled;
+}
+
+void RunawayRoomScene::mineAnimationFrame() {
+ if (_roomAction == 403) {
+ const uint frame = _actionFrames[_actionStep];
+ if (frame == 41) {
+ _audio.playEffect(64);
+ }
+ if (frame == 18 || frame == 26 || frame == 33 || frame == 44 || frame == 53 ||
+ frame == 62 || frame == 82 || frame == 93 || frame == 111 || frame == 118 || frame == 125) {
+ _audio.playFootstep(2, _random.getRandomBit(), 77);
+ }
+ } else if (_roomAction == 404) {
+ static const byte footsteps[] = {10, 18, 25, 31, 37, 44, 50, 55, 62, 68, 74, 80, 87, 93, 99, 105, 112, 118, 124};
+ for (uint i = 0; i < ARRAYSIZE(footsteps); ++i) {
+ if (_actionStep == footsteps[i]) {
+ _audio.playFootstep(2, _random.getRandomBit(), MIN<uint>(255, 51 + i * 13));
+ break;
+ }
+ }
+ }
+}
+
+} // End of namespace Hollywood
diff --git a/engines/hollywood/runaway/scene6090.cpp b/engines/hollywood/runaway/scene6090.cpp
new file mode 100644
index 00000000000..55c64109b78
--- /dev/null
+++ b/engines/hollywood/runaway/scene6090.cpp
@@ -0,0 +1,289 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+
+
+#include "common/util.h"
+#include "hollywood/runaway/scene.h"
+
+namespace Hollywood {
+namespace {
+
+const RunawayHotspot kHotspots[] = {
+ {"", 0, 0, 0, {0, 0}, {0, 0}},
+ {"Oil well area", 910, 599, 3, {301, 302}, {0, 3}},
+ {"Entrance to the house", 686, 510, 0, {303, 304}, {0, 0}},
+ {"Sign", 846, 509, 0, {305, 306}, {0, 0}},
+ {"Big dude", 676, 510, 7, {307, 308}, {0, 1}},
+ {"Ladder", 244, 416, 7, {309, 310}, {0, 0}},
+ {"Vessel", 180, 446, 0, {312, 313}, {0, 1}},
+ {"Path", 50, 599, 5, {315, 316}, {0, 3}}
+};
+
+const RunawayResponse kResponses[] = {
+ {6090, 301, 13, 0}, // Look toward the abandoned oil well.
+ {6090, 303, 2, 0}, // Examine the curtain across the doorway.
+ {6090, 305, 4, 0}, // Read Mama Dorita's sign.
+ {6090, 309, 7, 0}, // Examine the ladder.
+ {6090, 315, 1, 0} // Look along the deserted path.
+};
+
+const RunawayItemAction kItemActions[] = {
+ {6090, 27, 4, 314}, // Offer untreated tobacco leaves.
+ {6090, 28, 4, 311} // Give Oscar chewing tobacco.
+};
+
+// Oscar uses the same idle sequence in the wide view and at the doorway.
+const byte kOscarFrames[] = {
+ 106, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29,
+ 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41,
+ 106, 106, 106, 106, 106, 106, 106, 106,
+ 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60,
+ 53, 54, 55, 56, 57, 58, 59, 60, 53, 54, 55, 56, 57, 58, 59, 60,
+ 61, 62, 63, 64, 65, 66, 51, 50, 49, 48, 47, 46, 45, 44, 43, 42,
+ 106, 106, 106, 106, 106, 106, 106, 106, 106,
+ 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106
+};
+
+} // End of anonymous namespace
+
+const RunawayRoom kRunawayScene6090 = {
+ 6090, 1024, 600, kHotspots, ARRAYSIZE(kHotspots),
+ {{100, 100, 100}, {100, 95, 90}, {80, 75, 70}}, Common::Point(838, 551),
+ kResponses, ARRAYSIZE(kResponses), kItemActions, ARRAYSIZE(kItemActions), nullptr, 0
+};
+
+void RunawayRoomScene::start6090() {
+ if (!_town.oscarMet) {
+ walkTo(Common::Point(676, 510), 7);
+ deferTownAction(400);
+ } else {
+ walkTo(Common::Point(837, 550), 7);
+ }
+}
+
+void RunawayRoomScene::updateOscar() {
+ if (_oscarTalking) {
+ _oscarTick = _now;
+ return;
+ }
+ if (_now - _oscarTick < 80) {
+ return;
+ }
+ _oscarTick = _now;
+ const uint last = _oscarIdle == 1 ? 62 : _oscarIdle == 2 ? 121 : _room == 6090 ? 165 : 164;
+ if (_oscarStep < last) {
+ ++_oscarStep;
+ if (_room == 6090 && _oscarIdle == 2 && _oscarStep == 80) {
+ _audio.playEffect(80, 26, 1);
+ }
+ } else if (_oscarIdle == 3 && !_random.getRandomNumber(_room == 6090 ? 4 : 9)) {
+ _oscarIdle = 1 + _random.getRandomBit();
+ _oscarStep = _oscarIdle == 1 ? 0 : 70;
+ } else {
+ _oscarIdle = 3;
+ _oscarStep = 130;
+ }
+ if (_room == 6090 && _oscarIdle == 3 && !_audio.effectPlaying(1)) {
+ _audio.playEffect(76, 153, 1, true);
+ }
+}
+
+uint RunawayRoomScene::oscarFrame() const {
+ if (_oscarTalking) {
+ return 107 + (speaker() ? speechFrame() % 6 : 0);
+ }
+ const uint frame = kOscarFrames[_oscarStep];
+ return _room == 6130 && frame == 106 ? 105 : frame;
+}
+
+void RunawayRoomScene::drawScene6090(Graphics::ManagedSurface &viewport, bool foreground) {
+ if ((_position.y < 460) == foreground && !drawingRoomAnimation()) {
+ _npc.draw(viewport, oscarFrame(), _camera.x, -_camera.y);
+ }
+ if (foreground) {
+ drawForeground(viewport, 0);
+ }
+}
+
+RunawayRoomScene::ActionResult RunawayRoomScene::execute6090(uint16 action) {
+ switch (action) {
+ case 302: // Return to the wide view of the house.
+ leaveTownRoom(6131);
+ break;
+ case 304: // Oscar will not allow Brian into Mama Dorita's house yet.
+ _facing = 4;
+ if (_town.oscarTobacco == 1) {
+ say(3, _random.getRandomBit());
+ } else {
+ say(11, 0, true);
+ }
+ break;
+ case 306: // Refuse to remove the sign.
+ if (_town.oscarTobacco == 1) {
+ say(5);
+ } else {
+ say(14, _random.getRandomNumber(2), true);
+ }
+ break;
+ case 307: { // Look at Oscar.
+ const byte variation = _random.getRandomNumber(2);
+ if (variation == 2) {
+ _facing = 4;
+ }
+ say(6, variation);
+ break;
+ }
+ case 308: // Talk to Oscar.
+ startOscarConversation();
+ break;
+ case 310: // Refuse to sneak into the house via the ladder.
+ if (_town.oscarTobacco == 1) {
+ say(8);
+ } else {
+ say(14, _random.getRandomNumber(2), true);
+ }
+ break;
+ case 311: // Offer the prepared chewing tobacco.
+ _oscarTalking = true;
+ _audio.stopEffect(1);
+ say(9);
+ say(9, 1, false, 1);
+ say(9, 2);
+ deferTownAction(411);
+ break;
+ case 411: { // Oscar and Brian exchange the tobacco.
+ byte oscar[35], brian[35];
+ for (uint i = 0; i < ARRAYSIZE(oscar); ++i) {
+ oscar[i] = i < 6 || i == 34 ? 0 : i - 5;
+ brian[i] = i ? MIN<uint>(23, i - 1) : 0;
+ }
+ beginRoomAnimation(411, 7, 29, oscar, ARRAYSIZE(oscar));
+ setRoomAnimationOverlay(8, 24, brian, ARRAYSIZE(brian));
+ break;
+ }
+ case 1411:
+ _inventory.remove(28);
+ _inventory.select(0);
+ _town.oscarTobacco = 2;
+ say(9, 3, false, 1);
+ say(9, 4);
+ say(9, 5, false, 1);
+ deferTownAction(412);
+ break;
+ case 412:
+ _oscarTalking = false;
+ walkTo(Common::Point(718, 543), 4);
+ say(9, 6);
+ break;
+ case 312: // Examine the clay vessel.
+ say(10);
+ _town.vessel = 1;
+ break;
+ case 313: // Take the vessel while Oscar is occupied.
+ if (!_town.vessel) {
+ execute6090(312);
+ }
+ if (_town.oscarTobacco == 1) {
+ say(11);
+ } else {
+ say(18, 0, true);
+ }
+ deferTownAction(413);
+ break;
+ case 413:
+ _town.vessel = 2;
+ _inventory.add(31);
+ say(11, 1);
+ return kBackgroundChanged;
+ case 314: // Oscar chews tobacco; he does not smoke the untreated leaves.
+ _oscarTalking = true;
+ _audio.stopEffect(1);
+ say(12);
+ say(12, 1, false, 1);
+ _town.rawTobaccoRefused = 1;
+ deferTownAction(401);
+ break;
+ case 316: // Return directly to the overview.
+ leaveTownRoom(6350);
+ break;
+ case 400: // First meeting at Mama Dorita's door.
+ _oscarTalking = true;
+ _audio.stopEffect(1);
+ for (uint i = 0; i <= 14; ++i) {
+ say(0, i, false, (i % 2) == 0);
+ }
+ _town.oscarMet = 1;
+ deferTownAction(401);
+ break;
+ case 401: // Oscar returns to his idle animation.
+ _oscarTalking = false;
+ _oscarIdle = 3;
+ _oscarStep = 130;
+ break;
+ case 402: // Oscar has agreed to move the mine's rock.
+ leaveTownRoom(6082);
+ break;
+ default:
+ return kUnhandled;
+ }
+ return kHandled;
+}
+
+void RunawayRoomScene::startOscarConversation() {
+ _conversation = 6;
+ _dialogueDepth = _dialogueNode = _dialogueIntro = 0;
+ _dialogueEnding = false;
+ _choices.clear();
+ _choiceIndices.clear();
+ memset(_dialogue, 0, sizeof(_dialogue));
+ _afterConversation = 401;
+ _oscarTalking = true;
+ _audio.stopEffect(1);
+ say(81, _town.oscarTobacco == 1 ? 0 : 8);
+ say(91, 0, false, 1);
+
+ // Original page 81: the favour becomes available after Kevin names Oscar.
+ static const DialogueChoice topics[] = {
+ {1, 0, 3, 1, 1, 1, 255}, {1, 0, 3, 2, 2, 1, 255},
+ {1, 0, 3, 3, 3, 1, 255}, {0, 0, 1, 5, 5, 2, 255},
+ {1, 0, 0, 4, 4, 1, 0}
+ };
+ memcpy(_dialogue[0], topics, sizeof(topics));
+ _dialogue[0][1].enabled = _town.oscarTobacco < 2;
+ _dialogue[0][3].enabled = _town.oscarTobacco && !_town.rockMoved;
+ _dialogue[10][0] = {1, 0, 2, 6, (byte)(_town.oscarHelpRefused ? 7 : 6), 3, 255};
+ if (_town.oscarTobacco == 2) {
+ _dialogue[10][0].transition = 0;
+ _dialogue[10][0].response = 8;
+ _dialogue[10][0].disable = 5;
+ }
+}
+
+void RunawayRoomScene::oscarDialogueChoice(byte effect) {
+ if (effect == 3) { // Remember that Oscar has already refused the favour.
+ _town.oscarHelpRefused = 1;
+ } else if (effect == 5) { // A gift of chewing tobacco earns his help.
+ say(81, 7);
+ _afterConversation = 402;
+ }
+}
+
+} // End of namespace Hollywood
diff --git a/engines/hollywood/runaway/scene6130.cpp b/engines/hollywood/runaway/scene6130.cpp
new file mode 100644
index 00000000000..acad5fee687
--- /dev/null
+++ b/engines/hollywood/runaway/scene6130.cpp
@@ -0,0 +1,113 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+
+
+#include "common/util.h"
+#include "hollywood/runaway/scene.h"
+
+namespace Hollywood {
+namespace {
+
+const RunawayHotspot kHotspots[] = {
+ {"", 0, 0, 0, {0, 0}, {0, 0}},
+ {"Path", 0, 599, 5, {301, 302}, {0, 3}},
+ {"House", 402, 374, 1, {303, 304}, {0, 3}},
+ {"Well", 491, 495, 3, {305, 306}, {0, 0}},
+ {"Stone", 486, 519, 3, {307, 308}, {1, 1}},
+ {"Skull", 0, 0, 0, {309, 310}, {0, 0}}
+};
+
+const RunawayResponse kResponses[] = {
+ {6130, 303, 2, 0}, // Look at Oscar in front of the house.
+ {6130, 305, 3, 0}, // Examine the abandoned well.
+ {6130, 309, 7, 0}, // Examine the skull.
+ {6130, 310, 8, 0} // Leave Mama Dorita's decoration alone.
+};
+
+} // End of anonymous namespace
+
+const RunawayRoom kRunawayScene6130 = {
+ 6130, 1024, 600, kHotspots, ARRAYSIZE(kHotspots),
+ {{100, 100, 100}, {100, 95, 90}, {80, 75, 70}}, Common::Point(268, 450),
+ kResponses, ARRAYSIZE(kResponses), nullptr, 0, nullptr, 0
+};
+
+void RunawayRoomScene::start6130() {
+ if (_entryScene == 6131) {
+ _position = Common::Point(401, 375);
+ _walkPath.reset(_position);
+ _facing = 5;
+ } else {
+ _facing = 1;
+ if (!_town.houseVisited) {
+ say(0);
+ deferTownAction(400);
+ }
+ }
+}
+
+RunawayRoomScene::ActionResult RunawayRoomScene::execute6130(uint16 action) {
+ switch (action) {
+ case 301: // Look toward Douglasville.
+ say(1, _town.streetVisited);
+ break;
+ case 302: // Return to the overview.
+ leaveTownRoom(6350);
+ break;
+ case 304: // Approach Mama Dorita's doorway.
+ leaveTownRoom(6090);
+ break;
+ case 306: // Refuse to jump into the well.
+ say(4, _random.getRandomBit());
+ break;
+ case 307: // Notice the hole through the stone.
+ say(5, _town.stone != 0);
+ if (!_town.stone) {
+ _town.stone = 1;
+ }
+ break;
+ case 308: // Take the unusually shaped stone.
+ if (!_town.stone) {
+ execute6130(307);
+ }
+ say(6);
+ deferTownAction(408);
+ break;
+ case 408:
+ _town.stone = 2;
+ _inventory.add(29);
+ say(6, 1);
+ return kBackgroundChanged;
+ case 400: // First visit: go and introduce Brian to Oscar.
+ walkTo(Common::Point(402, 374), 1);
+ deferTownAction(401);
+ break;
+ case 401:
+ _town.houseVisited = 1;
+ leaveTownRoom(6090);
+ break;
+ default:
+ return kUnhandled;
+ }
+ return kHandled;
+}
+
+} // End of namespace Hollywood
diff --git a/engines/hollywood/runaway/scene6260.cpp b/engines/hollywood/runaway/scene6260.cpp
index 250fbfb547e..56217be7477 100644
--- a/engines/hollywood/runaway/scene6260.cpp
+++ b/engines/hollywood/runaway/scene6260.cpp
@@ -98,21 +98,6 @@ void RunawayRoomScene::updateMaps6260() {
}
}
-void RunawayRoomScene::walk6260(Common::Point target) {
- if (!_pendingHotspot) {
- // Ordinary clicks stay on the ground, even when Brian starts above it.
- target.x = CLIP<int>(target.x, 0, _background.w - 1);
- target.y = CLIP<int>(target.y, 0, _background.h - 1);
- while (target.y < _background.h - 1 && !_maps[_mask[target.y * _background.w + target.x]]) {
- ++target.y;
- }
- while (target.y > 0 && !_maps[_mask[target.y * _background.w + target.x]]) {
- --target.y;
- }
- }
- _walkPath.findPath(RunawayWalkMap(_background.w, _background.h, _mask, _originalMaps), target);
-}
-
RunawayRoomScene::ActionResult RunawayRoomScene::execute6260(uint16 action) {
switch (action) {
case 302: // Return to the street.
diff --git a/engines/hollywood/runaway/scene6350.cpp b/engines/hollywood/runaway/scene6350.cpp
index a5c4327b943..f216f9692fe 100644
--- a/engines/hollywood/runaway/scene6350.cpp
+++ b/engines/hollywood/runaway/scene6350.cpp
@@ -46,6 +46,7 @@ const RunawayRoom kRunawayScene6350 = {
};
void RunawayRoomScene::resumeTown() {
+ _oscarTick = _now;
if (_room == 6263) {
resume6263();
}
@@ -74,7 +75,15 @@ void RunawayRoomScene::resumeTown() {
} else if (!_audio.musicPlaying()) {
_audio.playMusic(11);
}
- if (_room == 6190) {
+ if (_room == 6014) {
+ execute6014(400);
+ } else if (_room == 6080) {
+ start6080();
+ } else if (_room == 6090) {
+ start6090();
+ } else if (_room == 6130) {
+ start6130();
+ } else if (_room == 6190) {
start6190();
} else if (_room == 6200) {
start6200();
@@ -91,6 +100,9 @@ void RunawayRoomScene::resumeTown() {
}
void RunawayRoomScene::updateTown() {
+ if (_room == 6090 || _room == 6130) {
+ updateOscar();
+ }
if (_room == 6263) {
update6263();
}
@@ -110,12 +122,31 @@ void RunawayRoomScene::updateTown() {
}
}
+void RunawayRoomScene::walkTown(Common::Point target) {
+ if (!_pendingHotspot) {
+ // Clicks stay on the ground; hotspot approaches may use the reserved zones.
+ target.x = CLIP<int>(target.x, 0, _room == 6080 ? 1152 : _background.w - 1);
+ target.y = CLIP<int>(target.y, 0, _background.h - 1);
+ while (target.y < _background.h - 1 && !_maps[_mask[target.y * _background.w + target.x]]) {
+ ++target.y;
+ }
+ while (target.y > 0 && !_maps[_mask[target.y * _background.w + target.x]]) {
+ --target.y;
+ }
+ }
+ _walkPath.findPath(RunawayWalkMap(_background.w, _background.h, _mask, _originalMaps), target);
+}
+
void RunawayRoomScene::deferTownAction(uint16 action) {
_roomAction = action;
_actionFrames.clear();
}
void RunawayRoomScene::townAnimationFrame() {
+ if (_room == 6080) {
+ mineAnimationFrame();
+ return;
+ }
if (_room == 6260 || _room == 6263) {
locomotiveAnimationFrame();
return;
diff --git a/engines/hollywood/runaway/scene_data.h b/engines/hollywood/runaway/scene_data.h
index 515404ea6f1..3a1b1030ea6 100644
--- a/engines/hollywood/runaway/scene_data.h
+++ b/engines/hollywood/runaway/scene_data.h
@@ -104,6 +104,10 @@ extern const RunawayRoom kRunawayScene5130;
extern const RunawayRoom kRunawayScene5140;
extern const RunawayRoom kRunawayScene5160;
extern const RunawayRoom kRunawayScene5170;
+extern const RunawayRoom kRunawayScene6014;
+extern const RunawayRoom kRunawayScene6080;
+extern const RunawayRoom kRunawayScene6090;
+extern const RunawayRoom kRunawayScene6130;
extern const RunawayRoom kRunawayScene6190;
extern const RunawayRoom kRunawayScene6200;
extern const RunawayRoom kRunawayScene6210;
Commit: e73b899fda11c72d9f241d5d66a2163d7bd18528
https://github.com/scummvm/scummvm/commit/e73b899fda11c72d9f241d5d66a2163d7bd18528
Author: neuromancer (gustavo.grieco at gmail.com)
Date: 2026-11-19T19:38:52+01:00
Commit Message:
HOLLYWOOD: RUNAWAY: implemented scenes 6180 and 6240
Changed paths:
A engines/hollywood/runaway/scene6180.cpp
A engines/hollywood/runaway/scene6240.cpp
engines/hollywood/module.mk
engines/hollywood/runaway/inventory.cpp
engines/hollywood/runaway/saveload.cpp
engines/hollywood/runaway/saveload.h
engines/hollywood/runaway/scene.cpp
engines/hollywood/runaway/scene.h
engines/hollywood/runaway/scene6220.cpp
engines/hollywood/runaway/scene6350.cpp
engines/hollywood/runaway/scene_data.h
diff --git a/engines/hollywood/module.mk b/engines/hollywood/module.mk
index cdc926a95e2..e254a48ca89 100644
--- a/engines/hollywood/module.mk
+++ b/engines/hollywood/module.mk
@@ -179,10 +179,12 @@ MODULE_OBJS = \
runaway/scene6080.o \
runaway/scene6090.o \
runaway/scene6130.o \
+ runaway/scene6180.o \
runaway/scene6190.o \
runaway/scene6200.o \
runaway/scene6210.o \
runaway/scene6220.o \
+ runaway/scene6240.o \
runaway/scene6260.o \
runaway/scene6263.o \
runaway/scene6350.o \
diff --git a/engines/hollywood/runaway/inventory.cpp b/engines/hollywood/runaway/inventory.cpp
index 0d44aa5e33a..e8070b839b0 100644
--- a/engines/hollywood/runaway/inventory.cpp
+++ b/engines/hollywood/runaway/inventory.cpp
@@ -281,12 +281,18 @@ RunawayInventory::Reply RunawayInventory::examine(byte item) const {
case 8: // Liniment.
case 9: // Cell key.
return Reply(194 + item);
+ case 11: // Wagon strap.
+ return Reply(204);
case 14: // Firewood.
return Reply(207);
case 20: // Ancient stapler.
return Reply(212);
+ case 22: // Pruning shears.
+ return Reply(213);
case 23: // Oil can.
return Reply(214);
+ case 27: // Tobacco leaves.
+ return Reply(217);
case 29: // Stone with a hole.
return Reply(219);
case 31: // Clay vessel.
diff --git a/engines/hollywood/runaway/saveload.cpp b/engines/hollywood/runaway/saveload.cpp
index 9cee9262372..c3035b847f6 100644
--- a/engines/hollywood/runaway/saveload.cpp
+++ b/engines/hollywood/runaway/saveload.cpp
@@ -246,6 +246,14 @@ void RunawaySaveState::sync(Common::Serializer &s) {
s.syncAsByte(town.oscarMet, 11);
s.syncAsByte(town.oscarHelpRefused, 11);
s.syncAsByte(town.rawTobaccoRefused, 11);
+ s.syncAsByte(town.saloonEntranceVisited, 12);
+ s.syncAsByte(town.saloonDoorKnown, 12);
+ s.syncAsByte(town.saloonVisited, 12);
+ s.syncAsByte(town.flowerPotTaken, 12);
+ s.syncAsByte(town.gardeningShed, 12);
+ s.syncAsByte(town.tobaccoLeavesTaken, 12);
+ s.syncAsByte(town.artichokeSeen, 12);
+ s.syncAsByte(town.carnivorousPlantSeen, 12);
}
byte RunawaySaveState::chapter() const {
@@ -347,6 +355,11 @@ bool RunawaySaveState::valid() const {
return false;
}
bool owned[33] = {};
+ if (town.saloonEntranceVisited > 1 || town.saloonDoorKnown > 1 || town.saloonVisited > 1 ||
+ town.flowerPotTaken > 1 || town.gardeningShed > 2 || town.tobaccoLeavesTaken > 1 ||
+ town.artichokeSeen > 1 || town.carnivorousPlantSeen > 1) {
+ return false;
+ }
if (town.mineVisited > 1 || town.oilCan > 2 || town.rockMoved > 1 ||
town.houseVisited > 1 || town.stone > 2 || town.vessel > 2 ||
town.oscarMet > 1 || town.oscarHelpRefused > 1 || town.rawTobaccoRefused > 1) {
@@ -358,8 +371,9 @@ bool RunawaySaveState::valid() const {
town.oilCanFull > 1 || town.bottleContents > 2 || town.craterSeen > 1) {
return false;
}
- if (town.arrived > 1 || town.streetVisited > 1 || town.strapSeen > 1 || town.sushiMet > 1 || town.mineMapKnown > 1)
+ if (town.arrived > 1 || town.streetVisited > 1 || town.strapSeen > 2 || town.sushiMet > 1 || town.mineMapKnown > 1) {
return false;
+ }
if (town.bankVisited > 1 || town.bankShelves > 2 || town.bankStampTaken > 1 || town.basementKnown > 1 ||
town.bodySeen > 1 || town.doctorKnown > 1 || town.firewoodTaken > 1 || town.cellOpen > 1 ||
town.bagSearched > 1 || town.bucketSeen > 1 || town.bottleSeen > 1 || town.cellRefusals > 2 ||
@@ -380,7 +394,7 @@ bool RunawaySaveState::read(Common::SeekableReadStream &stream) {
if (stream.readUint32BE() != MKTAG('R', 'U', 'N', 'A'))
return false;
const uint16 version = stream.readUint16LE();
- if (version < 1 || version > 11)
+ if (version < 1 || version > 12)
return false;
Common::Serializer s(&stream, nullptr);
s.setVersion(version);
@@ -392,9 +406,9 @@ bool RunawaySaveState::write(Common::WriteStream &stream) {
if (!valid())
return false;
stream.writeUint32BE(MKTAG('R', 'U', 'N', 'A'));
- stream.writeUint16LE(11);
+ stream.writeUint16LE(12);
Common::Serializer s(nullptr, &stream);
- s.setVersion(11);
+ s.setVersion(12);
sync(s);
return !s.err();
}
diff --git a/engines/hollywood/runaway/saveload.h b/engines/hollywood/runaway/saveload.h
index a8c88184697..e3e57fa3791 100644
--- a/engines/hollywood/runaway/saveload.h
+++ b/engines/hollywood/runaway/saveload.h
@@ -98,6 +98,9 @@ struct RunawaySaveState {
byte mineVisited = 0, oilCan = 0, rockMoved = 0;
byte houseVisited = 0, stone = 0, vessel = 0;
byte oscarMet = 0, oscarHelpRefused = 0, rawTobaccoRefused = 0;
+ byte saloonEntranceVisited = 0, saloonDoorKnown = 0, saloonVisited = 0;
+ byte flowerPotTaken = 0, gardeningShed = 0, tobaccoLeavesTaken = 0;
+ byte artichokeSeen = 0, carnivorousPlantSeen = 0;
} town;
uint16 scene = 5030, x = 623, y = 447, camera = 111;
diff --git a/engines/hollywood/runaway/scene.cpp b/engines/hollywood/runaway/scene.cpp
index 27347bfd66f..289c620dc2f 100644
--- a/engines/hollywood/runaway/scene.cpp
+++ b/engines/hollywood/runaway/scene.cpp
@@ -40,8 +40,8 @@ const RunawayRoom *const kRooms[] = {
&kRunawayScene5080, &kRunawayScene5100, &kRunawayScene5110, &kRunawayScene5130, &kRunawayScene5140,
&kRunawayScene5160, &kRunawayScene5170,
&kRunawayScene6014, &kRunawayScene6080, &kRunawayScene6090, &kRunawayScene6130,
- &kRunawayScene6190, &kRunawayScene6200, &kRunawayScene6210,
- &kRunawayScene6220, &kRunawayScene6260, &kRunawayScene6263,
+ &kRunawayScene6180, &kRunawayScene6190, &kRunawayScene6200, &kRunawayScene6210,
+ &kRunawayScene6220, &kRunawayScene6240, &kRunawayScene6260, &kRunawayScene6263,
&kRunawayScene6350, &kRunawayScene6370
};
@@ -88,6 +88,10 @@ const RunawayRoom *findRoom(int number) {
number = 6080;
} else if (number == 6131) {
number = 6130;
+ } else if (number == 6181) {
+ number = 6180;
+ } else if (number == 6241) {
+ number = 6240;
} else if (number == 6201) {
number = 6200;
} else if (number == 6261 || number == 6262 || number == 6265) {
@@ -276,7 +280,7 @@ bool RunawayRoomScene::enterRoom(uint16 number, Common::Point position, byte fac
return false;
}
if (_game == kRunawayFullGame ? !_actor.loadChapter(number < 4000 ? 1 : number < 5000 ? 2 : number < 6000 ? 3 : 4,
- number != kMuseumHall && number != 6190 && number != 6200 && number != 6260 && number != 6263 &&
+ number != kMuseumHall && number != 6190 && number != 6200 && number != 6240 && number != 6260 && number != 6263 &&
number != 6350 && number != 6370) :
!_actor.load(number == kMuseumHall ? RunawayActor::kMuseumHall : RunawayActor::kMuseumInterior))
return false;
@@ -298,6 +302,9 @@ bool RunawayRoomScene::enterRoom(uint16 number, Common::Point position, byte fac
_foreground[i].clear();
for (uint i = 0; i < ARRAYSIZE(_keyPatches); ++i)
_keyPatches[i].clear();
+ for (uint i = 0; i < ARRAYSIZE(_saloonPatches); ++i) {
+ _saloonPatches[i].clear();
+ }
bool loaded = true;
if (desertChapter())
loaded = loadDesertRoom();
@@ -336,12 +343,22 @@ bool RunawayRoomScene::enterRoom(uint16 number, Common::Point position, byte fac
case 6130:
loaded = _npc.load(_archive, 6, 106);
break;
+ case 6180:
+ loaded = _ambient.load(_archive, 8, 71) && loadForeground(0, 4) && loadForeground(1, 5) &&
+ _archive.readVariableChunk(6, _saloonPatches[0]) && _archive.readVariableChunk(7, _saloonPatches[1]);
+ break;
case 6200:
loaded = _ambient.load(_archive, 6, 26);
break;
case 6220:
loaded = _npc.load(_archive, 7, 170) && _npcMouth.load(_archive, 8, 45) && _machine.load(_archive, 9, 60);
break;
+ case 6240:
+ loaded = _ambient.load(_archive, 4, 36);
+ for (uint i = 0; i < ARRAYSIZE(_saloonPatches) && loaded; ++i) {
+ loaded = _archive.readVariableChunk(6 + i, _saloonPatches[i]);
+ }
+ break;
case 6260:
loaded = loadForeground(0, 6);
break;
@@ -420,6 +437,8 @@ bool RunawayRoomScene::rebuildBackground() {
return applyBackground6190();
case 6200:
return !_town.firewoodTaken || applyPatch(4);
+ case 6240:
+ return !_town.flowerPotTaken || applyPatch(9);
case 6260:
return applyBackground6260();
case 6350:
@@ -455,6 +474,26 @@ void RunawayRoomScene::updateMaps() {
case 6080:
updateMaps6080();
break;
+ case 6180:
+ for (uint i = 0; i < 256; ++i) {
+ if (_maps[i] == 3) {
+ _maps[i] = 0;
+ }
+ if (_maps[256 + i] == 4 && !_town.saloonDoorKnown) {
+ _maps[256 + i] = 0;
+ }
+ }
+ break;
+ case 6240:
+ for (uint i = 0; i < 256; ++i) {
+ if (_maps[i] >= 6 && _maps[i] <= 8) {
+ _maps[i] = 0;
+ }
+ if (_maps[256 + i] == 3 && _town.flowerPotTaken) {
+ _maps[256 + i] = 0;
+ }
+ }
+ break;
case 6090:
case 6130:
for (uint i = 0; i < 256; ++i) {
@@ -531,8 +570,17 @@ Common::U32String RunawayRoomScene::hotspotName(byte id) const {
if (_room == 6090 && id == 4 && _town.oscarTobacco) {
return Common::U32String("Oscar");
}
- if (_room == 6220 && id == 8 && _town.strapSeen)
+ if (_room == 6240) {
+ if (id == 5 && _town.gardeningShed) {
+ return Common::U32String("Gardening shed");
+ }
+ if (id == 7 && _town.carnivorousPlantSeen) {
+ return Common::U32String("Meat-eating plant");
+ }
+ }
+ if (_room == 6220 && id == 8 && _town.strapSeen == 1) {
return Common::U32String("Strap");
+ }
if (_room == 6263) {
if (id == 3 && _town.steamLever) {
return Common::U32String("Steam outlet lever");
@@ -575,10 +623,12 @@ Common::U32String RunawayRoomScene::actionCaption(byte id, RunawayVerb verb, byt
return _strings.text(verb == kVerbLook ? RunawayStrings::kLook : RunawayStrings::kUse) + name;
}
-void RunawayRoomScene::walkTo(Common::Point target, byte facing, bool scripted) {
+void RunawayRoomScene::walkTo(Common::Point target, byte facing, bool scripted, bool reserved) {
if (scripted) {
_walkPath.setTarget(target);
- } else if (_room == 6080 || _room == 6260) {
+ } else if (reserved) {
+ _walkPath.findPath(RunawayWalkMap(_background.w, _background.h, _mask, _originalMaps), target);
+ } else if (_room == 6080 || _room == 6180 || _room == 6240 || _room == 6260) {
walkTown(target);
} else {
_walkPath.findPath(RunawayWalkMap(_background.w, _background.h, _mask, _maps), target);
@@ -630,8 +680,9 @@ void RunawayRoomScene::click(Common::Point mouse, RunawayVerb verb, byte item) {
approach = false;
}
}
- if (_room == 6220 && id == 8 && index && _town.strapSeen)
+ if (_room == 6220 && id == 8 && index && _town.strapSeen == 1) {
approach = true;
+ }
if (_room == 6260 && id == 5 && !index && _town.locomotiveKey == 2) {
approach = false;
}
@@ -650,6 +701,9 @@ void RunawayRoomScene::click(Common::Point mouse, RunawayVerb verb, byte item) {
break;
}
}
+ if (_room == 6220 && id == 8 && _town.strapSeen != 1) {
+ approach = false;
+ }
}
if (approach) {
Common::Point position(spot->x, spot->y);
@@ -781,6 +835,9 @@ void RunawayRoomScene::execute(uint16 action) {
case 6130:
result = execute6130(action);
break;
+ case 6180:
+ result = execute6180(action);
+ break;
case 6190:
result = execute6190(action);
break;
@@ -793,6 +850,9 @@ void RunawayRoomScene::execute(uint16 action) {
case 6220:
result = execute6220(action);
break;
+ case 6240:
+ result = execute6240(action);
+ break;
case 6260:
result = execute6260(action);
break;
@@ -890,6 +950,10 @@ float RunawayRoomScene::actorHeight() const {
_position.y * 0.730337083f + 17.5280895f;
case 6130:
return _position.y * 1.027668f - 160.57312f;
+ case 6180:
+ return _position.y * 1.3565892f - 249.069763f;
+ case 6240:
+ return _position.y * 1.00515461f - 83.762886f;
case 6190:
return (_position.y * 0.426829278f + 16.4634151f + _position.x * 0.0980392173f + 41.7647057f) / 2;
case 6200:
@@ -1031,6 +1095,8 @@ void RunawayRoomScene::draw() {
drawScene6090(viewport, false);
} else if (_room == 6130) {
_npc.draw(viewport, oscarFrame(), _camera.x, -_camera.y);
+ } else if (_room == 6180) {
+ drawScene6180(viewport, false);
} else if (_room == 6200) {
drawScene6200(viewport);
} else if (_room == 6220) {
@@ -1096,6 +1162,12 @@ void RunawayRoomScene::draw() {
params.depthY[8] = 322;
params.depthY[9] = 599;
break;
+ case 6240:
+ params.depthY[1] = 599;
+ params.depthY[2] = 599;
+ params.depthY[3] = 351;
+ params.depthY[4] = 351;
+ break;
case 6370:
params.depthY[1] = 800;
params.depthY[2] = 646;
@@ -1137,6 +1209,10 @@ void RunawayRoomScene::draw() {
drawScene6080(viewport, true);
} else if (_room == 6090) {
drawScene6090(viewport, true);
+ } else if (_room == 6180) {
+ drawScene6180(viewport, true);
+ } else if (_room == 6240) {
+ drawForeground6240(viewport);
} else if (_room == 6260) {
drawForeground(viewport, 0);
}
diff --git a/engines/hollywood/runaway/scene.h b/engines/hollywood/runaway/scene.h
index 63a9ae01fa1..f7d8644bddc 100644
--- a/engines/hollywood/runaway/scene.h
+++ b/engines/hollywood/runaway/scene.h
@@ -128,7 +128,7 @@ private:
bool rebuildBackground();
bool applyPatch(uint chunk);
void updateMaps();
- void walkTo(Common::Point target, byte facing = 0xff, bool scripted = false);
+ void walkTo(Common::Point target, byte facing = 0xff, bool scripted = false, bool reserved = false);
void arrive();
void execute(uint16 action);
void useItem(byte item, byte hotspot);
@@ -312,6 +312,10 @@ private:
uint oscarFrame() const;
void start6130();
ActionResult execute6130(uint16 action);
+ void start6180();
+ void update6180();
+ ActionResult execute6180(uint16 action);
+ void drawScene6180(Graphics::ManagedSurface &viewport, bool foreground);
void start6190();
ActionResult execute6190(uint16 action);
bool applyBackground6190();
@@ -323,6 +327,9 @@ private:
void start6210();
ActionResult execute6210(uint16 action);
void townAnimationFrame();
+ void start6240();
+ ActionResult execute6240(uint16 action);
+ void drawForeground6240(Graphics::ManagedSurface &viewport);
void start6260();
ActionResult execute6260(uint16 action);
bool applyBackground6260();
@@ -393,6 +400,9 @@ private:
byte _oscarIdle = 3;
uint32 _oscarTick = 0;
bool _oscarTalking = false, _mineOscarPresent = false;
+ Common::Array<byte> _saloonPatches[3];
+ byte _saloonDoorFrame = 0;
+ uint32 _saloonDoorTick = 0;
RunawayAnimation _locomotiveGauges[4];
byte _locomotiveGaugeFrames[4] = {};
byte _townFilm = 0;
diff --git a/engines/hollywood/runaway/scene6180.cpp b/engines/hollywood/runaway/scene6180.cpp
new file mode 100644
index 00000000000..572c02168a3
--- /dev/null
+++ b/engines/hollywood/runaway/scene6180.cpp
@@ -0,0 +1,166 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+
+
+#include "common/util.h"
+#include "hollywood/runaway/scene.h"
+
+namespace Hollywood {
+namespace {
+
+const RunawayHotspot kHotspots[] = {
+ {"", 0, 0, 0, {0, 0}, {0, 0}},
+ {"Street", 202, 526, 7, {301, 302}, {0, 3}},
+ {"Inside the saloon", 780, 527, 1, {303, 304}, {0, 0}},
+ {"Trough", 405, 427, 7, {305, 306}, {0, 0}},
+ {"Floor board", 780, 527, 1, {307, 308}, {0, 0}},
+ {"Window", 643, 457, 1, {309, 310}, {0, 0}}
+};
+
+const RunawayResponse kResponses[] = {
+ {6180, 301, 1, 0}, // Look out into the deserted street.
+ {6180, 303, 2, 0}, // Look inside the saloon.
+ {6180, 305, 4, 0}, // Examine the muddy trough.
+ {6180, 306, 5, 0}, // Try to overturn the trough.
+ {6180, 307, 6, 0}, // Examine the doors' pressure plate.
+ {6180, 309, 8, 0}, // Read the broken window.
+ {6180, 310, 9, 0}, // Refuse to break more glass.
+ {6180, 311, 10, 0} // Refuse to collect mud with an inventory item.
+};
+
+const RunawayItemAction kItemActions[] = {
+ {6180, 8, 3, 311, false}, {6180, 12, 3, 311, false},
+ {6180, 13, 3, 311, false}, {6180, 16, 3, 311, false},
+ {6180, 23, 3, 311, false}, {6180, 24, 3, 311, false},
+ {6180, 25, 3, 311, false}, {6180, 26, 3, 311, false},
+ {6180, 31, 3, 311, false}
+};
+
+} // End of anonymous namespace
+
+const RunawayRoom kRunawayScene6180 = {
+ 6180, 1024, 600, kHotspots, ARRAYSIZE(kHotspots),
+ {{100, 100, 100}, {80, 75, 65}, {60, 55, 45}, {50, 45, 35}}, Common::Point(319, 549),
+ kResponses, ARRAYSIZE(kResponses), kItemActions, ARRAYSIZE(kItemActions), nullptr, 0
+};
+
+void RunawayRoomScene::start6180() {
+ if (_entryScene == 6181) {
+ _position = Common::Point(1023, 519);
+ _walkPath.reset(_position);
+ _saloonDoorFrame = 7;
+ walkTo(Common::Point(586, 534), 5, false, true);
+ } else {
+ _facing = 3;
+ if (!_town.saloonEntranceVisited) {
+ _town.saloonEntranceVisited = 1;
+ say(0);
+ }
+ }
+}
+
+void RunawayRoomScene::update6180() {
+ if (_roomAction == 401 && !_actionFrames.empty()) {
+ _actionFrames[0] = 24 + speechFrame();
+ }
+ // Stepping across the floor board opens the doors; stepping off releases them.
+ const bool pressed = _position.x > 726;
+ if (pressed && _saloonDoorFrame > 7) {
+ _saloonDoorFrame = 0;
+ }
+ if ((pressed && _saloonDoorFrame == 7) || (!pressed && !_saloonDoorFrame)) {
+ _saloonDoorTick = _now;
+ return;
+ }
+ if (_now - _saloonDoorTick < 80) {
+ return;
+ }
+ _saloonDoorTick = _now;
+ _saloonDoorFrame = (_saloonDoorFrame + 1) % 71;
+ if (_saloonDoorFrame == 1) {
+ _audio.playEffect(13);
+ } else if (_saloonDoorFrame == 9) {
+ _audio.playEffect(14);
+ }
+}
+
+void RunawayRoomScene::drawScene6180(Graphics::ManagedSurface &viewport, bool foreground) {
+ if (foreground) {
+ if (_position.x < 273) {
+ drawForeground(viewport, 0);
+ }
+ if (_position.x > 714) {
+ drawForeground(viewport, 1);
+ }
+ } else {
+ applyRunawayPatch(_saloonPatches[_position.x > 726], viewport);
+ _ambient.draw(viewport, _saloonDoorFrame, 0, 0);
+ }
+}
+
+RunawayRoomScene::ActionResult RunawayRoomScene::execute6180(uint16 action) {
+ switch (action) {
+ case 302: // Leave the porch and return to Douglasville.
+ leaveTownRoom(6221);
+ break;
+ case 304: // Enter through the automatic saloon doors.
+ if (!_town.saloonDoorKnown) {
+ walkTo(Common::Point(780, 527), 1, false, true);
+ deferTownAction(400);
+ } else {
+ walkTo(Common::Point(1023, 519), 1, false, true);
+ deferTownAction(403);
+ }
+ break;
+ case 308: // Step on the board, or point out that Brian is already on it.
+ if (_position == Common::Point(780, 527)) {
+ say(7);
+ } else {
+ walkTo(Common::Point(780, 527), 1, false, true);
+ }
+ break;
+ case 400: // Notice the doors opening without being pushed.
+ beginRoomAnimationRange(400, 9, 42, 0, 24);
+ break;
+ case 1400:
+ say(3);
+ holdRoomAnimation(401, 9, 42, 24);
+ break;
+ case 1401: {
+ static const byte frames[] = {24, 36, 37, 38, 39, 40};
+ beginRoomAnimation(402, 9, 42, frames, ARRAYSIZE(frames));
+ break;
+ }
+ case 1402:
+ _town.saloonDoorKnown = 1;
+ walkTo(Common::Point(1023, 519), 1, false, true);
+ deferTownAction(403);
+ return kBackgroundChanged;
+ case 403:
+ leaveTownRoom(6240);
+ break;
+ default:
+ return kUnhandled;
+ }
+ return kHandled;
+}
+
+} // End of namespace Hollywood
diff --git a/engines/hollywood/runaway/scene6220.cpp b/engines/hollywood/runaway/scene6220.cpp
index 2c77dfc4f8f..cc726279d89 100644
--- a/engines/hollywood/runaway/scene6220.cpp
+++ b/engines/hollywood/runaway/scene6220.cpp
@@ -51,13 +51,17 @@ const RunawayResponse kResponses[] = {
{6220, 318, 1, 1} // Look toward the cemetery.
};
+const RunawayItemAction kItemActions[] = {
+ {6220, 22, 8, 317} // Cut the wagon strap with the pruning shears.
+};
+
} // End of anonymous namespace
const RunawayRoom kRunawayScene6220 = {
6220, 1024, 600, kHotspots, ARRAYSIZE(kHotspots),
{{100, 100, 100}, {95, 90, 70}, {75, 70, 50}, {55, 50, 30}},
Common::Point(188, 599),
- kResponses, ARRAYSIZE(kResponses), nullptr, 0, nullptr, 0
+ kResponses, ARRAYSIZE(kResponses), kItemActions, ARRAYSIZE(kItemActions), nullptr, 0
};
void RunawayRoomScene::start6220() {
@@ -105,10 +109,34 @@ RunawayRoomScene::ActionResult RunawayRoomScene::execute6220(uint16 action) {
break;
case 315: // Examine the wagon and identify its strap.
say(9, _town.strapSeen);
- _town.strapSeen = 1;
+ if (!_town.strapSeen) {
+ _town.strapSeen = 1;
+ }
break;
case 316: // Try to take the wagon or its attached strap.
- say(10, _town.strapSeen ? 0 : 1);
+ say(10, _town.strapSeen == 1 ? 0 : 1);
+ break;
+ case 317: // Cut the strap only after identifying it on the wagon.
+ if (_town.strapSeen != 1) {
+ say(25, 0, true);
+ break;
+ }
+ say(11);
+ deferTownAction(417);
+ break;
+ case 417: {
+ static const byte frames[] = {
+ 0, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21,
+ 20, 19, 18, 17, 16, 15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0
+ };
+ beginRoomAnimation(417, 10, 22, frames, ARRAYSIZE(frames));
+ break;
+ }
+ case 1417:
+ _town.strapSeen = 2;
+ _inventory.select(0);
+ _inventory.add(11);
+ say(11, 1);
break;
case 400: // First arrival in Douglasville.
say(0);
diff --git a/engines/hollywood/runaway/scene6240.cpp b/engines/hollywood/runaway/scene6240.cpp
new file mode 100644
index 00000000000..1f09f621f62
--- /dev/null
+++ b/engines/hollywood/runaway/scene6240.cpp
@@ -0,0 +1,194 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+
+
+#include "common/util.h"
+#include "hollywood/runaway/scene.h"
+
+namespace Hollywood {
+namespace {
+
+const RunawayHotspot kHotspots[] = {
+ {"", 0, 0, 0, {0, 0}, {0, 0}},
+ {"Door", 0, 453, 5, {301, 302}, {0, 3}},
+ {"Stairs", 782, 408, 7, {303, 304}, {0, 1}},
+ {"Flower pot", 504, 452, 1, {305, 306}, {1, 1}},
+ {"Watering can", 1286, 435, 0, {307, 308}, {0, 0}},
+ {"Small room", 742, 332, 5, {309, 310}, {0, 0}},
+ {"Door knob", 610, 467, 1, {311, 312}, {0, 0}},
+ {"Plant", 1393, 427, 0, {313, 314}, {0, 0}},
+ {"Bonsai tree", 955, 396, 1, {315, 316}, {0, 0}}
+};
+
+const RunawayResponse kResponses[] = {
+ {6240, 301, 1, 0}, // Look out into town.
+ {6240, 303, 2, 0}, // Look up the stairs.
+ {6240, 305, 3, 0}, // Examine the pot of soil.
+ {6240, 307, 5, 0}, // Examine the watering can.
+ {6240, 308, 6, 0}, // Leave the watering to the plants' owner.
+ {6240, 312, 10, 0}, // Try to remove the carved door knob.
+ {6240, 315, 13, 0}, // Examine the bonsai.
+ {6240, 316, 14, 0}, // Leave the bonsai where it belongs.
+ {6240, 317, 15, 0} // Refuse to water the plants with an inventory item.
+};
+
+const RunawayItemAction kItemActions[] = {
+ {6240, 16, 7, 317, false}, {6240, 16, 8, 317, false},
+ {6240, 24, 7, 317, false}, {6240, 24, 8, 317, false}
+};
+
+} // End of anonymous namespace
+
+const RunawayRoom kRunawayScene6240 = {
+ 6240, 1728, 600, kHotspots, ARRAYSIZE(kHotspots),
+ {{100, 100, 100}, {70, 70, 70}, {50, 50, 50}, {40, 40, 40}}, Common::Point(45, 427),
+ kResponses, ARRAYSIZE(kResponses), kItemActions, ARRAYSIZE(kItemActions), nullptr, 0
+};
+
+void RunawayRoomScene::start6240() {
+ if (_entryScene == 6241) {
+ _position = Common::Point(782, 408);
+ _walkPath.reset(_position);
+ walkTo(Common::Point(783, 408), 3, false, true);
+ } else {
+ walkTo(Common::Point(88, 403), _town.saloonVisited ? 1 : 3);
+ if (!_town.saloonVisited) {
+ deferTownAction(400);
+ }
+ }
+}
+
+void RunawayRoomScene::drawForeground6240(Graphics::ManagedSurface &viewport) {
+ // The original moves these plants within the room before applying the camera.
+ applyRunawayPatch(_saloonPatches[2], viewport, 0, 440 - _camera.x / 3 - _camera.x);
+ applyRunawayPatch(_saloonPatches[1], viewport, 0, 800 - _camera.x / 4 - _camera.x);
+ applyRunawayPatch(_saloonPatches[0], viewport, 0, 820 - _camera.x / 3 - _camera.x);
+}
+
+RunawayRoomScene::ActionResult RunawayRoomScene::execute6240(uint16 action) {
+ switch (action) {
+ case 302: // Return to the saloon porch.
+ leaveTownRoom(6181);
+ break;
+ case 304: // Climb the stairs to Kevin's room.
+ beginRoomAnimation(304, 5, 19);
+ break;
+ case 1304:
+ leaveTownRoom(6300);
+ break;
+ case 306: // Take the flower pot.
+ say(4);
+ deferTownAction(406);
+ break;
+ case 406:
+ _town.flowerPotTaken = 1;
+ _inventory.add(21);
+ say(4, 1);
+ return kBackgroundChanged;
+ case 309: // Identify the gardening shed.
+ case 310: // Search the shed for useful items.
+ if (!_town.gardeningShed) {
+ say(7);
+ } else if (action == 309) {
+ say(7, 3);
+ break;
+ }
+ walkTo(Common::Point(742, 332), 5, false, true);
+ deferTownAction(action == 309 ? 409 : 410);
+ break;
+ case 409:
+ say(7, 1);
+ deferTownAction(419);
+ break;
+ case 419:
+ walkTo(Common::Point(855, 347), 3, false, true);
+ deferTownAction(429);
+ break;
+ case 429:
+ say(7, 2);
+ _town.gardeningShed = 1;
+ break;
+ case 410:
+ if (!_town.gardeningShed) {
+ say(7, 1);
+ say(7, 2);
+ _town.gardeningShed = 1;
+ }
+ deferTownAction(420);
+ break;
+ case 420: // Search the tools; tobacco is useful only after learning about Oscar.
+ _audio.playEffect(15);
+ if (_town.gardeningShed == 1) {
+ say(8);
+ deferTownAction(421);
+ } else if (_town.oscarTobacco == 1 && !_town.tobaccoLeavesTaken) {
+ say(8, 2);
+ deferTownAction(422);
+ } else {
+ say(8, 4);
+ deferTownAction(423);
+ }
+ break;
+ case 421:
+ _town.gardeningShed = 2;
+ _inventory.add(22);
+ say(8, 1);
+ if (_town.oscarTobacco == 1 && !_town.tobaccoLeavesTaken) {
+ say(8, 2);
+ deferTownAction(422);
+ } else {
+ deferTownAction(423);
+ }
+ break;
+ case 422:
+ _town.tobaccoLeavesTaken = 1;
+ _inventory.add(27);
+ say(8, 3);
+ deferTownAction(423);
+ break;
+ case 423: // Step back out of the shed.
+ walkTo(Common::Point(855, 347), 3, false, true);
+ break;
+ case 311: // Recognize the carved artichoke.
+ say(9, _town.artichokeSeen);
+ _town.artichokeSeen = 1;
+ break;
+ case 313: // Identify the carnivorous plant.
+ say(11, _town.carnivorousPlantSeen);
+ _town.carnivorousPlantSeen = 1;
+ break;
+ case 314: // Refuse to take the carnivorous plant.
+ if (!_town.carnivorousPlantSeen) {
+ execute6240(313);
+ }
+ say(12, _random.getRandomBit());
+ break;
+ case 400: // First visit to the greenhouse.
+ _town.saloonVisited = 1;
+ say(0);
+ break;
+ default:
+ return kUnhandled;
+ }
+ return kHandled;
+}
+
+} // End of namespace Hollywood
diff --git a/engines/hollywood/runaway/scene6350.cpp b/engines/hollywood/runaway/scene6350.cpp
index f216f9692fe..16ff433fc2b 100644
--- a/engines/hollywood/runaway/scene6350.cpp
+++ b/engines/hollywood/runaway/scene6350.cpp
@@ -47,6 +47,8 @@ const RunawayRoom kRunawayScene6350 = {
void RunawayRoomScene::resumeTown() {
_oscarTick = _now;
+ _saloonDoorTick = _now;
+ _saloonDoorFrame = _position.x > 726 ? 7 : 0;
if (_room == 6263) {
resume6263();
}
@@ -83,6 +85,8 @@ void RunawayRoomScene::resumeTown() {
start6090();
} else if (_room == 6130) {
start6130();
+ } else if (_room == 6180) {
+ start6180();
} else if (_room == 6190) {
start6190();
} else if (_room == 6200) {
@@ -91,6 +95,8 @@ void RunawayRoomScene::resumeTown() {
start6210();
} else if (_room == 6220) {
start6220();
+ } else if (_room == 6240) {
+ start6240();
} else if (_room == 6260) {
start6260();
} else if (_room == 6370) {
@@ -100,6 +106,9 @@ void RunawayRoomScene::resumeTown() {
}
void RunawayRoomScene::updateTown() {
+ if (_room == 6180) {
+ update6180();
+ }
if (_room == 6090 || _room == 6130) {
updateOscar();
}
@@ -127,6 +136,15 @@ void RunawayRoomScene::walkTown(Common::Point target) {
// Clicks stay on the ground; hotspot approaches may use the reserved zones.
target.x = CLIP<int>(target.x, 0, _room == 6080 ? 1152 : _background.w - 1);
target.y = CLIP<int>(target.y, 0, _background.h - 1);
+ if (_room == 6180) {
+ if (_originalMaps[_mask[target.y * _background.w + target.x]] == 3) {
+ _walkPath.findPath(RunawayWalkMap(_background.w, _background.h, _mask, _originalMaps), target);
+ return;
+ }
+ target.x = CLIP<int>(target.x, 202, 679);
+ } else if (_room == 6240) {
+ target.x = MIN<int>(target.x, 1510);
+ }
while (target.y < _background.h - 1 && !_maps[_mask[target.y * _background.w + target.x]]) {
++target.y;
}
@@ -143,6 +161,11 @@ void RunawayRoomScene::deferTownAction(uint16 action) {
}
void RunawayRoomScene::townAnimationFrame() {
+ if (_room == 6220 && _roomAction == 417 && _actionStep == 22) {
+ _audio.playEffect(17);
+ } else if (_room == 6240 && _roomAction == 304 && (_actionStep == 11 || _actionStep == 18)) {
+ _audio.playFootstep(3, _random.getRandomBit());
+ }
if (_room == 6080) {
mineAnimationFrame();
return;
diff --git a/engines/hollywood/runaway/scene_data.h b/engines/hollywood/runaway/scene_data.h
index 3a1b1030ea6..f6f4f097291 100644
--- a/engines/hollywood/runaway/scene_data.h
+++ b/engines/hollywood/runaway/scene_data.h
@@ -108,10 +108,12 @@ extern const RunawayRoom kRunawayScene6014;
extern const RunawayRoom kRunawayScene6080;
extern const RunawayRoom kRunawayScene6090;
extern const RunawayRoom kRunawayScene6130;
+extern const RunawayRoom kRunawayScene6180;
extern const RunawayRoom kRunawayScene6190;
extern const RunawayRoom kRunawayScene6200;
extern const RunawayRoom kRunawayScene6210;
extern const RunawayRoom kRunawayScene6220;
+extern const RunawayRoom kRunawayScene6240;
extern const RunawayRoom kRunawayScene6260;
extern const RunawayRoom kRunawayScene6263;
extern const RunawayRoom kRunawayScene6350;
Commit: 2f96a205c80c36319d51b0b94a8be82edd62ce98
https://github.com/scummvm/scummvm/commit/2f96a205c80c36319d51b0b94a8be82edd62ce98
Author: neuromancer (gustavo.grieco at gmail.com)
Date: 2026-11-19T19:38:52+01:00
Commit Message:
HOLLYWOOD: RUNAWAY: implemented scenes 6270 and 6290
Changed paths:
A engines/hollywood/runaway/scene6270.cpp
A engines/hollywood/runaway/scene6290.cpp
engines/hollywood/module.mk
engines/hollywood/runaway/inventory.cpp
engines/hollywood/runaway/inventory.h
engines/hollywood/runaway/saveload.cpp
engines/hollywood/runaway/saveload.h
engines/hollywood/runaway/scene.cpp
engines/hollywood/runaway/scene.h
engines/hollywood/runaway/scene4070.cpp
engines/hollywood/runaway/scene6350.cpp
engines/hollywood/runaway/scene_data.h
diff --git a/engines/hollywood/module.mk b/engines/hollywood/module.mk
index e254a48ca89..2daafb71245 100644
--- a/engines/hollywood/module.mk
+++ b/engines/hollywood/module.mk
@@ -187,6 +187,8 @@ MODULE_OBJS = \
runaway/scene6240.o \
runaway/scene6260.o \
runaway/scene6263.o \
+ runaway/scene6270.o \
+ runaway/scene6290.o \
runaway/scene6350.o \
runaway/scene6370.o \
runaway/sequence.o \
diff --git a/engines/hollywood/runaway/inventory.cpp b/engines/hollywood/runaway/inventory.cpp
index e8070b839b0..06bc316ff2d 100644
--- a/engines/hollywood/runaway/inventory.cpp
+++ b/engines/hollywood/runaway/inventory.cpp
@@ -73,6 +73,7 @@ void RunawayInventory::captureState(RunawaySaveState &state) const {
state.headWig = _headWig;
state.museumItems = _museum;
state.desertItems = _desert;
+ state.townItems = _town;
}
void RunawayInventory::restoreState(const RunawaySaveState &state) {
@@ -90,6 +91,7 @@ void RunawayInventory::restoreState(const RunawaySaveState &state) {
_headWig = state.headWig;
_museum = state.museumItems;
_desert = state.desertItems;
+ _town = state.townItems;
_newItem = 0;
}
@@ -108,6 +110,7 @@ void RunawayInventory::startChapter(byte chapter) {
add(initial[i]);
}
if (chapter == 4) {
+ _town = RunawaySaveState::TownItems();
for (uint i = 1; i <= 5; ++i) {
add(i);
}
@@ -146,6 +149,9 @@ void RunawayInventory::remove(byte item) {
}
Common::U32String RunawayInventory::name(byte item) const {
+ if (_chapter == 4 && item == 11 && _town.strap == 2) {
+ return Common::U32String("Strap with joined ends");
+ }
if (_chapter == 4)
return item < ARRAYSIZE(kTownItemNames) ? Common::U32String(kTownItemNames[item]) : Common::U32String();
if (_chapter == 1) {
@@ -184,6 +190,14 @@ Common::U32String RunawayInventory::name(byte item) const {
}
uint RunawayInventory::icon(byte item) const {
+ if (_chapter == 4 && _town.strap == 2) {
+ if (item == 11) {
+ return 33;
+ }
+ if (item == 20) {
+ return 47;
+ }
+ }
if (_chapter == 2) {
if (item == 7 && _museum.restoredCrucifix)
return 24;
@@ -233,6 +247,14 @@ uint RunawayInventory::icon(byte item) const {
}
uint RunawayInventory::cursor(byte item) const {
+ if (_chapter == 4 && _town.strap == 2) {
+ if (item == 11) {
+ return 105;
+ }
+ if (item == 20) {
+ return 133;
+ }
+ }
if (_chapter == 4)
return item && item < ARRAYSIZE(kTownItemNames) ? 39 + item * 2 : 0;
if (_chapter == 1) {
@@ -282,7 +304,7 @@ RunawayInventory::Reply RunawayInventory::examine(byte item) const {
case 9: // Cell key.
return Reply(194 + item);
case 11: // Wagon strap.
- return Reply(204);
+ return Reply(204, _town.strap);
case 14: // Firewood.
return Reply(207);
case 20: // Ancient stapler.
@@ -386,6 +408,15 @@ RunawayInventory::Reply RunawayInventory::combine(byte first, byte second) {
return Reply();
if (first > second)
SWAP(first, second);
+ if (_chapter == 4 && first == 11 && second == 20) { // Staple the strap's ends together.
+ if (_town.strap != 1) {
+ return Reply(227, _town.strap == 2 ? 3 : 0);
+ }
+ _town.strap = 2;
+ _selected = 0;
+ _newItem = 11;
+ return Reply(227, 1);
+ }
if (_chapter == 1) {
if (first == 10 && second == 17) {
_headWig = 1;
diff --git a/engines/hollywood/runaway/inventory.h b/engines/hollywood/runaway/inventory.h
index d9a8fe51ebd..d2220bf483f 100644
--- a/engines/hollywood/runaway/inventory.h
+++ b/engines/hollywood/runaway/inventory.h
@@ -48,6 +48,7 @@ public:
void startChapter(byte chapter);
RunawaySaveState::MuseumItems &museum() { return _museum; }
RunawaySaveState::DesertItems &desert() { return _desert; }
+ RunawaySaveState::TownItems &town() { return _town; }
bool contains(byte item) const;
bool add(byte item);
void remove(byte item);
@@ -76,6 +77,7 @@ private:
byte _chapter;
RunawaySaveState::MuseumItems _museum;
RunawaySaveState::DesertItems _desert;
+ RunawaySaveState::TownItems _town;
Common::Array<byte> _items;
byte _selected = 0, _newItem = 0, _clothState = 0;
byte _water = 0;
diff --git a/engines/hollywood/runaway/saveload.cpp b/engines/hollywood/runaway/saveload.cpp
index c3035b847f6..76531ebc417 100644
--- a/engines/hollywood/runaway/saveload.cpp
+++ b/engines/hollywood/runaway/saveload.cpp
@@ -254,6 +254,20 @@ void RunawaySaveState::sync(Common::Serializer &s) {
s.syncAsByte(town.tobaccoLeavesTaken, 12);
s.syncAsByte(town.artichokeSeen, 12);
s.syncAsByte(town.carnivorousPlantSeen, 12);
+ s.syncAsByte(town.craterVisited, 13);
+ s.syncAsByte(town.joshuaMet, 13);
+ s.syncAsByte(town.campLeft, 13);
+ s.syncAsByte(town.strapDelivered, 13);
+ s.syncAsByte(town.wrenchDelivered, 13);
+ s.syncAsByte(town.wrenchNeeded, 13);
+ s.syncAsByte(town.fuelNeeded, 13);
+ s.syncAsByte(town.machineKnown, 13);
+ s.syncAsByte(town.rotorKnown, 13);
+ s.syncAsByte(town.batteryKnown, 13);
+ s.syncAsByte(town.helmetKnown, 13);
+ s.syncAsByte(town.dimensionalDoorKnown, 13);
+ s.syncAsByte(town.strapIdea, 13);
+ s.syncAsByte(townItems.strap, 13);
}
byte RunawaySaveState::chapter() const {
@@ -355,6 +369,12 @@ bool RunawaySaveState::valid() const {
return false;
}
bool owned[33] = {};
+ if (town.craterVisited > 1 || town.joshuaMet > 1 || town.campLeft > 1 ||
+ town.strapDelivered > 3 || town.wrenchDelivered > 2 || town.wrenchNeeded > 1 || town.fuelNeeded > 1 ||
+ town.machineKnown > 1 || town.rotorKnown > 1 || town.batteryKnown > 1 || town.helmetKnown > 1 ||
+ town.dimensionalDoorKnown > 1 || town.strapIdea > 1 || townItems.strap > 2) {
+ return false;
+ }
if (town.saloonEntranceVisited > 1 || town.saloonDoorKnown > 1 || town.saloonVisited > 1 ||
town.flowerPotTaken > 1 || town.gardeningShed > 2 || town.tobaccoLeavesTaken > 1 ||
town.artichokeSeen > 1 || town.carnivorousPlantSeen > 1) {
@@ -394,7 +414,7 @@ bool RunawaySaveState::read(Common::SeekableReadStream &stream) {
if (stream.readUint32BE() != MKTAG('R', 'U', 'N', 'A'))
return false;
const uint16 version = stream.readUint16LE();
- if (version < 1 || version > 12)
+ if (version < 1 || version > 13)
return false;
Common::Serializer s(&stream, nullptr);
s.setVersion(version);
@@ -406,9 +426,9 @@ bool RunawaySaveState::write(Common::WriteStream &stream) {
if (!valid())
return false;
stream.writeUint32BE(MKTAG('R', 'U', 'N', 'A'));
- stream.writeUint16LE(12);
+ stream.writeUint16LE(13);
Common::Serializer s(nullptr, &stream);
- s.setVersion(12);
+ s.setVersion(13);
sync(s);
return !s.err();
}
diff --git a/engines/hollywood/runaway/saveload.h b/engines/hollywood/runaway/saveload.h
index e3e57fa3791..8e2f1b43e9c 100644
--- a/engines/hollywood/runaway/saveload.h
+++ b/engines/hollywood/runaway/saveload.h
@@ -101,8 +101,16 @@ struct RunawaySaveState {
byte saloonEntranceVisited = 0, saloonDoorKnown = 0, saloonVisited = 0;
byte flowerPotTaken = 0, gardeningShed = 0, tobaccoLeavesTaken = 0;
byte artichokeSeen = 0, carnivorousPlantSeen = 0;
+ byte craterVisited = 0, joshuaMet = 0, campLeft = 0;
+ byte strapDelivered = 0, wrenchDelivered = 0, wrenchNeeded = 0, fuelNeeded = 0;
+ byte machineKnown = 0, rotorKnown = 0, batteryKnown = 0, helmetKnown = 0, dimensionalDoorKnown = 0;
+ byte strapIdea = 0;
} town;
+ struct TownItems {
+ byte strap = 0; // Loose, needs joining, joined.
+ } townItems;
+
uint16 scene = 5030, x = 623, y = 447, camera = 111;
byte facing = 3, lidOpen = 0, unplugged = 0, windowClean = 0;
byte coolerMoved = 0, coolerInspected = 0, peeked = 0, ice = 0, hatch = 0;
diff --git a/engines/hollywood/runaway/scene.cpp b/engines/hollywood/runaway/scene.cpp
index 289c620dc2f..4c03793cf42 100644
--- a/engines/hollywood/runaway/scene.cpp
+++ b/engines/hollywood/runaway/scene.cpp
@@ -42,6 +42,7 @@ const RunawayRoom *const kRooms[] = {
&kRunawayScene6014, &kRunawayScene6080, &kRunawayScene6090, &kRunawayScene6130,
&kRunawayScene6180, &kRunawayScene6190, &kRunawayScene6200, &kRunawayScene6210,
&kRunawayScene6220, &kRunawayScene6240, &kRunawayScene6260, &kRunawayScene6263,
+ &kRunawayScene6270, &kRunawayScene6290,
&kRunawayScene6350, &kRunawayScene6370
};
@@ -98,6 +99,8 @@ const RunawayRoom *findRoom(int number) {
number = 6260;
} else if (number == 6264) {
number = 6263;
+ } else if (number == 6291) {
+ number = 6290;
}
for (uint i = 0; i < ARRAYSIZE(kRooms); ++i) {
if (kRooms[i]->number == number)
@@ -365,6 +368,9 @@ bool RunawayRoomScene::enterRoom(uint16 number, Common::Point position, byte fac
case 6263:
loaded = loadScene6263();
break;
+ case 6290:
+ loaded = loadScene6290();
+ break;
case 6370:
loaded = _npc.load(_archive, 4, 88) && _ambient.load(_archive, 5, 20);
break;
@@ -408,6 +414,9 @@ bool RunawayRoomScene::applyPatch(uint chunk) {
bool RunawayRoomScene::rebuildBackground() {
const RunawayRoom *room = findRoom(_room);
+ if (_room == 6270) {
+ return loadBackground6270();
+ }
if (!loadRunawaySurface(_archive, _room == 6263 ? 20 : 0, room->width, room->height, _background))
return false;
if (desertChapter())
@@ -441,6 +450,8 @@ bool RunawayRoomScene::rebuildBackground() {
return !_town.flowerPotTaken || applyPatch(9);
case 6260:
return applyBackground6260();
+ case 6290:
+ return (_town.strapDelivered != 1 || applyPatch(13)) && (_town.wrenchDelivered != 1 || applyPatch(14));
case 6350:
return !_town.arrived || (applyPatch(5) && applyPatch(7));
default:
@@ -512,6 +523,9 @@ void RunawayRoomScene::updateMaps() {
case 6260:
updateMaps6260();
break;
+ case 6290:
+ updateMaps6290();
+ break;
case kHospitalBedroom:
updateMaps2020();
break;
@@ -567,6 +581,9 @@ Common::U32String RunawayRoomScene::hotspotName(byte id) const {
if (_room == 6080 && id == 2 && _town.oilCan) {
return Common::U32String("Oil can");
}
+ if (_room == 6290 && id == 11 && _town.machineKnown) {
+ return Common::U32String("Communication machine");
+ }
if (_room == 6090 && id == 4 && _town.oscarTobacco) {
return Common::U32String("Oscar");
}
@@ -628,7 +645,7 @@ void RunawayRoomScene::walkTo(Common::Point target, byte facing, bool scripted,
_walkPath.setTarget(target);
} else if (reserved) {
_walkPath.findPath(RunawayWalkMap(_background.w, _background.h, _mask, _originalMaps), target);
- } else if (_room == 6080 || _room == 6180 || _room == 6240 || _room == 6260) {
+ } else if (_room == 6080 || _room == 6180 || _room == 6240 || _room == 6260 || _room == 6290) {
walkTown(target);
} else {
_walkPath.findPath(RunawayWalkMap(_background.w, _background.h, _mask, _maps), target);
@@ -761,6 +778,12 @@ void RunawayRoomScene::sayInventory(const RunawayInventory::Reply &reply) {
say(214, _town.oilCanFull, true);
return;
}
+ if (townChapter() && reply.cue == 227 && reply.variation == 1) {
+ say(227, 1, true);
+ _audio.playEffect(30);
+ say(227, 2, true);
+ return;
+ }
if (_game == kRunawayFullGame && !desertChapter() && !townChapter() &&
(museumChapter() ? sayMuseumInventory(reply) : sayHospitalInventory(reply)))
return;
@@ -859,6 +882,12 @@ void RunawayRoomScene::execute(uint16 action) {
case 6263:
result = execute6263(action);
break;
+ case 6270:
+ result = execute6270(action);
+ break;
+ case 6290:
+ result = execute6290(action);
+ break;
case 6350:
result = execute6350(action);
break;
@@ -919,7 +948,7 @@ void RunawayRoomScene::setCameraX(int x) {
void RunawayRoomScene::updateCamera() {
setCameraX(_position.x - kRunawayScreenWidth / 2);
- _camera.y = _room == kMuseumHall && _upperFloor ? 0 :
+ _camera.y = _room == 6270 || (_room == kMuseumHall && _upperFloor) ? 0 :
CLIP<int>(_position.y - 400, _room == kMuseumHall ? 200 : 0, _background.h - kRunawayViewportHeight);
}
@@ -967,6 +996,10 @@ float RunawayRoomScene::actorHeight() const {
return _position.y * 0.95f - 175;
case 6263:
return _position.y * 1.04838705f - 175.645157f;
+ case 6270:
+ return _position.y * 0.149253726f + 225.671646f;
+ case 6290:
+ return actorHeight6290();
case 6370:
return _position.y * 0.634920657f - 221.190475f;
default:
@@ -1103,6 +1136,8 @@ void RunawayRoomScene::draw() {
drawScene6220(viewport);
} else if (_room == 6263) {
drawScene6263(viewport);
+ } else if (_room == 6290) {
+ drawScene6290(viewport, false);
} else if (_room == 6370) {
drawScene6370(viewport);
} else if (desertChapter()) {
@@ -1215,6 +1250,8 @@ void RunawayRoomScene::draw() {
drawForeground6240(viewport);
} else if (_room == 6260) {
drawForeground(viewport, 0);
+ } else if (_room == 6290) {
+ drawScene6290(viewport, true);
}
}
diff --git a/engines/hollywood/runaway/scene.h b/engines/hollywood/runaway/scene.h
index f7d8644bddc..310197019eb 100644
--- a/engines/hollywood/runaway/scene.h
+++ b/engines/hollywood/runaway/scene.h
@@ -340,6 +340,18 @@ private:
void drawScene6263(Graphics::ManagedSurface &viewport);
ActionResult execute6263(uint16 action);
void locomotiveAnimationFrame();
+ void start6270();
+ bool loadBackground6270();
+ ActionResult execute6270(uint16 action);
+ void start6290();
+ bool loadScene6290();
+ void update6290();
+ void updateMaps6290();
+ void drawScene6290(Graphics::ManagedSurface &viewport, bool foreground);
+ float actorHeight6290() const;
+ ActionResult execute6290(uint16 action);
+ void startJoshuaConversation(bool introduction);
+ void joshuaDialogueChoice(byte effect);
ActionResult execute6350(uint16 action);
ActionResult execute6220(uint16 action);
void start6220();
@@ -400,6 +412,10 @@ private:
byte _oscarIdle = 3;
uint32 _oscarTick = 0;
bool _oscarTalking = false, _mineOscarPresent = false;
+ byte _joshuaFrame = 0;
+ uint32 _joshuaTick = 0;
+ bool _joshuaTalking = false;
+ RunawayAnimation _machineIndicator;
Common::Array<byte> _saloonPatches[3];
byte _saloonDoorFrame = 0;
uint32 _saloonDoorTick = 0;
diff --git a/engines/hollywood/runaway/scene4070.cpp b/engines/hollywood/runaway/scene4070.cpp
index e4339a9d927..2179969db64 100644
--- a/engines/hollywood/runaway/scene4070.cpp
+++ b/engines/hollywood/runaway/scene4070.cpp
@@ -254,6 +254,9 @@ void RunawayRoomScene::chooseDialogue(uint choice) {
if (_conversation == 6) {
oscarDialogueChoice(entry.disable);
}
+ if (_conversation == 7) {
+ joshuaDialogueChoice(entry.disable);
+ }
if (_conversation == 2 && entry.disable == 10) {
_dialogue[10][3].player = 22;
_dialogue[10][3].response = 21;
diff --git a/engines/hollywood/runaway/scene6270.cpp b/engines/hollywood/runaway/scene6270.cpp
new file mode 100644
index 00000000000..a3e528c85c6
--- /dev/null
+++ b/engines/hollywood/runaway/scene6270.cpp
@@ -0,0 +1,78 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+
+#include "common/util.h"
+#include "hollywood/runaway/scene.h"
+
+namespace Hollywood {
+
+const RunawayRoom kRunawayScene6270 = {
+ 6270, 1024, 700, nullptr, 0, {{100, 100, 100}, {80, 70, 70}},
+ Common::Point(133, 699), nullptr, 0, nullptr, 0, nullptr, 0
+};
+
+bool RunawayRoomScene::loadBackground6270() {
+ Graphics::ManagedSurface image;
+ if (!loadRunawaySurface(_archive, 0, 1024, 600, image)) {
+ return false;
+ }
+ // The mask extends below the picture for Brian's entrance from off screen.
+ _background.create(1024, 700, image.format);
+ _background.clear();
+ _background.blitFrom(image);
+ return true;
+}
+
+void RunawayRoomScene::start6270() {
+ walkTo(Common::Point(341, 498), 1);
+ deferTownAction(400);
+}
+
+RunawayRoomScene::ActionResult RunawayRoomScene::execute6270(uint16 action) {
+ switch (action) {
+ case 400: // Brian looks down into the crater.
+ if (!_town.craterVisited) {
+ say(0);
+ deferTownAction(401);
+ } else {
+ if (!_random.getRandomNumber(4)) {
+ say(0, 2);
+ }
+ deferTownAction(402);
+ }
+ break;
+ case 401:
+ _facing = 4;
+ say(0, 1);
+ _town.craterVisited = 1;
+ deferTownAction(402);
+ break;
+ case 402: // Descend to Joshua's camp.
+ walkTo(Common::Point(336, 503));
+ leaveTownRoom(6291);
+ break;
+ default:
+ return kUnhandled;
+ }
+ return kHandled;
+}
+
+} // End of namespace Hollywood
diff --git a/engines/hollywood/runaway/scene6290.cpp b/engines/hollywood/runaway/scene6290.cpp
new file mode 100644
index 00000000000..3e15c2ff747
--- /dev/null
+++ b/engines/hollywood/runaway/scene6290.cpp
@@ -0,0 +1,454 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+
+#include "common/util.h"
+#include "hollywood/runaway/scene.h"
+
+namespace Hollywood {
+namespace {
+
+const RunawayHotspot kHotspots[] = {
+ {"", 0, 0, 0, {0, 0}, {0, 0}},
+ {"Crater", 0, 537, 5, {301, 302}, {0, 3}},
+ {"Trail", 1739, 442, 3, {303, 304}, {0, 3}},
+ {"Panel of buttons", 440, 556, 7, {305, 306}, {0, 1}},
+ {"Switch", 607, 549, 7, {307, 308}, {0, 0}},
+ {"Motorcycle", 1133, 434, 0, {309, 310}, {0, 0}},
+ {"Camping tent", 1396, 293, 3, {311, 312}, {0, 0}},
+ {"Lighting panel", 0, 0, 7, {313, 314}, {0, 0}},
+ {"Joshua", 440, 556, 7, {315, 316}, {0, 1}},
+ {"Strap", 0, 0, 7, {317, 318}, {0, 0}},
+ {"Wrench", 0, 0, 7, {319, 320}, {0, 0}},
+ {"Machine", 0, 0, 0, {321, 322}, {0, 0}},
+ {"", 0, 0, 0, {1, 1}, {0, 0}},
+ {"Rotor", 0, 0, 7, {330, 331}, {0, 0}},
+ {"", 0, 0, 0, {1, 1}, {0, 0}}
+};
+
+const RunawayResponse kResponses[] = {
+ {6290, 301, 1, 0}, // Look down into the crater.
+ {6290, 303, 2, 0}, // Look at the trail back to town.
+ {6290, 305, 3, 0}, // Examine the musical keyboard.
+ {6290, 306, 4, 1}, // The keyboard has no power yet.
+ {6290, 307, 5, 0}, // Look at the machine's switch.
+ {6290, 308, 6, 1}, // The switch cannot start the unpowered machine.
+ {6290, 311, 9, 0}, // Look at Joshua's tent.
+ {6290, 312, 10, 0}, // Do not rummage through Joshua's belongings.
+ {6290, 313, 11, 0}, // Examine the lights before using the machine.
+ {6290, 314, 12, 0}, // Leave the lighting panel alone.
+ {6290, 318, 15, 0}, // Leave the delivered strap for Joshua.
+ {6290, 319, 16, 0}, // Examine the delivered wrench.
+ {6290, 320, 15, 0}, // Leave the delivered wrench for Joshua.
+ {6290, 322, 18, 0}, // Refuse to move the machine.
+ {6290, 326, 23, 0}, // Do not give Joshua the gasoline.
+ {6290, 327, 24, 0}, // Do not pour concentrated gasoline into the motorcycle.
+ {6290, 330, 26, 0}, // Identify the rotor's purpose.
+ {6290, 331, 27, 0}, // Turning the rotor by hand would not help.
+ {6290, 332, 28, 0} // Let Joshua use the wrench.
+};
+
+const RunawayItemAction kItemActions[] = {
+ {6290, 10, 5, 332, false}, {6290, 10, 8, 324},
+ {6290, 11, 5, 323, false}, {6290, 11, 8, 325}, {6290, 11, 13, 323, false},
+ {6290, 12, 5, 327, false}, {6290, 12, 8, 326, false},
+ {6290, 24, 5, 328, false}, {6290, 24, 8, 326, false}
+};
+
+} // End of anonymous namespace
+
+const RunawayRoom kRunawayScene6290 = {
+ 6290, 1740, 600, kHotspots, ARRAYSIZE(kHotspots),
+ {{100, 100, 100}, {80, 70, 70}, {70, 60, 60}, {60, 50, 50}}, Common::Point(1739, 442),
+ kResponses, ARRAYSIZE(kResponses), kItemActions, ARRAYSIZE(kItemActions), nullptr, 0
+};
+
+bool RunawayRoomScene::loadScene6290() {
+ return _npc.load(_archive, 10, 131) && _machine.load(_archive, 5, 52) &&
+ _ambient.load(_archive, 7, 6) && _overlay.load(_archive, 8, 31) && _machineIndicator.load(_archive, 12, 2) &&
+ loadForeground(0, 4) && loadForeground(1, 11);
+}
+
+void RunawayRoomScene::start6290() {
+ walkTo(Common::Point(1363, 484), 5);
+ if (!_town.joshuaMet) {
+ deferTownAction(400);
+ } else if ((_town.strapDelivered == 1 && !_town.wrenchNeeded) || _town.strapDelivered == 2) {
+ deferTownAction(420);
+ }
+}
+
+void RunawayRoomScene::update6290() {
+ if (drawingRoomAnimation() || _now - _joshuaTick < 80) {
+ return;
+ }
+ _joshuaTick = _now;
+ if (_joshuaTalking) {
+ if (_joshuaFrame > 6 || speaker()) {
+ _joshuaFrame = 6;
+ } else if (_joshuaFrame < 6) {
+ ++_joshuaFrame;
+ }
+ } else if (_joshuaFrame > 11) {
+ if (_joshuaFrame == 99 || _joshuaFrame == 130) {
+ _joshuaFrame = 0;
+ } else {
+ ++_joshuaFrame;
+ }
+ } else if (_joshuaFrame) {
+ --_joshuaFrame;
+ } else if (!_random.getRandomNumber(49)) {
+ _joshuaFrame = _random.getRandomBit() ? 12 : 100;
+ }
+}
+
+void RunawayRoomScene::updateMaps6290() {
+ for (uint i = 0; i < 256; ++i) {
+ if (_maps[i] == 3) {
+ _maps[i] = 0; // Joshua occupies the approach to the machine.
+ }
+ switch (_originalMaps[256 + i]) {
+ case 1: // The crater floor becomes accessible after Joshua's departure.
+ _maps[256 + i] = 0;
+ break;
+ case 3: // The controls are part of the machine until it is powered.
+ case 4:
+ case 14:
+ _maps[256 + i] = 11;
+ break;
+ case 9:
+ _maps[256 + i] = _town.strapDelivered == 1 ? 9 : 5;
+ break;
+ case 10:
+ _maps[256 + i] = _town.wrenchDelivered == 1 ? 10 : 0;
+ break;
+ case 12:
+ _maps[256 + i] = 8;
+ break;
+ case 13:
+ _maps[256 + i] = _town.rotorKnown ? 13 : 11;
+ break;
+ default:
+ break;
+ }
+ }
+}
+
+float RunawayRoomScene::actorHeight6290() const {
+ if (_position.x < 1713 && _position.y < 356) {
+ return _position.y * 1.75757575f - 259.69696f;
+ }
+ return (_position.x * -0.0231607631f + 425.276581f +
+ _position.y * 0.440251559f + 191.289307f) / 2;
+}
+
+void RunawayRoomScene::drawScene6290(Graphics::ManagedSurface &viewport, bool foreground) {
+ if (foreground) {
+ if (_position.x > 1380) {
+ drawForeground(viewport, 0);
+ }
+ if (_position.y < 356) {
+ drawForeground(viewport, 1);
+ }
+ return;
+ }
+ if (!drawingRoomAnimation()) {
+ _npc.draw(viewport, _joshuaTalking && speaker() ? 6 + speechFrame() % 6 : _joshuaFrame, _camera.x, 0);
+ }
+ _machine.draw(viewport, _town.strapDelivered >= 2 ? 1 : 0, _camera.x, 0);
+ _overlay.draw(viewport, 0, _camera.x, 0);
+ _ambient.draw(viewport, 0, _camera.x, 0);
+ _machineIndicator.draw(viewport, 0, _camera.x, 0);
+}
+
+RunawayRoomScene::ActionResult RunawayRoomScene::execute6290(uint16 action) {
+ switch (action) {
+ case 304: // Return to the overview; Joshua works while Brian is away.
+ if (_town.strapDelivered == 1 && _town.wrenchDelivered == 1) {
+ _town.strapDelivered = 2;
+ _town.wrenchDelivered = 2;
+ }
+ _town.campLeft = 1;
+ _audio.playMusic(12 + _random.getRandomNumber(4));
+ leaveTownRoom(6350);
+ break;
+ case 309: // Examine the motorcycle before or after the repair.
+ say(7, _town.fuelNeeded);
+ break;
+ case 310: // Try to start the motorcycle without fuel.
+ say(8, _town.fuelNeeded);
+ break;
+ case 315: // Look at Joshua.
+ say(13, _random.getRandomNumber(2));
+ break;
+ case 316: // Talk to Joshua, or give him the wrench he requested.
+ if (_town.strapDelivered == 1 && (!_town.wrenchNeeded || _town.wrenchDelivered)) {
+ say(22);
+ } else if (_town.strapDelivered == 1 && _town.wrenchNeeded && _inventory.contains(10)) {
+ execute6290(324);
+ } else {
+ startJoshuaConversation(false);
+ }
+ break;
+ case 317: // Look at the strap waiting to be fitted.
+ say(14, _town.wrenchNeeded && !_inventory.contains(10) && !_town.wrenchDelivered);
+ break;
+ case 321: // Name the machine after discussing it with Joshua.
+ say(17, _town.machineKnown);
+ break;
+ case 323: // Work out how the strap could drive the rotor.
+ if (!_town.rotorKnown) {
+ say(19);
+ } else if (_inventory.town().strap != 2) {
+ say(19, _town.strapIdea ? 2 : 1);
+ _town.strapIdea = 1;
+ _inventory.town().strap = 1;
+ } else {
+ say(19, 3);
+ deferTownAction(423);
+ }
+ break;
+ case 423: // Brian decides to leave the assembly to Joshua.
+ _facing = 4;
+ say(19, 4);
+ break;
+ case 324: // Give Joshua the number ten wrench.
+ _inventory.select(0);
+ _joshuaTalking = true;
+ say(20);
+ say(20, 1, false, 1);
+ say(20, 2);
+ say(20, 3, false, 1);
+ say(20, 4);
+ deferTownAction(424);
+ break;
+ case 424:
+ _joshuaTalking = false;
+ walkTo(Common::Point(1133, 434), 7, false, true);
+ deferTownAction(425);
+ break;
+ case 425: // Put the wrench beside the strap.
+ _inventory.remove(10);
+ _town.wrenchDelivered = 1;
+ walkTo(Common::Point(512, 568), 5, false, true);
+ deferTownAction(426);
+ return kBackgroundChanged;
+ case 426:
+ say(20, 5);
+ break;
+ case 325: // Explain the drive belt idea and give Joshua the joined strap.
+ if (!_town.rotorKnown) {
+ say(25, 0, true);
+ } else if (_inventory.town().strap != 2) {
+ say(19, 2);
+ _inventory.town().strap = 1;
+ } else {
+ _joshuaTalking = true;
+ say(20);
+ say(20, 1, false, 1);
+ for (uint i = 0; i <= 6; ++i) {
+ say(21, i, false, i % 2);
+ }
+ deferTownAction(430);
+ }
+ break;
+ case 430:
+ _joshuaTalking = false;
+ walkTo(Common::Point(1133, 434), 7, false, true);
+ deferTownAction(431);
+ break;
+ case 431: // Put the strap beside the motorcycle.
+ _inventory.select(0);
+ _inventory.remove(11);
+ _town.strapDelivered = 1;
+ walkTo(Common::Point(512, 568), 5, false, true);
+ deferTownAction(432);
+ return kBackgroundChanged;
+ case 432:
+ say(21, 7);
+ break;
+ case 328: // Only correctly diluted gasoline can run the motorcycle.
+ if (!_town.bottleContents) {
+ say(19, 1, true);
+ } else if (_town.bottleContents == 1) {
+ say(25);
+ } else {
+ return kUnhandled; // Starting the powered machine is not implemented yet.
+ }
+ break;
+ case 400: // Call to Joshua from the trail.
+ say(0);
+ deferTownAction(401);
+ break;
+ case 401:
+ walkTo(Common::Point(440, 556), 7, false, true);
+ deferTownAction(402);
+ break;
+ case 402:
+ say(0, 1);
+ deferTownAction(403);
+ break;
+ case 403: // Joshua finishes receiving a telepathic message.
+ beginRoomAnimationRange(403, 10, 131, 12, 99, false);
+ break;
+ case 1403:
+ beginRoomAnimationRange(404, 10, 131, 0, 6, false);
+ break;
+ case 1404:
+ _joshuaFrame = 6;
+ _joshuaTalking = true;
+ say(0, 4, false, 1);
+ say(0, 5);
+ deferTownAction(405);
+ break;
+ case 405:
+ beginRoomAnimationRange(405, 10, 131, 100, 130, false);
+ break;
+ case 1405: // Joshua introduces Trantor and the communication machine.
+ for (uint i = 6; i <= 18; ++i) {
+ say(0, i, false, !(i % 2));
+ }
+ _town.joshuaMet = 1;
+ deferTownAction(406);
+ break;
+ case 406:
+ startJoshuaConversation(true);
+ break;
+ case 410: // Joshua resumes his idle animation after a conversation.
+ _joshuaTalking = false;
+ break;
+ case 420: // On returning, discover Joshua needs a wrench or fuel.
+ say(0, _town.strapDelivered == 1 ? 19 : 26);
+ deferTownAction(421);
+ break;
+ case 421:
+ walkTo(Common::Point(440, 556), 7, false, true);
+ deferTownAction(422);
+ break;
+ case 422:
+ _joshuaTalking = true;
+ say(20);
+ say(20, 1, false, 1);
+ if (_town.strapDelivered == 1) {
+ _town.wrenchNeeded = 1;
+ say(0, 20);
+ say(0, 21, false, 1);
+ say(0, 22);
+ deferTownAction(427);
+ } else {
+ _town.strapDelivered = 3;
+ _town.fuelNeeded = 1;
+ say(0, 27);
+ say(0, 28, false, 1);
+ say(0, 29);
+ say(0, 30, false, 1);
+ deferTownAction(410);
+ }
+ break;
+ case 427:
+ _facing = 4;
+ say(0, 23);
+ deferTownAction(428);
+ break;
+ case 428:
+ _facing = 7;
+ say(0, 24);
+ say(0, 25, false, 1);
+ deferTownAction(410);
+ break;
+ default:
+ return kUnhandled;
+ }
+ return kHandled;
+}
+
+void RunawayRoomScene::startJoshuaConversation(bool introduction) {
+ _conversation = 7;
+ _dialogueDepth = _dialogueNode = _dialogueIntro = 0;
+ _dialogueEnding = false;
+ _choices.clear();
+ _choiceIndices.clear();
+ memset(_dialogue, 0, sizeof(_dialogue));
+ _afterConversation = 410;
+ _joshuaTalking = true;
+ if (!introduction) {
+ say(20);
+ say(20, 1, false, 1);
+ }
+
+ static const DialogueChoice topics[][8] = {
+ {
+ {1, 0, 3, 0, 0, 1, 255}, {1, 0, 3, 1, 1, 1, 255},
+ {0, 0, 1, 15, 15, 1, 255}, {0, 0, 1, 16, 15, 1, 255},
+ {0, 1, 3, 6, 6, 5, 255}, {0, 0, 3, 7, 7, 1, 255},
+ {0, 0, 0, 8, 8, 11, 255}, {1, 0, 0, 9, 9, 0, 0}
+ },
+ {
+ {0, 0, 3, 2, 2, 6, 255}, {0, 0, 3, 3, 3, 1, 255},
+ {0, 0, 1, 4, 4, 7, 255}, {0, 0, 1, 5, 5, 1, 255},
+ {1, 0, 2, 17, 17, 0, 0}
+ },
+ {
+ {0, 0, 3, 10, 10, 15, 255}, {0, 0, 3, 11, 11, 8, 255},
+ {1, 0, 3, 12, 12, 1, 255}, {1, 0, 3, 13, 13, 1, 255},
+ {1, 0, 2, 14, 14, 0, 0}
+ }
+ };
+ for (uint i = 0; i < ARRAYSIZE(topics); ++i) {
+ memcpy(_dialogue[i * 10], topics[i], sizeof(topics[i]));
+ }
+ _dialogue[0][2].enabled = !_town.campLeft;
+ _dialogue[0][3].enabled = _town.campLeft;
+ _dialogue[0][4].enabled = !_town.helmetKnown;
+ _dialogue[0][5].enabled = _town.helmetKnown;
+ _dialogue[10][0].enabled = !_town.dimensionalDoorKnown;
+ _dialogue[10][1].enabled = _town.dimensionalDoorKnown;
+ _dialogue[10][2].enabled = !_town.machineKnown;
+ _dialogue[10][3].enabled = _town.machineKnown;
+ _dialogue[20][0].enabled = !_town.batteryKnown;
+ _dialogue[20][1].enabled = _town.batteryKnown;
+}
+
+void RunawayRoomScene::joshuaDialogueChoice(byte effect) {
+ switch (effect) {
+ case 5: // Joshua explains his telepathic helmet.
+ say(90, 7, false, 1);
+ _town.helmetKnown = 1;
+ break;
+ case 6:
+ _town.dimensionalDoorKnown = 1;
+ break;
+ case 7:
+ _town.machineKnown = 1;
+ break;
+ case 8: // Brian can now suggest driving the rotor with the motorcycle.
+ _town.rotorKnown = 1;
+ updateMaps();
+ break;
+ case 15: // Asking about the broken battery reveals the request for help.
+ _town.batteryKnown = 1;
+ _dialogue[20][1].enabled = 1;
+ break;
+ default:
+ break;
+ }
+}
+
+} // End of namespace Hollywood
diff --git a/engines/hollywood/runaway/scene6350.cpp b/engines/hollywood/runaway/scene6350.cpp
index 16ff433fc2b..ec4dc0431ff 100644
--- a/engines/hollywood/runaway/scene6350.cpp
+++ b/engines/hollywood/runaway/scene6350.cpp
@@ -48,13 +48,14 @@ const RunawayRoom kRunawayScene6350 = {
void RunawayRoomScene::resumeTown() {
_oscarTick = _now;
_saloonDoorTick = _now;
+ _joshuaTick = _now;
_saloonDoorFrame = _position.x > 726 ? 7 : 0;
if (_room == 6263) {
resume6263();
}
if (!_entering) {
if (!_audio.musicPlaying()) {
- _audio.playMusic(_room == 6200 || _room == 6210 ? 18 : 11);
+ _audio.playMusic(_room == 6290 ? 19 : _room == 6200 || _room == 6210 ? 18 : 11);
if (_room == 6200 || _room == 6210) {
_audio.setMusicVolume(191);
}
@@ -67,7 +68,9 @@ void RunawayRoomScene::resumeTown() {
return;
}
_town.arrived = 1;
- if (_room == 6200 || _room == 6210) {
+ if (_room == 6290) {
+ _audio.playMusic(19);
+ } else if (_room == 6200 || _room == 6210) {
if (_entryScene == 6200 || !_audio.musicPlaying()) {
_audio.playMusic(18);
}
@@ -99,6 +102,10 @@ void RunawayRoomScene::resumeTown() {
start6240();
} else if (_room == 6260) {
start6260();
+ } else if (_room == 6270) {
+ start6270();
+ } else if (_room == 6290) {
+ start6290();
} else if (_room == 6370) {
_town.streetVisited = 1;
start6370();
@@ -115,6 +122,9 @@ void RunawayRoomScene::updateTown() {
if (_room == 6263) {
update6263();
}
+ if (_room == 6290) {
+ update6290();
+ }
if (_townEncounter.phase != TownEncounter::kInactive) {
update6220();
return;
diff --git a/engines/hollywood/runaway/scene_data.h b/engines/hollywood/runaway/scene_data.h
index f6f4f097291..54f0e0d4815 100644
--- a/engines/hollywood/runaway/scene_data.h
+++ b/engines/hollywood/runaway/scene_data.h
@@ -116,6 +116,8 @@ extern const RunawayRoom kRunawayScene6220;
extern const RunawayRoom kRunawayScene6240;
extern const RunawayRoom kRunawayScene6260;
extern const RunawayRoom kRunawayScene6263;
+extern const RunawayRoom kRunawayScene6270;
+extern const RunawayRoom kRunawayScene6290;
extern const RunawayRoom kRunawayScene6350;
extern const RunawayRoom kRunawayScene6370;
Commit: 9ee4f4f4c460151a7cc01ce0cac27b4ea5f65eb4
https://github.com/scummvm/scummvm/commit/9ee4f4f4c460151a7cc01ce0cac27b4ea5f65eb4
Author: neuromancer (gustavo.grieco at gmail.com)
Date: 2026-11-19T19:38:52+01:00
Commit Message:
HOLLYWOOD: RUNAWAY: migrated 6270 and 6290 to classes
Changed paths:
A engines/hollywood/runaway/scene6270.h
A engines/hollywood/runaway/scene6290.h
engines/hollywood/runaway/engine.cpp
engines/hollywood/runaway/scene.cpp
engines/hollywood/runaway/scene.h
engines/hollywood/runaway/scene4070.cpp
engines/hollywood/runaway/scene6270.cpp
engines/hollywood/runaway/scene6290.cpp
engines/hollywood/runaway/scene6350.cpp
diff --git a/engines/hollywood/runaway/engine.cpp b/engines/hollywood/runaway/engine.cpp
index c568a29c831..5aabd7a4196 100644
--- a/engines/hollywood/runaway/engine.cpp
+++ b/engines/hollywood/runaway/engine.cpp
@@ -43,6 +43,8 @@
#include "hollywood/runaway/scene.h"
#include "hollywood/runaway/scene_data.h"
#include "hollywood/runaway/scene5030.h"
+#include "hollywood/runaway/scene6270.h"
+#include "hollywood/runaway/scene6290.h"
#include "hollywood/runaway/strings.h"
#include "hollywood/runaway/ui.h"
@@ -162,9 +164,18 @@ Common::Error RunawayEngine::loadGameStream(Common::SeekableReadStream *stream)
}
RunawayScene *RunawayEngine::createScene(uint16 entryScene) {
- if (findRunawayRoom(entryScene) && ((_museum && entryScene >= 4000) ||
- (_game == kRunawayFullGame && (entryScene / 1000 == 2 || entryScene / 1000 == 4 || entryScene / 1000 == 5 || entryScene / 1000 == 6))))
- return new RunawayRoomScene(_audio, *_inventory, _strings, _game);
+ const RunawayRoom *room = findRunawayRoom(entryScene);
+ if (room && ((_museum && entryScene >= 4000) ||
+ (_game == kRunawayFullGame && (entryScene / 1000 == 2 || entryScene / 1000 == 4 || entryScene / 1000 == 5 || entryScene / 1000 == 6)))) {
+ switch (room->number) {
+ case 6270:
+ return new Runaway::Scene6270(_audio, *_inventory, _strings, _game);
+ case 6290:
+ return new Runaway::Scene6290(_audio, *_inventory, _strings, _game);
+ default:
+ return new RunawayRoomScene(_audio, *_inventory, _strings, _game);
+ }
+ }
if ((_game == kRunawayCabinDemo && entryScene == 5030) ||
(_game == kRunawayFullGame && entryScene >= 5030 && entryScene <= 5032))
return new RunawayScene5030(_mixer, _audio, *_inventory, _strings, _game);
diff --git a/engines/hollywood/runaway/scene.cpp b/engines/hollywood/runaway/scene.cpp
index 4c03793cf42..2035594f2d6 100644
--- a/engines/hollywood/runaway/scene.cpp
+++ b/engines/hollywood/runaway/scene.cpp
@@ -308,10 +308,20 @@ bool RunawayRoomScene::enterRoom(uint16 number, Common::Point position, byte fac
for (uint i = 0; i < ARRAYSIZE(_saloonPatches); ++i) {
_saloonPatches[i].clear();
}
+ if (!loadCustomResources() || !rebuildBackground()) {
+ return false;
+ }
+ _keyCount = _pressedKey = 0;
+ updateMaps();
+ updateCamera();
+ return _actor.setFrame(_facing, 0);
+}
+
+bool RunawayRoomScene::loadCustomResources() {
bool loaded = true;
if (desertChapter())
loaded = loadDesertRoom();
- switch (number) {
+ switch (_room) {
case kHospitalBedroom:
loaded = loadScene2020();
break;
@@ -368,21 +378,13 @@ bool RunawayRoomScene::enterRoom(uint16 number, Common::Point position, byte fac
case 6263:
loaded = loadScene6263();
break;
- case 6290:
- loaded = loadScene6290();
- break;
case 6370:
loaded = _npc.load(_archive, 4, 88) && _ambient.load(_archive, 5, 20);
break;
default:
break;
}
- if (!loaded || !rebuildBackground())
- return false;
- _keyCount = _pressedKey = 0;
- updateMaps();
- updateCamera();
- return _actor.setFrame(_facing, 0);
+ return loaded;
}
bool RunawayRoomScene::loadForeground(uint layer, uint chunk, bool pixels) {
@@ -413,12 +415,15 @@ bool RunawayRoomScene::applyPatch(uint chunk) {
}
bool RunawayRoomScene::rebuildBackground() {
+ return loadBackground() && applyCustomBackgroundPatches();
+}
+
+bool RunawayRoomScene::loadBackground() {
const RunawayRoom *room = findRoom(_room);
- if (_room == 6270) {
- return loadBackground6270();
- }
- if (!loadRunawaySurface(_archive, _room == 6263 ? 20 : 0, room->width, room->height, _background))
- return false;
+ return loadRunawaySurface(_archive, _room == 6263 ? 20 : 0, room->width, room->height, _background);
+}
+
+bool RunawayRoomScene::applyCustomBackgroundPatches() {
if (desertChapter())
return applyDesertBackground();
switch (_room) {
@@ -450,8 +455,6 @@ bool RunawayRoomScene::rebuildBackground() {
return !_town.flowerPotTaken || applyPatch(9);
case 6260:
return applyBackground6260();
- case 6290:
- return (_town.strapDelivered != 1 || applyPatch(13)) && (_town.wrenchDelivered != 1 || applyPatch(14));
case 6350:
return !_town.arrived || (applyPatch(5) && applyPatch(7));
default:
@@ -461,6 +464,10 @@ bool RunawayRoomScene::rebuildBackground() {
void RunawayRoomScene::updateMaps() {
_maps = _originalMaps;
+ applyCustomHotspotState();
+}
+
+void RunawayRoomScene::applyCustomHotspotState() {
if (_room == 6220) {
for (uint i = 0; i < 256; ++i) {
// The balcony shares this mask but is reached through Kevin's room.
@@ -523,9 +530,6 @@ void RunawayRoomScene::updateMaps() {
case 6260:
updateMaps6260();
break;
- case 6290:
- updateMaps6290();
- break;
case kHospitalBedroom:
updateMaps2020();
break;
@@ -581,9 +585,6 @@ Common::U32String RunawayRoomScene::hotspotName(byte id) const {
if (_room == 6080 && id == 2 && _town.oilCan) {
return Common::U32String("Oil can");
}
- if (_room == 6290 && id == 11 && _town.machineKnown) {
- return Common::U32String("Communication machine");
- }
if (_room == 6090 && id == 4 && _town.oscarTobacco) {
return Common::U32String("Oscar");
}
@@ -645,10 +646,8 @@ void RunawayRoomScene::walkTo(Common::Point target, byte facing, bool scripted,
_walkPath.setTarget(target);
} else if (reserved) {
_walkPath.findPath(RunawayWalkMap(_background.w, _background.h, _mask, _originalMaps), target);
- } else if (_room == 6080 || _room == 6180 || _room == 6240 || _room == 6260 || _room == 6290) {
- walkTown(target);
} else {
- _walkPath.findPath(RunawayWalkMap(_background.w, _background.h, _mask, _maps), target);
+ findWalkPath(target);
}
_arrivalFacing = facing;
_walkElapsed = _lastFootstep = 0;
@@ -656,6 +655,14 @@ void RunawayRoomScene::walkTo(Common::Point target, byte facing, bool scripted,
arrive();
}
+void RunawayRoomScene::findWalkPath(Common::Point target) {
+ if (_room == 6080 || _room == 6180 || _room == 6240 || _room == 6260) {
+ walkTown(target);
+ } else {
+ _walkPath.findPath(RunawayWalkMap(_background.w, _background.h, _mask, _maps), target);
+ }
+}
+
void RunawayRoomScene::arrive() {
if (_arrivalFacing != 0xff) {
_facing = _arrivalFacing;
@@ -819,7 +826,7 @@ void RunawayRoomScene::useItem(byte item, byte id) {
say(1, 0, true);
}
-void RunawayRoomScene::execute(uint16 action) {
+RunawayRoomScene::ActionResult RunawayRoomScene::dispatchCustomSceneAction(uint16 action) {
ActionResult result = desertChapter() ? executeDesert(action) : kUnhandled;
switch (_room) {
case kHospitalBedroom:
@@ -882,12 +889,6 @@ void RunawayRoomScene::execute(uint16 action) {
case 6263:
result = execute6263(action);
break;
- case 6270:
- result = execute6270(action);
- break;
- case 6290:
- result = execute6290(action);
- break;
case 6350:
result = execute6350(action);
break;
@@ -897,6 +898,11 @@ void RunawayRoomScene::execute(uint16 action) {
default:
break;
}
+ return result;
+}
+
+void RunawayRoomScene::execute(uint16 action) {
+ const ActionResult result = dispatchCustomSceneAction(action);
if (result == kBackgroundChanged) {
if (!rebuildBackground())
error("Cannot update Runaway room %u", _room);
@@ -948,7 +954,11 @@ void RunawayRoomScene::setCameraX(int x) {
void RunawayRoomScene::updateCamera() {
setCameraX(_position.x - kRunawayScreenWidth / 2);
- _camera.y = _room == 6270 || (_room == kMuseumHall && _upperFloor) ? 0 :
+ _camera.y = sceneViewportYOffset();
+}
+
+int RunawayRoomScene::sceneViewportYOffset() const {
+ return _room == kMuseumHall && _upperFloor ? 0 :
CLIP<int>(_position.y - 400, _room == kMuseumHall ? 200 : 0, _background.h - kRunawayViewportHeight);
}
@@ -996,10 +1006,6 @@ float RunawayRoomScene::actorHeight() const {
return _position.y * 0.95f - 175;
case 6263:
return _position.y * 1.04838705f - 175.645157f;
- case 6270:
- return _position.y * 0.149253726f + 225.671646f;
- case 6290:
- return actorHeight6290();
case 6370:
return _position.y * 0.634920657f - 221.190475f;
default:
@@ -1036,7 +1042,7 @@ void RunawayRoomScene::update(uint32 now, int scrollDirection, bool inventoryOpe
else if (_room == kHospitalBathroom)
update2080();
if (townChapter()) {
- updateTown();
+ updateTown(elapsed);
if (_sequence.active() || _transition.scene)
return;
} else if (desertChapter()) {
@@ -1122,41 +1128,7 @@ void RunawayRoomScene::draw() {
drawScene4140(viewport);
return;
}
- if (_room == 6080) {
- drawScene6080(viewport, false);
- } else if (_room == 6090) {
- drawScene6090(viewport, false);
- } else if (_room == 6130) {
- _npc.draw(viewport, oscarFrame(), _camera.x, -_camera.y);
- } else if (_room == 6180) {
- drawScene6180(viewport, false);
- } else if (_room == 6200) {
- drawScene6200(viewport);
- } else if (_room == 6220) {
- drawScene6220(viewport);
- } else if (_room == 6263) {
- drawScene6263(viewport);
- } else if (_room == 6290) {
- drawScene6290(viewport, false);
- } else if (_room == 6370) {
- drawScene6370(viewport);
- } else if (desertChapter()) {
- drawDesertRoom(viewport, false);
- } else if (_room == kMuseumWilly) {
- drawScene4070(viewport);
- } else if (_room == kHospitalBedroom) {
- drawScene2020(viewport, false);
- } else if (_room == kHospitalBathroom) {
- drawScene2080(viewport, false);
- } else if (_room == kMuseumSecurity && museumChapter()) {
- drawScene4100(viewport);
- } else {
- const bool movingSusan = museumChapter() && _room == kMuseumLaboratory && drawingRoomAnimation() &&
- (_roomAction == 450 || _roomAction == 451 || _roomAction == 452 || _roomAction == 331 || _roomAction == 454);
- if (!movingSusan && (!museumChapter() || _room != kMuseumHall || !_museum.willyInLab))
- _ambient.draw(viewport, museumChapter() ? _ambientFrame : 0, _camera.x, -_camera.y);
- _overlay.draw(viewport, 0, _camera.x, -_camera.y);
- }
+ drawCustomBackgroundComposite(viewport);
RunawayActor::RenderParams params;
// Earlier rooms use six depth layers; Douglasville also uses layers 7..9.
for (uint i = 0; i < 7; ++i)
@@ -1230,6 +1202,46 @@ void RunawayRoomScene::draw() {
if (!_secondaryFrames.empty())
_secondaryAnimation.draw(viewport, _secondaryFrames[MIN<uint>(_actionStep, _secondaryFrames.size() - 1)], _camera.x, -_camera.y);
}
+ drawCustomForegroundComposite(viewport);
+}
+
+void RunawayRoomScene::drawCustomBackgroundComposite(Graphics::ManagedSurface &viewport) {
+ if (_room == 6080) {
+ drawScene6080(viewport, false);
+ } else if (_room == 6090) {
+ drawScene6090(viewport, false);
+ } else if (_room == 6130) {
+ _npc.draw(viewport, oscarFrame(), _camera.x, -_camera.y);
+ } else if (_room == 6180) {
+ drawScene6180(viewport, false);
+ } else if (_room == 6200) {
+ drawScene6200(viewport);
+ } else if (_room == 6220) {
+ drawScene6220(viewport);
+ } else if (_room == 6263) {
+ drawScene6263(viewport);
+ } else if (_room == 6370) {
+ drawScene6370(viewport);
+ } else if (desertChapter()) {
+ drawDesertRoom(viewport, false);
+ } else if (_room == kMuseumWilly) {
+ drawScene4070(viewport);
+ } else if (_room == kHospitalBedroom) {
+ drawScene2020(viewport, false);
+ } else if (_room == kHospitalBathroom) {
+ drawScene2080(viewport, false);
+ } else if (_room == kMuseumSecurity && museumChapter()) {
+ drawScene4100(viewport);
+ } else {
+ const bool movingSusan = museumChapter() && _room == kMuseumLaboratory && drawingRoomAnimation() &&
+ (_roomAction == 450 || _roomAction == 451 || _roomAction == 452 || _roomAction == 331 || _roomAction == 454);
+ if (!movingSusan && (!museumChapter() || _room != kMuseumHall || !_museum.willyInLab))
+ _ambient.draw(viewport, museumChapter() ? _ambientFrame : 0, _camera.x, -_camera.y);
+ _overlay.draw(viewport, 0, _camera.x, -_camera.y);
+ }
+}
+
+void RunawayRoomScene::drawCustomForegroundComposite(Graphics::ManagedSurface &viewport) {
if (desertChapter())
drawDesertRoom(viewport, true);
else if (_room == kHospitalBedroom)
@@ -1250,8 +1262,6 @@ void RunawayRoomScene::draw() {
drawForeground6240(viewport);
} else if (_room == 6260) {
drawForeground(viewport, 0);
- } else if (_room == 6290) {
- drawScene6290(viewport, true);
}
}
diff --git a/engines/hollywood/runaway/scene.h b/engines/hollywood/runaway/scene.h
index 310197019eb..865b9b58ca7 100644
--- a/engines/hollywood/runaway/scene.h
+++ b/engines/hollywood/runaway/scene.h
@@ -118,10 +118,25 @@ public:
bool restoreState(const RunawaySaveState &state, uint32 now, bool entering = false) override;
void setOptions(bool antialias, bool fastScrolling) override { _antialias = antialias; _fastScrolling = fastScrolling; }
-private:
+protected:
enum ObjectState { kUnexamined, kIdentified, kTaken };
enum ActionResult { kUnhandled, kHandled, kBackgroundChanged };
+ virtual bool loadCustomResources();
+ virtual bool loadBackground();
+ virtual bool applyCustomBackgroundPatches();
+ virtual void applyCustomHotspotState();
+ virtual void prepareCustomGameplayLoop();
+ virtual void runCustomEntrySequence();
+ virtual void advanceCustomGameplayLoop(uint32 delta);
+ virtual void drawCustomBackgroundComposite(Graphics::ManagedSurface &viewport);
+ virtual void drawCustomForegroundComposite(Graphics::ManagedSurface &viewport);
+ virtual ActionResult dispatchCustomSceneAction(uint16 action);
+ virtual void handleCustomDialogueChoice(byte effect);
+ virtual void resumeAmbientAudio(bool entering);
+ virtual void findWalkPath(Common::Point target);
+ virtual int sceneViewportYOffset() const;
+
bool enterRoom(uint16 room, Common::Point position, byte facing);
bool loadForeground(uint layer, uint chunk, bool pixels = false);
void drawForeground(Graphics::ManagedSurface &viewport, uint layer);
@@ -150,9 +165,9 @@ private:
bool drawingRoomAnimation() const { return _roomAction && !_actionFrames.empty() && (_actionHoldSpeech || !speaking()) && !_walkPath.active(); }
void updateRoomAnimation();
void finishHospitalAnimation(uint16 action);
- float actorHeight() const;
+ virtual float actorHeight() const;
const RunawayHotspot *hotspot(byte id) const;
- Common::U32String hotspotName(byte id) const;
+ virtual Common::U32String hotspotName(byte id) const;
byte walkZone() const { return _originalMaps[_mask[_position.y * _background.w + _position.x]]; }
@@ -290,7 +305,7 @@ private:
bool townChapter() const { return _game == kRunawayFullGame && _room / 1000 == 6; }
void resumeTown();
- void updateTown();
+ void updateTown(uint32 delta);
void leaveTownRoom(uint16 scene);
void deferTownAction(uint16 action);
void walkTown(Common::Point target);
@@ -340,18 +355,6 @@ private:
void drawScene6263(Graphics::ManagedSurface &viewport);
ActionResult execute6263(uint16 action);
void locomotiveAnimationFrame();
- void start6270();
- bool loadBackground6270();
- ActionResult execute6270(uint16 action);
- void start6290();
- bool loadScene6290();
- void update6290();
- void updateMaps6290();
- void drawScene6290(Graphics::ManagedSurface &viewport, bool foreground);
- float actorHeight6290() const;
- ActionResult execute6290(uint16 action);
- void startJoshuaConversation(bool introduction);
- void joshuaDialogueChoice(byte effect);
ActionResult execute6350(uint16 action);
ActionResult execute6220(uint16 action);
void start6220();
@@ -412,10 +415,6 @@ private:
byte _oscarIdle = 3;
uint32 _oscarTick = 0;
bool _oscarTalking = false, _mineOscarPresent = false;
- byte _joshuaFrame = 0;
- uint32 _joshuaTick = 0;
- bool _joshuaTalking = false;
- RunawayAnimation _machineIndicator;
Common::Array<byte> _saloonPatches[3];
byte _saloonDoorFrame = 0;
uint32 _saloonDoorTick = 0;
diff --git a/engines/hollywood/runaway/scene4070.cpp b/engines/hollywood/runaway/scene4070.cpp
index 2179969db64..03af112a22f 100644
--- a/engines/hollywood/runaway/scene4070.cpp
+++ b/engines/hollywood/runaway/scene4070.cpp
@@ -249,14 +249,7 @@ void RunawayRoomScene::chooseDialogue(uint choice) {
_museum.batteryRequested = 1;
if (_conversation == 4 && entry.disable == 2)
_desert.ventSeen = 1;
- if (_conversation == 5)
- sushiDialogueChoice(entry.disable);
- if (_conversation == 6) {
- oscarDialogueChoice(entry.disable);
- }
- if (_conversation == 7) {
- joshuaDialogueChoice(entry.disable);
- }
+ handleCustomDialogueChoice(entry.disable);
if (_conversation == 2 && entry.disable == 10) {
_dialogue[10][3].player = 22;
_dialogue[10][3].response = 21;
@@ -282,6 +275,14 @@ void RunawayRoomScene::chooseDialogue(uint choice) {
}
}
+void RunawayRoomScene::handleCustomDialogueChoice(byte effect) {
+ if (_conversation == 5) {
+ sushiDialogueChoice(effect);
+ } else if (_conversation == 6) {
+ oscarDialogueChoice(effect);
+ }
+}
+
void RunawayRoomScene::updateConversation() {
if (!_conversation || _roomAction || speaking() || !_choices.empty())
return;
diff --git a/engines/hollywood/runaway/scene6270.cpp b/engines/hollywood/runaway/scene6270.cpp
index a3e528c85c6..a4325924fd7 100644
--- a/engines/hollywood/runaway/scene6270.cpp
+++ b/engines/hollywood/runaway/scene6270.cpp
@@ -20,7 +20,7 @@
*/
#include "common/util.h"
-#include "hollywood/runaway/scene.h"
+#include "hollywood/runaway/scene6270.h"
namespace Hollywood {
@@ -29,7 +29,12 @@ const RunawayRoom kRunawayScene6270 = {
Common::Point(133, 699), nullptr, 0, nullptr, 0, nullptr, 0
};
-bool RunawayRoomScene::loadBackground6270() {
+namespace Runaway {
+
+Scene6270::Scene6270(RunawayAudio &audio, RunawayInventory &inventory, const RunawayStrings &strings, RunawayGameType game) :
+ RunawayRoomScene(audio, inventory, strings, game) {}
+
+bool Scene6270::loadBackground() {
Graphics::ManagedSurface image;
if (!loadRunawaySurface(_archive, 0, 1024, 600, image)) {
return false;
@@ -41,12 +46,20 @@ bool RunawayRoomScene::loadBackground6270() {
return true;
}
-void RunawayRoomScene::start6270() {
+void Scene6270::runCustomEntrySequence() {
walkTo(Common::Point(341, 498), 1);
deferTownAction(400);
}
-RunawayRoomScene::ActionResult RunawayRoomScene::execute6270(uint16 action) {
+float Scene6270::actorHeight() const {
+ return _position.y * 0.149253726f + 225.671646f;
+}
+
+int Scene6270::sceneViewportYOffset() const {
+ return 0;
+}
+
+RunawayRoomScene::ActionResult Scene6270::dispatchCustomSceneAction(uint16 action) {
switch (action) {
case 400: // Brian looks down into the crater.
if (!_town.craterVisited) {
@@ -75,4 +88,5 @@ RunawayRoomScene::ActionResult RunawayRoomScene::execute6270(uint16 action) {
return kHandled;
}
+} // End of namespace Runaway
} // End of namespace Hollywood
diff --git a/engines/hollywood/runaway/scene6270.h b/engines/hollywood/runaway/scene6270.h
new file mode 100644
index 00000000000..eb4fe59784e
--- /dev/null
+++ b/engines/hollywood/runaway/scene6270.h
@@ -0,0 +1,45 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+
+#ifndef HOLLYWOOD_RUNAWAY_SCENE6270_H
+#define HOLLYWOOD_RUNAWAY_SCENE6270_H
+
+#include "hollywood/runaway/scene.h"
+
+namespace Hollywood {
+namespace Runaway {
+
+class Scene6270 : public RunawayRoomScene {
+public:
+ Scene6270(RunawayAudio &audio, RunawayInventory &inventory, const RunawayStrings &strings, RunawayGameType game);
+
+private:
+ bool loadBackground() override;
+ void runCustomEntrySequence() override;
+ ActionResult dispatchCustomSceneAction(uint16 action) override;
+ float actorHeight() const override;
+ int sceneViewportYOffset() const override;
+};
+
+} // End of namespace Runaway
+} // End of namespace Hollywood
+
+#endif // HOLLYWOOD_RUNAWAY_SCENE6270_H
diff --git a/engines/hollywood/runaway/scene6290.cpp b/engines/hollywood/runaway/scene6290.cpp
index 3e15c2ff747..8d57a41ef80 100644
--- a/engines/hollywood/runaway/scene6290.cpp
+++ b/engines/hollywood/runaway/scene6290.cpp
@@ -20,7 +20,7 @@
*/
#include "common/util.h"
-#include "hollywood/runaway/scene.h"
+#include "hollywood/runaway/scene6290.h"
namespace Hollywood {
namespace {
@@ -80,13 +80,32 @@ const RunawayRoom kRunawayScene6290 = {
kResponses, ARRAYSIZE(kResponses), kItemActions, ARRAYSIZE(kItemActions), nullptr, 0
};
-bool RunawayRoomScene::loadScene6290() {
- return _npc.load(_archive, 10, 131) && _machine.load(_archive, 5, 52) &&
- _ambient.load(_archive, 7, 6) && _overlay.load(_archive, 8, 31) && _machineIndicator.load(_archive, 12, 2) &&
+namespace Runaway {
+
+Scene6290::Scene6290(RunawayAudio &audio, RunawayInventory &inventory, const RunawayStrings &strings, RunawayGameType game) :
+ RunawayRoomScene(audio, inventory, strings, game) {}
+
+bool Scene6290::loadCustomResources() {
+ return _joshuaAnimation.load(_archive, 10, 131) && _machineAnimation.load(_archive, 5, 52) &&
+ _machineAmbientAnimation.load(_archive, 7, 6) && _machineOverlayAnimation.load(_archive, 8, 31) && _machineIndicator.load(_archive, 12, 2) &&
loadForeground(0, 4) && loadForeground(1, 11);
}
-void RunawayRoomScene::start6290() {
+bool Scene6290::applyCustomBackgroundPatches() {
+ return (_town.strapDelivered != 1 || applyPatch(13)) && (_town.wrenchDelivered != 1 || applyPatch(14));
+}
+
+void Scene6290::prepareCustomGameplayLoop() {
+ _joshuaTick = _now;
+}
+
+void Scene6290::resumeAmbientAudio(bool entering) {
+ if (entering || !_audio.musicPlaying()) {
+ _audio.playMusic(19);
+ }
+}
+
+void Scene6290::runCustomEntrySequence() {
walkTo(Common::Point(1363, 484), 5);
if (!_town.joshuaMet) {
deferTownAction(400);
@@ -95,7 +114,7 @@ void RunawayRoomScene::start6290() {
}
}
-void RunawayRoomScene::update6290() {
+void Scene6290::advanceCustomGameplayLoop(uint32 delta) {
if (drawingRoomAnimation() || _now - _joshuaTick < 80) {
return;
}
@@ -119,7 +138,7 @@ void RunawayRoomScene::update6290() {
}
}
-void RunawayRoomScene::updateMaps6290() {
+void Scene6290::applyCustomHotspotState() {
for (uint i = 0; i < 256; ++i) {
if (_maps[i] == 3) {
_maps[i] = 0; // Joshua occupies the approach to the machine.
@@ -151,7 +170,7 @@ void RunawayRoomScene::updateMaps6290() {
}
}
-float RunawayRoomScene::actorHeight6290() const {
+float Scene6290::actorHeight() const {
if (_position.x < 1713 && _position.y < 356) {
return _position.y * 1.75757575f - 259.69696f;
}
@@ -159,26 +178,37 @@ float RunawayRoomScene::actorHeight6290() const {
_position.y * 0.440251559f + 191.289307f) / 2;
}
-void RunawayRoomScene::drawScene6290(Graphics::ManagedSurface &viewport, bool foreground) {
- if (foreground) {
- if (_position.x > 1380) {
- drawForeground(viewport, 0);
- }
- if (_position.y < 356) {
- drawForeground(viewport, 1);
- }
- return;
+void Scene6290::findWalkPath(Common::Point target) {
+ walkTown(target);
+}
+
+Common::U32String Scene6290::hotspotName(byte id) const {
+ if (id == 11 && _town.machineKnown) {
+ return Common::U32String("Communication machine");
+ }
+ return RunawayRoomScene::hotspotName(id);
+}
+
+void Scene6290::drawCustomForegroundComposite(Graphics::ManagedSurface &viewport) {
+ if (_position.x > 1380) {
+ drawForeground(viewport, 0);
+ }
+ if (_position.y < 356) {
+ drawForeground(viewport, 1);
}
+}
+
+void Scene6290::drawCustomBackgroundComposite(Graphics::ManagedSurface &viewport) {
if (!drawingRoomAnimation()) {
- _npc.draw(viewport, _joshuaTalking && speaker() ? 6 + speechFrame() % 6 : _joshuaFrame, _camera.x, 0);
+ _joshuaAnimation.draw(viewport, _joshuaTalking && speaker() ? 6 + speechFrame() % 6 : _joshuaFrame, _camera.x, 0);
}
- _machine.draw(viewport, _town.strapDelivered >= 2 ? 1 : 0, _camera.x, 0);
- _overlay.draw(viewport, 0, _camera.x, 0);
- _ambient.draw(viewport, 0, _camera.x, 0);
+ _machineAnimation.draw(viewport, _town.strapDelivered >= 2 ? 1 : 0, _camera.x, 0);
+ _machineOverlayAnimation.draw(viewport, 0, _camera.x, 0);
+ _machineAmbientAnimation.draw(viewport, 0, _camera.x, 0);
_machineIndicator.draw(viewport, 0, _camera.x, 0);
}
-RunawayRoomScene::ActionResult RunawayRoomScene::execute6290(uint16 action) {
+RunawayRoomScene::ActionResult Scene6290::dispatchCustomSceneAction(uint16 action) {
switch (action) {
case 304: // Return to the overview; Joshua works while Brian is away.
if (_town.strapDelivered == 1 && _town.wrenchDelivered == 1) {
@@ -202,7 +232,7 @@ RunawayRoomScene::ActionResult RunawayRoomScene::execute6290(uint16 action) {
if (_town.strapDelivered == 1 && (!_town.wrenchNeeded || _town.wrenchDelivered)) {
say(22);
} else if (_town.strapDelivered == 1 && _town.wrenchNeeded && _inventory.contains(10)) {
- execute6290(324);
+ dispatchCustomSceneAction(324);
} else {
startJoshuaConversation(false);
}
@@ -379,7 +409,7 @@ RunawayRoomScene::ActionResult RunawayRoomScene::execute6290(uint16 action) {
return kHandled;
}
-void RunawayRoomScene::startJoshuaConversation(bool introduction) {
+void Scene6290::startJoshuaConversation(bool introduction) {
_conversation = 7;
_dialogueDepth = _dialogueNode = _dialogueIntro = 0;
_dialogueEnding = false;
@@ -426,7 +456,7 @@ void RunawayRoomScene::startJoshuaConversation(bool introduction) {
_dialogue[20][1].enabled = _town.batteryKnown;
}
-void RunawayRoomScene::joshuaDialogueChoice(byte effect) {
+void Scene6290::handleCustomDialogueChoice(byte effect) {
switch (effect) {
case 5: // Joshua explains his telepathic helmet.
say(90, 7, false, 1);
@@ -451,4 +481,5 @@ void RunawayRoomScene::joshuaDialogueChoice(byte effect) {
}
}
+} // End of namespace Runaway
} // End of namespace Hollywood
diff --git a/engines/hollywood/runaway/scene6290.h b/engines/hollywood/runaway/scene6290.h
new file mode 100644
index 00000000000..5e7b35409bb
--- /dev/null
+++ b/engines/hollywood/runaway/scene6290.h
@@ -0,0 +1,62 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+
+#ifndef HOLLYWOOD_RUNAWAY_SCENE6290_H
+#define HOLLYWOOD_RUNAWAY_SCENE6290_H
+
+#include "hollywood/runaway/scene.h"
+
+namespace Hollywood {
+namespace Runaway {
+
+class Scene6290 : public RunawayRoomScene {
+public:
+ Scene6290(RunawayAudio &audio, RunawayInventory &inventory, const RunawayStrings &strings, RunawayGameType game);
+
+private:
+ bool loadCustomResources() override;
+ bool applyCustomBackgroundPatches() override;
+ void applyCustomHotspotState() override;
+ void prepareCustomGameplayLoop() override;
+ void runCustomEntrySequence() override;
+ void advanceCustomGameplayLoop(uint32 delta) override;
+ void drawCustomBackgroundComposite(Graphics::ManagedSurface &viewport) override;
+ void drawCustomForegroundComposite(Graphics::ManagedSurface &viewport) override;
+ ActionResult dispatchCustomSceneAction(uint16 action) override;
+ void handleCustomDialogueChoice(byte effect) override;
+ void resumeAmbientAudio(bool entering) override;
+ void findWalkPath(Common::Point target) override;
+ float actorHeight() const override;
+ Common::U32String hotspotName(byte id) const override;
+
+ void startJoshuaConversation(bool introduction);
+
+ RunawayAnimation _joshuaAnimation, _machineAnimation;
+ RunawayAnimation _machineAmbientAnimation, _machineOverlayAnimation, _machineIndicator;
+ byte _joshuaFrame = 0;
+ uint32 _joshuaTick = 0;
+ bool _joshuaTalking = false;
+};
+
+} // End of namespace Runaway
+} // End of namespace Hollywood
+
+#endif // HOLLYWOOD_RUNAWAY_SCENE6290_H
diff --git a/engines/hollywood/runaway/scene6350.cpp b/engines/hollywood/runaway/scene6350.cpp
index ec4dc0431ff..1cb8714dd93 100644
--- a/engines/hollywood/runaway/scene6350.cpp
+++ b/engines/hollywood/runaway/scene6350.cpp
@@ -46,31 +46,41 @@ const RunawayRoom kRunawayScene6350 = {
};
void RunawayRoomScene::resumeTown() {
+ prepareCustomGameplayLoop();
+ if (!_entering) {
+ resumeAmbientAudio(false);
+ return;
+ }
+ _entering = false;
+ if (_room == 6350 && !_town.arrived) {
+ startTownFilm(1);
+ return;
+ }
+ _town.arrived = 1;
+ resumeAmbientAudio(true);
+ runCustomEntrySequence();
+}
+
+void RunawayRoomScene::prepareCustomGameplayLoop() {
_oscarTick = _now;
_saloonDoorTick = _now;
- _joshuaTick = _now;
_saloonDoorFrame = _position.x > 726 ? 7 : 0;
if (_room == 6263) {
resume6263();
}
- if (!_entering) {
+}
+
+void RunawayRoomScene::resumeAmbientAudio(bool entering) {
+ if (!entering) {
if (!_audio.musicPlaying()) {
- _audio.playMusic(_room == 6290 ? 19 : _room == 6200 || _room == 6210 ? 18 : 11);
+ _audio.playMusic(_room == 6200 || _room == 6210 ? 18 : 11);
if (_room == 6200 || _room == 6210) {
_audio.setMusicVolume(191);
}
}
return;
}
- _entering = false;
- if (_room == 6350 && !_town.arrived) {
- startTownFilm(1);
- return;
- }
- _town.arrived = 1;
- if (_room == 6290) {
- _audio.playMusic(19);
- } else if (_room == 6200 || _room == 6210) {
+ if (_room == 6200 || _room == 6210) {
if (_entryScene == 6200 || !_audio.musicPlaying()) {
_audio.playMusic(18);
}
@@ -80,6 +90,9 @@ void RunawayRoomScene::resumeTown() {
} else if (!_audio.musicPlaying()) {
_audio.playMusic(11);
}
+}
+
+void RunawayRoomScene::runCustomEntrySequence() {
if (_room == 6014) {
execute6014(400);
} else if (_room == 6080) {
@@ -102,17 +115,13 @@ void RunawayRoomScene::resumeTown() {
start6240();
} else if (_room == 6260) {
start6260();
- } else if (_room == 6270) {
- start6270();
- } else if (_room == 6290) {
- start6290();
} else if (_room == 6370) {
_town.streetVisited = 1;
start6370();
}
}
-void RunawayRoomScene::updateTown() {
+void RunawayRoomScene::advanceCustomGameplayLoop(uint32 delta) {
if (_room == 6180) {
update6180();
}
@@ -122,9 +131,10 @@ void RunawayRoomScene::updateTown() {
if (_room == 6263) {
update6263();
}
- if (_room == 6290) {
- update6290();
- }
+}
+
+void RunawayRoomScene::updateTown(uint32 delta) {
+ advanceCustomGameplayLoop(delta);
if (_townEncounter.phase != TownEncounter::kInactive) {
update6220();
return;
Commit: 2bdf17eb3aa872bf06ae91779b66c0a3eaefa36c
https://github.com/scummvm/scummvm/commit/2bdf17eb3aa872bf06ae91779b66c0a3eaefa36c
Author: neuromancer (gustavo.grieco at gmail.com)
Date: 2026-11-19T19:38:53+01:00
Commit Message:
HOLLYWOOD: RUNAWAY: migrated the rest of scenes 6xxx to classes
Changed paths:
A engines/hollywood/runaway/oscar.cpp
A engines/hollywood/runaway/oscar.h
A engines/hollywood/runaway/scene6014.h
A engines/hollywood/runaway/scene6080.h
A engines/hollywood/runaway/scene6090.h
A engines/hollywood/runaway/scene6130.h
A engines/hollywood/runaway/scene6180.h
A engines/hollywood/runaway/scene6190.h
A engines/hollywood/runaway/scene6200.h
A engines/hollywood/runaway/scene6210.h
A engines/hollywood/runaway/scene6220.h
A engines/hollywood/runaway/scene6240.h
A engines/hollywood/runaway/scene6260.h
A engines/hollywood/runaway/scene6263.h
A engines/hollywood/runaway/scene6350.h
A engines/hollywood/runaway/scene6370.h
A engines/hollywood/runaway/scene_registry.cpp
A engines/hollywood/runaway/scene_registry.h
A engines/hollywood/runaway/town.cpp
engines/hollywood/module.mk
engines/hollywood/runaway/engine.cpp
engines/hollywood/runaway/scene.cpp
engines/hollywood/runaway/scene.h
engines/hollywood/runaway/scene4070.cpp
engines/hollywood/runaway/scene6014.cpp
engines/hollywood/runaway/scene6080.cpp
engines/hollywood/runaway/scene6090.cpp
engines/hollywood/runaway/scene6130.cpp
engines/hollywood/runaway/scene6180.cpp
engines/hollywood/runaway/scene6190.cpp
engines/hollywood/runaway/scene6200.cpp
engines/hollywood/runaway/scene6210.cpp
engines/hollywood/runaway/scene6220.cpp
engines/hollywood/runaway/scene6240.cpp
engines/hollywood/runaway/scene6260.cpp
engines/hollywood/runaway/scene6263.cpp
engines/hollywood/runaway/scene6350.cpp
engines/hollywood/runaway/scene6370.cpp
diff --git a/engines/hollywood/module.mk b/engines/hollywood/module.mk
index 2daafb71245..135b23c5b80 100644
--- a/engines/hollywood/module.mk
+++ b/engines/hollywood/module.mk
@@ -147,9 +147,11 @@ MODULE_OBJS = \
runaway/inventory.o \
runaway/menu.o \
runaway/navigation.o \
+ runaway/oscar.o \
runaway/presentation.o \
runaway/saveload.o \
runaway/scene.o \
+ runaway/scene_registry.o \
runaway/scene2010.o \
runaway/scene2020.o \
runaway/scene2060.o \
@@ -194,6 +196,7 @@ MODULE_OBJS = \
runaway/sequence.o \
runaway/speech.o \
runaway/strings.o \
+ runaway/town.o \
runaway/ui.o \
runaway/video.o
diff --git a/engines/hollywood/runaway/engine.cpp b/engines/hollywood/runaway/engine.cpp
index 5aabd7a4196..38980f5e77b 100644
--- a/engines/hollywood/runaway/engine.cpp
+++ b/engines/hollywood/runaway/engine.cpp
@@ -42,9 +42,8 @@
#include "hollywood/runaway/saveload.h"
#include "hollywood/runaway/scene.h"
#include "hollywood/runaway/scene_data.h"
+#include "hollywood/runaway/scene_registry.h"
#include "hollywood/runaway/scene5030.h"
-#include "hollywood/runaway/scene6270.h"
-#include "hollywood/runaway/scene6290.h"
#include "hollywood/runaway/strings.h"
#include "hollywood/runaway/ui.h"
@@ -167,14 +166,7 @@ RunawayScene *RunawayEngine::createScene(uint16 entryScene) {
const RunawayRoom *room = findRunawayRoom(entryScene);
if (room && ((_museum && entryScene >= 4000) ||
(_game == kRunawayFullGame && (entryScene / 1000 == 2 || entryScene / 1000 == 4 || entryScene / 1000 == 5 || entryScene / 1000 == 6)))) {
- switch (room->number) {
- case 6270:
- return new Runaway::Scene6270(_audio, *_inventory, _strings, _game);
- case 6290:
- return new Runaway::Scene6290(_audio, *_inventory, _strings, _game);
- default:
- return new RunawayRoomScene(_audio, *_inventory, _strings, _game);
- }
+ return createRunawayRoomScene(*room, _audio, *_inventory, _strings, _game);
}
if ((_game == kRunawayCabinDemo && entryScene == 5030) ||
(_game == kRunawayFullGame && entryScene >= 5030 && entryScene <= 5032))
diff --git a/engines/hollywood/runaway/oscar.cpp b/engines/hollywood/runaway/oscar.cpp
new file mode 100644
index 00000000000..8eb38e52f2e
--- /dev/null
+++ b/engines/hollywood/runaway/oscar.cpp
@@ -0,0 +1,86 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+
+#include "common/random.h"
+#include "hollywood/runaway/audio.h"
+#include "hollywood/runaway/oscar.h"
+
+namespace Hollywood {
+namespace Runaway {
+namespace {
+
+// Oscar uses the same idle sequence in the wide view and at the doorway.
+const byte kOscarFrames[] = {
+ 106, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29,
+ 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41,
+ 106, 106, 106, 106, 106, 106, 106, 106,
+ 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60,
+ 53, 54, 55, 56, 57, 58, 59, 60, 53, 54, 55, 56, 57, 58, 59, 60,
+ 61, 62, 63, 64, 65, 66, 51, 50, 49, 48, 47, 46, 45, 44, 43, 42,
+ 106, 106, 106, 106, 106, 106, 106, 106, 106,
+ 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106
+};
+
+} // End of anonymous namespace
+
+void OscarAnimation::update(uint32 now, Common::RandomSource &random, RunawayAudio &audio) {
+ if (_talking) {
+ _tick = now;
+ return;
+ }
+ if (now - _tick < 80) {
+ return;
+ }
+ _tick = now;
+ const uint last = _idle == 1 ? 62 : _idle == 2 ? 121 : _closeup ? 165 : 164;
+ if (_step < last) {
+ ++_step;
+ if (_closeup && _idle == 2 && _step == 80) {
+ audio.playEffect(80, 26, 1);
+ }
+ } else if (_idle == 3 && !random.getRandomNumber(_closeup ? 4 : 9)) {
+ _idle = 1 + random.getRandomBit();
+ _step = _idle == 1 ? 0 : 70;
+ } else {
+ _idle = 3;
+ _step = 130;
+ }
+ if (_closeup && _idle == 3 && !audio.effectPlaying(1)) {
+ audio.playEffect(76, 153, 1, true);
+ }
+}
+
+uint OscarAnimation::frame(bool speaking, byte speechFrame) const {
+ if (_talking) {
+ return 107 + (speaking ? speechFrame % 6 : 0);
+ }
+ const uint frame = kOscarFrames[_step];
+ return !_closeup && frame == 106 ? 105 : frame;
+}
+
+void OscarAnimation::startIdle() {
+ _talking = false;
+ _idle = 3;
+ _step = 130;
+}
+
+} // End of namespace Runaway
+} // End of namespace Hollywood
diff --git a/engines/hollywood/runaway/oscar.h b/engines/hollywood/runaway/oscar.h
new file mode 100644
index 00000000000..1ac5e8377dd
--- /dev/null
+++ b/engines/hollywood/runaway/oscar.h
@@ -0,0 +1,56 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+
+#ifndef HOLLYWOOD_RUNAWAY_OSCAR_H
+#define HOLLYWOOD_RUNAWAY_OSCAR_H
+
+#include "common/scummsys.h"
+
+namespace Common {
+class RandomSource;
+}
+
+namespace Hollywood {
+class RunawayAudio;
+
+namespace Runaway {
+
+class OscarAnimation {
+public:
+ explicit OscarAnimation(bool closeup) : _closeup(closeup) {}
+ void resume(uint32 now) { _tick = now; }
+ void update(uint32 now, Common::RandomSource &random, RunawayAudio &audio);
+ uint frame(bool speaking, byte speechFrame) const;
+ void setTalking(bool talking) { _talking = talking; }
+ void startIdle();
+
+private:
+ const bool _closeup;
+ bool _talking = false;
+ uint16 _step = 130;
+ byte _idle = 3;
+ uint32 _tick = 0;
+};
+
+} // End of namespace Runaway
+} // End of namespace Hollywood
+
+#endif // HOLLYWOOD_RUNAWAY_OSCAR_H
diff --git a/engines/hollywood/runaway/scene.cpp b/engines/hollywood/runaway/scene.cpp
index 2035594f2d6..bb0a3586b2b 100644
--- a/engines/hollywood/runaway/scene.cpp
+++ b/engines/hollywood/runaway/scene.cpp
@@ -33,19 +33,6 @@ namespace Hollywood {
namespace {
-const RunawayRoom *const kRooms[] = {
- &kRunawayScene2020, &kRunawayScene2060, &kRunawayScene2080,
- &kRunawayScene4030, &kRunawayScene4050, &kRunawayScene4060, &kRunawayScene4070, &kRunawayScene4090, &kRunawayScene4100, &kRunawayScene4140,
- &kRunawayScene5010, &kRunawayScene5020, &kRunawayScene5050, &kRunawayScene5060, &kRunawayScene5070,
- &kRunawayScene5080, &kRunawayScene5100, &kRunawayScene5110, &kRunawayScene5130, &kRunawayScene5140,
- &kRunawayScene5160, &kRunawayScene5170,
- &kRunawayScene6014, &kRunawayScene6080, &kRunawayScene6090, &kRunawayScene6130,
- &kRunawayScene6180, &kRunawayScene6190, &kRunawayScene6200, &kRunawayScene6210,
- &kRunawayScene6220, &kRunawayScene6240, &kRunawayScene6260, &kRunawayScene6263,
- &kRunawayScene6270, &kRunawayScene6290,
- &kRunawayScene6350, &kRunawayScene6370
-};
-
const RunawayResponse kGlobalResponses[] = {
{0, 3, 2, 0},
{0, 4, 3, 0},
@@ -67,54 +54,8 @@ const RunawayResponse kGlobalResponses[] = {
{0, 30, 24, 0},
};
-const RunawayRoom *findRoom(int number) {
- if (number >= 2021 && number <= 2023)
- number = kHospitalBedroom;
- if (number == 4010 || (number >= 4061 && number <= 4065))
- number = kMuseumHall;
- else if (number >= 4071 && number <= 4072)
- number = kMuseumWilly;
- else if (number == 4101)
- number = kMuseumSecurity;
- else if (number >= 4141 && number <= 4142)
- number = kMuseumKeypad;
- else if (number == 5021 || number == 5022 || number == 5061 || number == 5062 ||
- number == 5081 || number == 5101 || number == 5171)
- number -= number % 10;
- else if (number >= 6221 && number <= 6225)
- number = 6220;
- else if (number == 6015) {
- number = 6014;
- } else if (number == 6081 || number == 6082) {
- number = 6080;
- } else if (number == 6131) {
- number = 6130;
- } else if (number == 6181) {
- number = 6180;
- } else if (number == 6241) {
- number = 6240;
- } else if (number == 6201) {
- number = 6200;
- } else if (number == 6261 || number == 6262 || number == 6265) {
- number = 6260;
- } else if (number == 6264) {
- number = 6263;
- } else if (number == 6291) {
- number = 6290;
- }
- for (uint i = 0; i < ARRAYSIZE(kRooms); ++i) {
- if (kRooms[i]->number == number)
- return kRooms[i];
- }
- return nullptr;
-}
-
} // End of anonymous namespace
-const RunawayRoom *findRunawayRoom(uint16 number) {
- return findRoom(number);
-}
-
RunawayRoomScene::RunawayRoomScene(RunawayAudio &audio, RunawayInventory &inventory, const RunawayStrings &strings, RunawayGameType game) :
_audio(audio), _sequence(audio), _inventory(inventory), _strings(strings), _game(game), _random("runaway"),
_speech(audio, _random, game == kRunawayFullGame ? RunawaySpeech::kRecordedLipSync : RunawaySpeech::kNoLipSync),
@@ -127,7 +68,7 @@ const Common::U32String &RunawayRoomScene::subtitle() const {
}
bool RunawayRoomScene::load(uint16 entryScene) {
- const RunawayRoom *room = findRoom(entryScene);
+ const RunawayRoom *room = findRunawayRoom(entryScene);
if (!room)
return false;
_entryScene = entryScene;
@@ -142,7 +83,7 @@ void RunawayRoomScene::start(uint32 now) {
if (townChapter()) {
_inventory.startChapter(4);
_entering = true;
- resumeTown();
+ resume();
return;
}
if (desertChapter()) {
@@ -267,27 +208,21 @@ bool RunawayRoomScene::restoreState(const RunawaySaveState &state, uint32 now, b
}
bool RunawayRoomScene::enterRoom(uint16 number, Common::Point position, byte facing) {
- const RunawayRoom *room = findRoom(number);
+ const RunawayRoom *room = findRunawayRoom(number);
if (!room || position.x < 0 || position.x >= room->width || position.y < 0 || position.y >= room->height)
return false;
- const Common::Path path(Common::String::format("RESOURCE.%c%02u", 'A' + number / 1000 - 1,
- number == 6014 ? 3 : (number % 1000) / 10));
+ _room = number;
+ const Common::Path path(Common::String::format("RESOURCE.%c%02u", 'A' + number / 1000 - 1, sceneResourceNumber()));
if (!_archive.open(path, 40) ||
- !_text.load("RESOURCE.003", "Runaway room", number == kMuseumWilly ? 406 : number == 6014 ? 608 : number / 10, 0, 0x1135))
+ !_text.load("RESOURCE.003", "Runaway room", sceneTextNumber(), 0, 0x1135))
return false;
- if (number == 5140 || number == 6014) {
- // These cutscenes contain a background and sprite tracks, without a mask.
- _mask.resize(room->width * room->height, 0);
- _originalMaps.resize(1536, 0);
- } else if (!loadRunawayMask(_archive, room->width, room->height, _mask, _originalMaps, number == 6263 ? 21 : 1)) {
+ if (!loadWalkMap()) {
return false;
}
if (_game == kRunawayFullGame ? !_actor.loadChapter(number < 4000 ? 1 : number < 5000 ? 2 : number < 6000 ? 3 : 4,
- number != kMuseumHall && number != 6190 && number != 6200 && number != 6240 && number != 6260 && number != 6263 &&
- number != 6350 && number != 6370) :
+ usesAlternateActor()) :
!_actor.load(number == kMuseumHall ? RunawayActor::kMuseumHall : RunawayActor::kMuseumInterior))
return false;
- _room = number;
_position = position;
_walkPath.reset(position);
_facing = facing;
@@ -305,9 +240,6 @@ bool RunawayRoomScene::enterRoom(uint16 number, Common::Point position, byte fac
_foreground[i].clear();
for (uint i = 0; i < ARRAYSIZE(_keyPatches); ++i)
_keyPatches[i].clear();
- for (uint i = 0; i < ARRAYSIZE(_saloonPatches); ++i) {
- _saloonPatches[i].clear();
- }
if (!loadCustomResources() || !rebuildBackground()) {
return false;
}
@@ -317,6 +249,17 @@ bool RunawayRoomScene::enterRoom(uint16 number, Common::Point position, byte fac
return _actor.setFrame(_facing, 0);
}
+bool RunawayRoomScene::loadWalkMap() {
+ const RunawayRoom *room = findRunawayRoom(_room);
+ if (_room == 5140) {
+ // This cutscene contains a background and sprite tracks, without a mask.
+ _mask.resize(room->width * room->height, 0);
+ _originalMaps.resize(1536, 0);
+ return true;
+ }
+ return loadRunawayMask(_archive, room->width, room->height, _mask, _originalMaps);
+}
+
bool RunawayRoomScene::loadCustomResources() {
bool loaded = true;
if (desertChapter())
@@ -346,41 +289,6 @@ bool RunawayRoomScene::loadCustomResources() {
case kMuseumKeypad:
loaded = loadScene4140();
break;
- case 6080:
- loaded = _ambient.load(_archive, 6, 2) && loadForeground(0, 4) && loadForeground(1, 7) &&
- (_entryScene != 6082 || _npc.load(_archive, 9, 135));
- break;
- case 6090:
- loaded = _npc.load(_archive, 6, 113) && loadForeground(0, 4);
- break;
- case 6130:
- loaded = _npc.load(_archive, 6, 106);
- break;
- case 6180:
- loaded = _ambient.load(_archive, 8, 71) && loadForeground(0, 4) && loadForeground(1, 5) &&
- _archive.readVariableChunk(6, _saloonPatches[0]) && _archive.readVariableChunk(7, _saloonPatches[1]);
- break;
- case 6200:
- loaded = _ambient.load(_archive, 6, 26);
- break;
- case 6220:
- loaded = _npc.load(_archive, 7, 170) && _npcMouth.load(_archive, 8, 45) && _machine.load(_archive, 9, 60);
- break;
- case 6240:
- loaded = _ambient.load(_archive, 4, 36);
- for (uint i = 0; i < ARRAYSIZE(_saloonPatches) && loaded; ++i) {
- loaded = _archive.readVariableChunk(6 + i, _saloonPatches[i]);
- }
- break;
- case 6260:
- loaded = loadForeground(0, 6);
- break;
- case 6263:
- loaded = loadScene6263();
- break;
- case 6370:
- loaded = _npc.load(_archive, 4, 88) && _ambient.load(_archive, 5, 20);
- break;
default:
break;
}
@@ -389,7 +297,7 @@ bool RunawayRoomScene::loadCustomResources() {
bool RunawayRoomScene::loadForeground(uint layer, uint chunk, bool pixels) {
assert(layer < ARRAYSIZE(_foreground));
- const RunawayRoom *room = findRoom(_room);
+ const RunawayRoom *room = findRunawayRoom(_room);
// Foreground masks restore (x, y, length) spans from the current background.
Common::Array<byte> spans;
if (!_archive.readVariableChunk(chunk, spans) || spans.size() < 2)
@@ -419,8 +327,8 @@ bool RunawayRoomScene::rebuildBackground() {
}
bool RunawayRoomScene::loadBackground() {
- const RunawayRoom *room = findRoom(_room);
- return loadRunawaySurface(_archive, _room == 6263 ? 20 : 0, room->width, room->height, _background);
+ const RunawayRoom *room = findRunawayRoom(_room);
+ return loadRunawaySurface(_archive, 0, room->width, room->height, _background);
}
bool RunawayRoomScene::applyCustomBackgroundPatches() {
@@ -441,22 +349,6 @@ bool RunawayRoomScene::applyCustomBackgroundPatches() {
return applyBackground4090();
case kMuseumSecurity:
return applyBackground4100();
- case 6080:
- return _town.oilCan != 2 || applyPatch(5);
- case 6090:
- return _town.vessel != 2 || applyPatch(5);
- case 6130:
- return (_town.stone != 2 || applyPatch(4)) && (_town.vessel != 2 || applyPatch(5));
- case 6190:
- return applyBackground6190();
- case 6200:
- return !_town.firewoodTaken || applyPatch(4);
- case 6240:
- return !_town.flowerPotTaken || applyPatch(9);
- case 6260:
- return applyBackground6260();
- case 6350:
- return !_town.arrived || (applyPatch(5) && applyPatch(7));
default:
return true;
}
@@ -468,68 +360,11 @@ void RunawayRoomScene::updateMaps() {
}
void RunawayRoomScene::applyCustomHotspotState() {
- if (_room == 6220) {
- for (uint i = 0; i < 256; ++i) {
- // The balcony shares this mask but is reached through Kevin's room.
- if (_maps[i] < 2 || _maps[i] > 4)
- _maps[i] = 0;
- }
- return;
- }
- if (_room == 6350) {
- for (uint i = 0; i < 256; ++i) {
- // The route to the Hopi village has not been discovered yet.
- if (_maps[256 + i] == 5)
- _maps[256 + i] = 0;
- }
- return;
- }
if (desertChapter()) {
updateDesertMaps();
return;
}
switch (_room) {
- case 6080:
- updateMaps6080();
- break;
- case 6180:
- for (uint i = 0; i < 256; ++i) {
- if (_maps[i] == 3) {
- _maps[i] = 0;
- }
- if (_maps[256 + i] == 4 && !_town.saloonDoorKnown) {
- _maps[256 + i] = 0;
- }
- }
- break;
- case 6240:
- for (uint i = 0; i < 256; ++i) {
- if (_maps[i] >= 6 && _maps[i] <= 8) {
- _maps[i] = 0;
- }
- if (_maps[256 + i] == 3 && _town.flowerPotTaken) {
- _maps[256 + i] = 0;
- }
- }
- break;
- case 6090:
- case 6130:
- for (uint i = 0; i < 256; ++i) {
- if ((_room == 6090 && _maps[256 + i] == 6 && _town.vessel == 2) ||
- (_room == 6130 && _maps[256 + i] == 4 && _town.stone == 2)) {
- _maps[256 + i] = 0;
- }
- }
- break;
- case 6190:
- updateMaps6190();
- break;
- case 6200:
- updateMaps6200();
- break;
- case 6260:
- updateMaps6260();
- break;
case kHospitalBedroom:
updateMaps2020();
break;
@@ -559,7 +394,7 @@ void RunawayRoomScene::applyCustomHotspotState() {
const RunawayHotspot *RunawayRoomScene::hotspot(byte id) const {
if (desertChapter())
return id && id < _desertHotspots.size() ? &_desertHotspots[id] : nullptr;
- const RunawayRoom *room = findRoom(_room);
+ const RunawayRoom *room = findRunawayRoom(_room);
return room && id && id < room->hotspotCount ? &room->hotspots[id] : nullptr;
}
@@ -577,36 +412,6 @@ byte RunawayRoomScene::hotspotAt(Common::Point mouse) const {
Common::U32String RunawayRoomScene::hotspotName(byte id) const {
if (desertChapter())
return desertHotspotName(id);
- if (_room == 6350 && id == 2 && _town.arrived)
- return Common::U32String("Douglasville");
- if (_room == 6350 && id == 3 && _town.houseVisited) {
- return Common::U32String("Mama Dorita's house");
- }
- if (_room == 6080 && id == 2 && _town.oilCan) {
- return Common::U32String("Oil can");
- }
- if (_room == 6090 && id == 4 && _town.oscarTobacco) {
- return Common::U32String("Oscar");
- }
- if (_room == 6240) {
- if (id == 5 && _town.gardeningShed) {
- return Common::U32String("Gardening shed");
- }
- if (id == 7 && _town.carnivorousPlantSeen) {
- return Common::U32String("Meat-eating plant");
- }
- }
- if (_room == 6220 && id == 8 && _town.strapSeen == 1) {
- return Common::U32String("Strap");
- }
- if (_room == 6263) {
- if (id == 3 && _town.steamLever) {
- return Common::U32String("Steam outlet lever");
- }
- if (id == 4 && _town.pressureWheel) {
- return Common::U32String("Pressure wheel");
- }
- }
const RunawayHotspot *spot = hotspot(id);
if (!spot)
return Common::U32String();
@@ -656,11 +461,7 @@ void RunawayRoomScene::walkTo(Common::Point target, byte facing, bool scripted,
}
void RunawayRoomScene::findWalkPath(Common::Point target) {
- if (_room == 6080 || _room == 6180 || _room == 6240 || _room == 6260) {
- walkTown(target);
- } else {
- _walkPath.findPath(RunawayWalkMap(_background.w, _background.h, _mask, _maps), target);
- }
+ _walkPath.findPath(RunawayWalkMap(_background.w, _background.h, _mask, _maps), target);
}
void RunawayRoomScene::arrive() {
@@ -699,25 +500,11 @@ void RunawayRoomScene::click(Common::Point mouse, RunawayVerb verb, byte item) {
_pendingHotspot = id;
_pendingAction = spot->action[index];
bool approach = spot->approach[index] != 0;
- if (_room == 6210 && !index) {
- if ((id == 5 && _town.bucketSeen) || (id == 8 && _town.bottleSeen)) {
- approach = false;
- }
- }
- if (_room == 6220 && id == 8 && index && _town.strapSeen == 1) {
- approach = true;
- }
- if (_room == 6260 && id == 5 && !index && _town.locomotiveKey == 2) {
- approach = false;
- }
- if (_room == 6130 && id == 4 && !index && _town.stone) {
- approach = false;
- }
if (_room == kHospitalBathroom && id == 4 && !index && _hospital.alcohol == 2)
approach = false;
if (item) {
approach = _game != kRunawayFullGame;
- const RunawayRoom *room = findRoom(_room);
+ const RunawayRoom *room = findRunawayRoom(_room);
for (uint i = 0; i < room->itemActionCount; ++i) {
const RunawayItemAction &action = room->itemActions[i];
if (action.hotspot == id && (!action.item || action.item == item)) {
@@ -725,10 +512,8 @@ void RunawayRoomScene::click(Common::Point mouse, RunawayVerb verb, byte item) {
break;
}
}
- if (_room == 6220 && id == 8 && _town.strapSeen != 1) {
- approach = false;
- }
}
+ approach = shouldApproachHotspot(id, index != 0, item, approach);
if (approach) {
Common::Point position(spot->x, spot->y);
if (museumChapter() && _room == kMuseumLaboratory && id == 3 && _museum.susan == 1)
@@ -742,7 +527,7 @@ void RunawayRoomScene::click(Common::Point mouse, RunawayVerb verb, byte item) {
arrive();
}
} else {
- if (_room != 5010 && _room != 6350)
+ if (shouldPlayGameplayClickPath())
walkTo(Common::Point(mouse.x + _camera.x, mouse.y - kRunawayViewportTop + _camera.y));
}
}
@@ -815,7 +600,7 @@ void RunawayRoomScene::skipSpeech() {
}
void RunawayRoomScene::useItem(byte item, byte id) {
- const RunawayRoom *room = findRoom(_room);
+ const RunawayRoom *room = findRunawayRoom(_room);
for (uint i = 0; i < room->itemActionCount; ++i) {
const RunawayItemAction &action = room->itemActions[i];
if (action.hotspot == id && (!action.item || action.item == item)) {
@@ -853,48 +638,6 @@ RunawayRoomScene::ActionResult RunawayRoomScene::dispatchCustomSceneAction(uint1
case kMuseumSecurity:
result = execute4100(action);
break;
- case 6014:
- result = execute6014(action);
- break;
- case 6080:
- result = execute6080(action);
- break;
- case 6090:
- result = execute6090(action);
- break;
- case 6130:
- result = execute6130(action);
- break;
- case 6180:
- result = execute6180(action);
- break;
- case 6190:
- result = execute6190(action);
- break;
- case 6200:
- result = execute6200(action);
- break;
- case 6210:
- result = execute6210(action);
- break;
- case 6220:
- result = execute6220(action);
- break;
- case 6240:
- result = execute6240(action);
- break;
- case 6260:
- result = execute6260(action);
- break;
- case 6263:
- result = execute6263(action);
- break;
- case 6350:
- result = execute6350(action);
- break;
- case 6370:
- result = execute6370(action);
- break;
default:
break;
}
@@ -915,7 +658,7 @@ void RunawayRoomScene::execute(uint16 action) {
return;
}
- const RunawayRoom *room = findRoom(_room);
+ const RunawayRoom *room = findRunawayRoom(_room);
for (uint i = 0; i < room->exitCount; ++i) {
const RunawayExit &exit = room->exits[i];
if (exit.action != action)
@@ -982,32 +725,6 @@ float RunawayRoomScene::actorHeight() const {
return actorHeight4090();
case kMuseumSecurity:
return actorHeight4100();
- case 6080:
- return _position.y * 1.12355208f - 218.007721f;
- case 6090:
- return _position.y < 510 ? _position.y * 0.840707958f - 38.7610626f :
- _position.y * 0.730337083f + 17.5280895f;
- case 6130:
- return _position.y * 1.027668f - 160.57312f;
- case 6180:
- return _position.y * 1.3565892f - 249.069763f;
- case 6240:
- return _position.y * 1.00515461f - 83.762886f;
- case 6190:
- return (_position.y * 0.426829278f + 16.4634151f + _position.x * 0.0980392173f + 41.7647057f) / 2;
- case 6200:
- return _position.y > 501 ? _position.y * 0.618556678f + 84.4845352f :
- _position.y * 1.38297868f - 299.255310f;
- case 6210:
- return _position.y * 0.413793117f + 229.482758f;
- case 6220:
- return _position.y * 0.194835678f - 11.706573f;
- case 6260:
- return _position.y * 0.95f - 175;
- case 6263:
- return _position.y * 1.04838705f - 175.645157f;
- case 6370:
- return _position.y * 0.634920657f - 221.190475f;
default:
return 455;
}
@@ -1021,7 +738,7 @@ void RunawayRoomScene::update(uint32 now, int scrollDirection, bool inventoryOpe
_sequence.update(now);
if (!_sequence.active()) {
if (townChapter())
- finishTownFilm();
+ finishCustomFilm();
else if (museumChapter())
finishMuseumFilm();
else if (_room == 5140)
@@ -1068,7 +785,7 @@ void RunawayRoomScene::update(uint32 now, int scrollDirection, bool inventoryOpe
_actor.setFrame(_facing, 0, speaking() && !speaker() ? speechFrame() : -1);
return;
}
- if (inventoryOpen || _room == kMuseumKeypad || _room == 5010 || _room == 5140 || _room == 6350)
+ if (inventoryOpen || !shouldUpdateActor())
return;
if (_walkPath.active() && !speaking()) {
_walkPath.advance(elapsed * 0.18f * actorHeight() / 455, _position, _facing);
@@ -1114,12 +831,9 @@ void RunawayRoomScene::draw() {
drawScene5140(viewport);
return;
}
- if (_room == 6014) {
- drawScene6014(viewport);
+ if (drawCustomComposite(viewport)) {
return;
}
- if (_room == 6350)
- return;
if (_room == 5010) {
drawDesertRoom(viewport, false);
return;
@@ -1133,68 +847,16 @@ void RunawayRoomScene::draw() {
// Earlier rooms use six depth layers; Douglasville also uses layers 7..9.
for (uint i = 0; i < 7; ++i)
params.depthY[i] = 0;
- if (desertChapter())
- setupDesertDepth(params);
- switch (_room) {
- case kMuseumHall:
- setupDepth4060(params);
- break;
- case kMuseumExhibition:
- setupDepth4090(params);
- break;
- case kMuseumSecurity:
- setupDepth4100(params);
- break;
- case 6130:
- params.depthY[1] = 480;
- params.depthY[2] = 599;
- break;
- case 6190:
- params.depthY[1] = 599;
- params.depthY[2] = 388;
- break;
- case 6200:
- case 6210:
- case 6263:
- params.depthY[1] = 599;
- break;
- case 6220:
- params.depthY[1] = 263;
- params.depthY[2] = 195;
- params.depthY[3] = 490;
- params.depthY[4] = 396;
- params.depthY[5] = 227;
- params.depthY[6] = 247;
- params.depthY[7] = 599;
- params.depthY[8] = 322;
- params.depthY[9] = 599;
- break;
- case 6240:
- params.depthY[1] = 599;
- params.depthY[2] = 599;
- params.depthY[3] = 351;
- params.depthY[4] = 351;
- break;
- case 6370:
- params.depthY[1] = 800;
- params.depthY[2] = 646;
- params.depthY[3] = 400;
- params.depthY[4] = 800;
- params.depthY[5] = 645;
- params.depthY[6] = 684;
- break;
- default:
- break;
- }
+ setupActorDepth(params);
params.position = _position;
params.camera = _camera;
params.roomWidth = _background.w;
params.height = actorHeight();
params.antialias = _antialias;
const byte light = MIN<byte>(9, _maps[768 + _mask[_position.y * _background.w + _position.x]]);
- memcpy(params.light, findRoom(_room)->light[light], sizeof(params.light));
+ memcpy(params.light, findRunawayRoom(_room)->light[light], sizeof(params.light));
const bool roomAnimation = drawingRoomAnimation();
- if ((!roomAnimation || !_actionHidesActor) && _townEncounter.phase == TownEncounter::kInactive &&
+ if ((!roomAnimation || !_actionHidesActor) && shouldDrawActor() &&
(_room != kHospitalBathroom || (_roomAction != 302 && _roomAction != 307)))
_actor.draw(_screen, params, _mask, _maps);
if (roomAnimation) {
@@ -1205,24 +867,26 @@ void RunawayRoomScene::draw() {
drawCustomForegroundComposite(viewport);
}
+void RunawayRoomScene::setupActorDepth(RunawayActor::RenderParams ¶ms) const {
+ if (desertChapter())
+ setupDesertDepth(params);
+ switch (_room) {
+ case kMuseumHall:
+ setupDepth4060(params);
+ break;
+ case kMuseumExhibition:
+ setupDepth4090(params);
+ break;
+ case kMuseumSecurity:
+ setupDepth4100(params);
+ break;
+ default:
+ break;
+ }
+}
+
void RunawayRoomScene::drawCustomBackgroundComposite(Graphics::ManagedSurface &viewport) {
- if (_room == 6080) {
- drawScene6080(viewport, false);
- } else if (_room == 6090) {
- drawScene6090(viewport, false);
- } else if (_room == 6130) {
- _npc.draw(viewport, oscarFrame(), _camera.x, -_camera.y);
- } else if (_room == 6180) {
- drawScene6180(viewport, false);
- } else if (_room == 6200) {
- drawScene6200(viewport);
- } else if (_room == 6220) {
- drawScene6220(viewport);
- } else if (_room == 6263) {
- drawScene6263(viewport);
- } else if (_room == 6370) {
- drawScene6370(viewport);
- } else if (desertChapter()) {
+ if (desertChapter()) {
drawDesertRoom(viewport, false);
} else if (_room == kMuseumWilly) {
drawScene4070(viewport);
@@ -1252,17 +916,6 @@ void RunawayRoomScene::drawCustomForegroundComposite(Graphics::ManagedSurface &v
drawForeground4030(viewport);
else if (_room == kMuseumLaboratory)
drawForeground4050(viewport);
- else if (_room == 6080) {
- drawScene6080(viewport, true);
- } else if (_room == 6090) {
- drawScene6090(viewport, true);
- } else if (_room == 6180) {
- drawScene6180(viewport, true);
- } else if (_room == 6240) {
- drawForeground6240(viewport);
- } else if (_room == 6260) {
- drawForeground(viewport, 0);
- }
}
void RunawayRoomScene::drawForeground(Graphics::ManagedSurface &viewport, uint layer) {
@@ -1355,7 +1008,7 @@ void RunawayRoomScene::updateRoomAnimation() {
continue;
}
if (townChapter()) {
- townAnimationFrame();
+ handleAnimationFrameHook();
continue;
}
if ((_roomAction == 335 && _actionStep == 15) || (_roomAction == 339 && _actionStep == 47))
diff --git a/engines/hollywood/runaway/scene.h b/engines/hollywood/runaway/scene.h
index 865b9b58ca7..12c6c34c90c 100644
--- a/engines/hollywood/runaway/scene.h
+++ b/engines/hollywood/runaway/scene.h
@@ -126,17 +126,36 @@ protected:
virtual bool loadBackground();
virtual bool applyCustomBackgroundPatches();
virtual void applyCustomHotspotState();
- virtual void prepareCustomGameplayLoop();
- virtual void runCustomEntrySequence();
- virtual void advanceCustomGameplayLoop(uint32 delta);
+ virtual void prepareCustomGameplayLoop() {}
+ virtual void runCustomEntrySequence() {}
+ virtual void advanceCustomGameplayLoop(uint32 delta) {}
virtual void drawCustomBackgroundComposite(Graphics::ManagedSurface &viewport);
virtual void drawCustomForegroundComposite(Graphics::ManagedSurface &viewport);
virtual ActionResult dispatchCustomSceneAction(uint16 action);
- virtual void handleCustomDialogueChoice(byte effect);
+ virtual void handleCustomDialogueChoice(byte effect) {}
virtual void resumeAmbientAudio(bool entering);
virtual void findWalkPath(Common::Point target);
virtual int sceneViewportYOffset() const;
+ virtual uint sceneResourceNumber() const { return (_room % 1000) / 10; }
+ virtual uint sceneTextNumber() const { return _room == kMuseumWilly ? 406 : _room / 10; }
+ virtual bool loadWalkMap();
+ virtual bool usesAlternateActor() const { return _room != kMuseumHall; }
+ virtual void setupActorDepth(RunawayActor::RenderParams ¶ms) const;
+ virtual bool drawCustomComposite(Graphics::ManagedSurface &viewport) { return false; }
+ virtual bool shouldDrawActor() const { return true; }
+ virtual bool shouldUpdateActor() const { return _room != kMuseumKeypad && _room != 5010 && _room != 5140; }
+ virtual bool shouldPlayGameplayClickPath() const { return _room != 5010; }
+ virtual bool shouldApproachHotspot(byte id, bool use, byte item, bool approach) const { return approach; }
+ // Accept the adjusted target without the shared floor-mask adjustment.
+ virtual bool adjustCustomWalkTargetToFloorMask(Common::Point &target) const { return false; }
+ // Return true when a scene sequence owns this frame's action updates.
+ virtual bool updateCustomSequence() { return false; }
+ virtual void handleAnimationFrameHook() {}
+ virtual void finishCustomFilm() {}
+ virtual uint16 dialoguePlayerCue() const { return 80; }
+ virtual uint16 dialogueResponseCue() const { return 90; }
+
bool enterRoom(uint16 room, Common::Point position, byte facing);
bool loadForeground(uint layer, uint chunk, bool pixels = false);
void drawForeground(Graphics::ManagedSurface &viewport, uint layer);
@@ -309,62 +328,6 @@ protected:
void leaveTownRoom(uint16 scene);
void deferTownAction(uint16 action);
void walkTown(Common::Point target);
- void startTownFilm(byte film);
- void finishTownFilm();
- ActionResult execute6014(uint16 action);
- void drawScene6014(Graphics::ManagedSurface &viewport);
- void start6080();
- ActionResult execute6080(uint16 action);
- void updateMaps6080();
- void drawScene6080(Graphics::ManagedSurface &viewport, bool foreground);
- void mineAnimationFrame();
- void start6090();
- ActionResult execute6090(uint16 action);
- void drawScene6090(Graphics::ManagedSurface &viewport, bool foreground);
- void startOscarConversation();
- void oscarDialogueChoice(byte effect);
- void updateOscar();
- uint oscarFrame() const;
- void start6130();
- ActionResult execute6130(uint16 action);
- void start6180();
- void update6180();
- ActionResult execute6180(uint16 action);
- void drawScene6180(Graphics::ManagedSurface &viewport, bool foreground);
- void start6190();
- ActionResult execute6190(uint16 action);
- bool applyBackground6190();
- void updateMaps6190();
- void start6200();
- ActionResult execute6200(uint16 action);
- void updateMaps6200();
- void drawScene6200(Graphics::ManagedSurface &viewport);
- void start6210();
- ActionResult execute6210(uint16 action);
- void townAnimationFrame();
- void start6240();
- ActionResult execute6240(uint16 action);
- void drawForeground6240(Graphics::ManagedSurface &viewport);
- void start6260();
- ActionResult execute6260(uint16 action);
- bool applyBackground6260();
- void updateMaps6260();
- bool loadScene6263();
- void resume6263();
- void update6263();
- void drawScene6263(Graphics::ManagedSurface &viewport);
- ActionResult execute6263(uint16 action);
- void locomotiveAnimationFrame();
- ActionResult execute6350(uint16 action);
- ActionResult execute6220(uint16 action);
- void start6220();
- void update6220();
- void drawScene6220(Graphics::ManagedSurface &viewport);
- void start6370();
- ActionResult execute6370(uint16 action);
- void drawScene6370(Graphics::ManagedSurface &viewport);
- void startSushiConversation(bool introduction);
- void sushiDialogueChoice(byte effect);
RunawayAudio &_audio;
RunawaySequence _sequence;
@@ -411,22 +374,6 @@ protected:
RunawaySaveState::Museum _museum;
RunawaySaveState::Desert _desert;
RunawaySaveState::Town _town;
- uint16 _oscarStep = 130;
- byte _oscarIdle = 3;
- uint32 _oscarTick = 0;
- bool _oscarTalking = false, _mineOscarPresent = false;
- Common::Array<byte> _saloonPatches[3];
- byte _saloonDoorFrame = 0;
- uint32 _saloonDoorTick = 0;
- RunawayAnimation _locomotiveGauges[4];
- byte _locomotiveGaugeFrames[4] = {};
- byte _townFilm = 0;
- struct TownEncounter {
- enum Phase { kInactive, kRifle, kConversation, kDeparture };
- Phase phase = kInactive;
- uint32 tick = 0;
- uint frame = 0;
- } _townEncounter;
Common::Array<RunawayHotspot> _desertHotspots;
RunawayAnimation _desertAnimations[6];
byte _hangarShot = 0, _hangarShotCount = 0, _hangarShotFrame = 88;
diff --git a/engines/hollywood/runaway/scene4070.cpp b/engines/hollywood/runaway/scene4070.cpp
index 03af112a22f..5537f778a52 100644
--- a/engines/hollywood/runaway/scene4070.cpp
+++ b/engines/hollywood/runaway/scene4070.cpp
@@ -207,7 +207,7 @@ void RunawayRoomScene::buildDialogueChoices() {
for (uint i = 0; i < 8; ++i) {
if (!_dialogue[page][i].enabled)
continue;
- const SceneSpeechCue cue = _text.stageCue(_conversation == 6 ? 81 : 80, _dialogue[page][i].player);
+ const SceneSpeechCue cue = _text.stageCue(dialoguePlayerCue(), _dialogue[page][i].player);
const Common::U32String text(_text.largeTextRecord(cue.textRecordId), Common::kDos850);
if (!text.empty()) {
_choices.push_back(text);
@@ -233,14 +233,14 @@ void RunawayRoomScene::chooseDialogue(uint choice) {
DialogueChoice &entry = _dialogue[page][index];
_choices.clear();
_choiceIndices.clear();
- say(_conversation == 6 ? 81 : 80, entry.player);
+ say(dialoguePlayerCue(), entry.player);
if (_conversation == 2 && _museum.willyMet == 1) {
_dialogueEnding = true;
_afterConversation = 408;
return;
}
if (entry.response != 255)
- say(_conversation == 6 ? 91 : 90, entry.response, false, 1);
+ say(dialogueResponseCue(), entry.response, false, 1);
if (_conversation == 3)
_computerReject = true;
if (entry.disable)
@@ -275,14 +275,6 @@ void RunawayRoomScene::chooseDialogue(uint choice) {
}
}
-void RunawayRoomScene::handleCustomDialogueChoice(byte effect) {
- if (_conversation == 5) {
- sushiDialogueChoice(effect);
- } else if (_conversation == 6) {
- oscarDialogueChoice(effect);
- }
-}
-
void RunawayRoomScene::updateConversation() {
if (!_conversation || _roomAction || speaking() || !_choices.empty())
return;
diff --git a/engines/hollywood/runaway/scene6014.cpp b/engines/hollywood/runaway/scene6014.cpp
index 1b22561b6c5..b76e259be0d 100644
--- a/engines/hollywood/runaway/scene6014.cpp
+++ b/engines/hollywood/runaway/scene6014.cpp
@@ -19,9 +19,8 @@
*
*/
-
#include "common/util.h"
-#include "hollywood/runaway/scene.h"
+#include "hollywood/runaway/scene6014.h"
namespace Hollywood {
@@ -31,7 +30,39 @@ const RunawayRoom kRunawayScene6014 = {
Common::Point(512, 500), nullptr, 0, nullptr, 0, nullptr, 0
};
-RunawayRoomScene::ActionResult RunawayRoomScene::execute6014(uint16 action) {
+namespace Runaway {
+
+Scene6014::Scene6014(RunawayAudio &audio, RunawayInventory &inventory, const RunawayStrings &strings, RunawayGameType game) :
+ RunawayRoomScene(audio, inventory, strings, game) {}
+
+uint Scene6014::sceneResourceNumber() const {
+ return 3;
+}
+
+uint Scene6014::sceneTextNumber() const {
+ return 608;
+}
+
+bool Scene6014::loadWalkMap() {
+ _mask.resize(1024 * 600, 0);
+ _originalMaps.resize(1536, 0);
+ return true;
+}
+
+void Scene6014::runCustomEntrySequence() {
+ dispatchCustomSceneAction(400);
+}
+
+bool Scene6014::drawCustomComposite(Graphics::ManagedSurface &viewport) {
+ if (drawingRoomAnimation()) {
+ const uint frame = _roomAction == 401 ? 29 + speechFrame() :
+ _actionFrames[MIN<uint>(_actionStep, _actionFrames.size() - 1)];
+ _actionAnimation.draw(viewport, frame, 0, 0);
+ }
+ return true;
+}
+
+RunawayRoomScene::ActionResult Scene6014::dispatchCustomSceneAction(uint16 action) {
switch (action) {
case 400: // Lean over the shaft.
beginRoomAnimationRange(400, 1, 41, 0, 29, true, 60);
@@ -52,12 +83,5 @@ RunawayRoomScene::ActionResult RunawayRoomScene::execute6014(uint16 action) {
return kHandled;
}
-void RunawayRoomScene::drawScene6014(Graphics::ManagedSurface &viewport) {
- if (drawingRoomAnimation()) {
- const uint frame = _roomAction == 401 ? 29 + speechFrame() :
- _actionFrames[MIN<uint>(_actionStep, _actionFrames.size() - 1)];
- _actionAnimation.draw(viewport, frame, 0, 0);
- }
-}
-
+} // End of namespace Runaway
} // End of namespace Hollywood
diff --git a/engines/hollywood/runaway/scene6014.h b/engines/hollywood/runaway/scene6014.h
new file mode 100644
index 00000000000..c8526ecb300
--- /dev/null
+++ b/engines/hollywood/runaway/scene6014.h
@@ -0,0 +1,46 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+
+#ifndef HOLLYWOOD_RUNAWAY_SCENE6014_H
+#define HOLLYWOOD_RUNAWAY_SCENE6014_H
+
+#include "hollywood/runaway/scene.h"
+
+namespace Hollywood {
+namespace Runaway {
+
+class Scene6014 : public RunawayRoomScene {
+public:
+ Scene6014(RunawayAudio &audio, RunawayInventory &inventory, const RunawayStrings &strings, RunawayGameType game);
+
+private:
+ uint sceneResourceNumber() const override;
+ uint sceneTextNumber() const override;
+ bool loadWalkMap() override;
+ void runCustomEntrySequence() override;
+ bool drawCustomComposite(Graphics::ManagedSurface &viewport) override;
+ ActionResult dispatchCustomSceneAction(uint16 action) override;
+};
+
+} // End of namespace Runaway
+} // End of namespace Hollywood
+
+#endif // HOLLYWOOD_RUNAWAY_SCENE6014_H
diff --git a/engines/hollywood/runaway/scene6080.cpp b/engines/hollywood/runaway/scene6080.cpp
index 7141e6a4eb0..0f930c6f589 100644
--- a/engines/hollywood/runaway/scene6080.cpp
+++ b/engines/hollywood/runaway/scene6080.cpp
@@ -19,9 +19,8 @@
*
*/
-
#include "common/util.h"
-#include "hollywood/runaway/scene.h"
+#include "hollywood/runaway/scene6080.h"
namespace Hollywood {
namespace {
@@ -62,7 +61,36 @@ const RunawayRoom kRunawayScene6080 = {
kResponses, ARRAYSIZE(kResponses), kItemActions, ARRAYSIZE(kItemActions), nullptr, 0
};
-void RunawayRoomScene::start6080() {
+namespace Runaway {
+
+Scene6080::Scene6080(RunawayAudio &audio, RunawayInventory &inventory, const RunawayStrings &strings, RunawayGameType game) :
+ RunawayRoomScene(audio, inventory, strings, game) {}
+
+bool Scene6080::loadCustomResources() {
+ return _rockAnimation.load(_archive, 6, 2) && loadForeground(0, 4) && loadForeground(1, 7) &&
+ (_entryScene != 6082 || _oscarAnimation.load(_archive, 9, 135));
+}
+
+bool Scene6080::applyCustomBackgroundPatches() {
+ return _town.oilCan != 2 || applyPatch(5);
+}
+
+void Scene6080::applyCustomHotspotState() {
+ for (uint i = 0; i < 256; ++i) {
+ // Zone 6 is only used by scripted approaches to the mine.
+ if (_maps[i] == 6) {
+ _maps[i] = 0;
+ }
+ byte &id = _maps[256 + i];
+ if (id == 2 && _town.oilCan == 2) {
+ id = 0;
+ } else if (id == 4 && _town.rockMoved) {
+ id = 5;
+ }
+ }
+}
+
+void Scene6080::runCustomEntrySequence() {
if (_entryScene == 6081) {
_position = Common::Point(483, 318);
_walkPath.reset(_position);
@@ -85,42 +113,47 @@ void RunawayRoomScene::start6080() {
}
}
-void RunawayRoomScene::updateMaps6080() {
- for (uint i = 0; i < 256; ++i) {
- // Zone 6 is only used by scripted approaches to the mine.
- if (_maps[i] == 6) {
- _maps[i] = 0;
- }
- byte &id = _maps[256 + i];
- if (id == 2 && _town.oilCan == 2) {
- id = 0;
- } else if (id == 4 && _town.rockMoved) {
- id = 5;
- }
- }
-}
-
-void RunawayRoomScene::drawScene6080(Graphics::ManagedSurface &viewport, bool foreground) {
- if (foreground) {
- if (_position.x > 737) {
- drawForeground(viewport, 0);
- }
- if (_position.x > 754 && _position.y < 398) {
- drawForeground(viewport, 1);
- }
- return;
- }
+void Scene6080::drawCustomBackgroundComposite(Graphics::ManagedSurface &viewport) {
if (!_mineOscarPresent || _town.rockMoved) {
- _ambient.draw(viewport, _town.rockMoved, _camera.x, -_camera.y);
+ _rockAnimation.draw(viewport, _town.rockMoved, _camera.x, -_camera.y);
}
if (_mineOscarPresent && !drawingRoomAnimation()) {
const byte mouth = speaker() ? speechFrame() % 6 : 0;
const uint frame = _town.rockMoved ? (mouth ? 128 + mouth : 134) : mouth;
- _npc.draw(viewport, frame, _camera.x, -_camera.y);
+ _oscarAnimation.draw(viewport, frame, _camera.x, -_camera.y);
}
}
-RunawayRoomScene::ActionResult RunawayRoomScene::execute6080(uint16 action) {
+void Scene6080::drawCustomForegroundComposite(Graphics::ManagedSurface &viewport) {
+ if (_position.x > 737) {
+ drawForeground(viewport, 0);
+ }
+ if (_position.x > 754 && _position.y < 398) {
+ drawForeground(viewport, 1);
+ }
+}
+
+float Scene6080::actorHeight() const {
+ return _position.y * 1.12355208f - 218.007721f;
+}
+
+Common::U32String Scene6080::hotspotName(byte id) const {
+ if (id == 2 && _town.oilCan) {
+ return Common::U32String("Oil can");
+ }
+ return RunawayRoomScene::hotspotName(id);
+}
+
+void Scene6080::findWalkPath(Common::Point target) {
+ walkTown(target);
+}
+
+bool Scene6080::adjustCustomWalkTargetToFloorMask(Common::Point &target) const {
+ target.x = MIN<int>(target.x, 1152);
+ return false;
+}
+
+RunawayRoomScene::ActionResult Scene6080::dispatchCustomSceneAction(uint16 action) {
switch (action) {
case 302: // Return to the overview.
leaveTownRoom(6350);
@@ -137,7 +170,7 @@ RunawayRoomScene::ActionResult RunawayRoomScene::execute6080(uint16 action) {
break;
case 306: // Take the oil can.
if (!_town.oilCan) {
- execute6080(305);
+ dispatchCustomSceneAction(305);
}
deferTownAction(406);
break;
@@ -201,7 +234,7 @@ RunawayRoomScene::ActionResult RunawayRoomScene::execute6080(uint16 action) {
return kHandled;
}
-void RunawayRoomScene::mineAnimationFrame() {
+void Scene6080::handleAnimationFrameHook() {
if (_roomAction == 403) {
const uint frame = _actionFrames[_actionStep];
if (frame == 41) {
@@ -222,4 +255,5 @@ void RunawayRoomScene::mineAnimationFrame() {
}
}
+} // End of namespace Runaway
} // End of namespace Hollywood
diff --git a/engines/hollywood/runaway/scene6080.h b/engines/hollywood/runaway/scene6080.h
new file mode 100644
index 00000000000..c903053708a
--- /dev/null
+++ b/engines/hollywood/runaway/scene6080.h
@@ -0,0 +1,55 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+
+#ifndef HOLLYWOOD_RUNAWAY_SCENE6080_H
+#define HOLLYWOOD_RUNAWAY_SCENE6080_H
+
+#include "hollywood/runaway/scene.h"
+
+namespace Hollywood {
+namespace Runaway {
+
+class Scene6080 : public RunawayRoomScene {
+public:
+ Scene6080(RunawayAudio &audio, RunawayInventory &inventory, const RunawayStrings &strings, RunawayGameType game);
+
+private:
+ bool loadCustomResources() override;
+ bool applyCustomBackgroundPatches() override;
+ void applyCustomHotspotState() override;
+ void runCustomEntrySequence() override;
+ void drawCustomBackgroundComposite(Graphics::ManagedSurface &viewport) override;
+ void drawCustomForegroundComposite(Graphics::ManagedSurface &viewport) override;
+ float actorHeight() const override;
+ Common::U32String hotspotName(byte id) const override;
+ void findWalkPath(Common::Point target) override;
+ bool adjustCustomWalkTargetToFloorMask(Common::Point &target) const override;
+ ActionResult dispatchCustomSceneAction(uint16 action) override;
+ void handleAnimationFrameHook() override;
+
+ RunawayAnimation _rockAnimation, _oscarAnimation;
+ bool _mineOscarPresent = false;
+};
+
+} // End of namespace Runaway
+} // End of namespace Hollywood
+
+#endif // HOLLYWOOD_RUNAWAY_SCENE6080_H
diff --git a/engines/hollywood/runaway/scene6090.cpp b/engines/hollywood/runaway/scene6090.cpp
index 55c64109b78..e547062bdef 100644
--- a/engines/hollywood/runaway/scene6090.cpp
+++ b/engines/hollywood/runaway/scene6090.cpp
@@ -19,9 +19,8 @@
*
*/
-
#include "common/util.h"
-#include "hollywood/runaway/scene.h"
+#include "hollywood/runaway/scene6090.h"
namespace Hollywood {
namespace {
@@ -50,17 +49,7 @@ const RunawayItemAction kItemActions[] = {
{6090, 28, 4, 311} // Give Oscar chewing tobacco.
};
-// Oscar uses the same idle sequence in the wide view and at the doorway.
-const byte kOscarFrames[] = {
- 106, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29,
- 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41,
- 106, 106, 106, 106, 106, 106, 106, 106,
- 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60,
- 53, 54, 55, 56, 57, 58, 59, 60, 53, 54, 55, 56, 57, 58, 59, 60,
- 61, 62, 63, 64, 65, 66, 51, 50, 49, 48, 47, 46, 45, 44, 43, 42,
- 106, 106, 106, 106, 106, 106, 106, 106, 106,
- 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106
-};
+
} // End of anonymous namespace
@@ -70,7 +59,32 @@ const RunawayRoom kRunawayScene6090 = {
kResponses, ARRAYSIZE(kResponses), kItemActions, ARRAYSIZE(kItemActions), nullptr, 0
};
-void RunawayRoomScene::start6090() {
+namespace Runaway {
+
+Scene6090::Scene6090(RunawayAudio &audio, RunawayInventory &inventory, const RunawayStrings &strings, RunawayGameType game) :
+ RunawayRoomScene(audio, inventory, strings, game), _oscar(true) {}
+
+bool Scene6090::loadCustomResources() {
+ return _oscarAnimation.load(_archive, 6, 113) && loadForeground(0, 4);
+}
+
+bool Scene6090::applyCustomBackgroundPatches() {
+ return _town.vessel != 2 || applyPatch(5);
+}
+
+void Scene6090::applyCustomHotspotState() {
+ for (uint i = 0; i < 256; ++i) {
+ if (_maps[256 + i] == 6 && _town.vessel == 2) {
+ _maps[256 + i] = 0;
+ }
+ }
+}
+
+void Scene6090::prepareCustomGameplayLoop() {
+ _oscar.resume(_now);
+}
+
+void Scene6090::runCustomEntrySequence() {
if (!_town.oscarMet) {
walkTo(Common::Point(676, 510), 7);
deferTownAction(400);
@@ -79,51 +93,31 @@ void RunawayRoomScene::start6090() {
}
}
-void RunawayRoomScene::updateOscar() {
- if (_oscarTalking) {
- _oscarTick = _now;
- return;
- }
- if (_now - _oscarTick < 80) {
- return;
- }
- _oscarTick = _now;
- const uint last = _oscarIdle == 1 ? 62 : _oscarIdle == 2 ? 121 : _room == 6090 ? 165 : 164;
- if (_oscarStep < last) {
- ++_oscarStep;
- if (_room == 6090 && _oscarIdle == 2 && _oscarStep == 80) {
- _audio.playEffect(80, 26, 1);
- }
- } else if (_oscarIdle == 3 && !_random.getRandomNumber(_room == 6090 ? 4 : 9)) {
- _oscarIdle = 1 + _random.getRandomBit();
- _oscarStep = _oscarIdle == 1 ? 0 : 70;
- } else {
- _oscarIdle = 3;
- _oscarStep = 130;
- }
- if (_room == 6090 && _oscarIdle == 3 && !_audio.effectPlaying(1)) {
- _audio.playEffect(76, 153, 1, true);
- }
+void Scene6090::advanceCustomGameplayLoop(uint32 delta) {
+ _oscar.update(_now, _random, _audio);
}
-uint RunawayRoomScene::oscarFrame() const {
- if (_oscarTalking) {
- return 107 + (speaker() ? speechFrame() % 6 : 0);
- }
- const uint frame = kOscarFrames[_oscarStep];
- return _room == 6130 && frame == 106 ? 105 : frame;
+void Scene6090::drawCustomBackgroundComposite(Graphics::ManagedSurface &viewport) {
+ drawOscar(viewport, false);
}
-void RunawayRoomScene::drawScene6090(Graphics::ManagedSurface &viewport, bool foreground) {
- if ((_position.y < 460) == foreground && !drawingRoomAnimation()) {
- _npc.draw(viewport, oscarFrame(), _camera.x, -_camera.y);
- }
- if (foreground) {
- drawForeground(viewport, 0);
+void Scene6090::drawCustomForegroundComposite(Graphics::ManagedSurface &viewport) {
+ drawOscar(viewport, true);
+}
+
+float Scene6090::actorHeight() const {
+ return _position.y < 510 ? _position.y * 0.840707958f - 38.7610626f :
+ _position.y * 0.730337083f + 17.5280895f;
+}
+
+Common::U32String Scene6090::hotspotName(byte id) const {
+ if (id == 4 && _town.oscarTobacco) {
+ return Common::U32String("Oscar");
}
+ return RunawayRoomScene::hotspotName(id);
}
-RunawayRoomScene::ActionResult RunawayRoomScene::execute6090(uint16 action) {
+RunawayRoomScene::ActionResult Scene6090::dispatchCustomSceneAction(uint16 action) {
switch (action) {
case 302: // Return to the wide view of the house.
leaveTownRoom(6131);
@@ -162,7 +156,7 @@ RunawayRoomScene::ActionResult RunawayRoomScene::execute6090(uint16 action) {
}
break;
case 311: // Offer the prepared chewing tobacco.
- _oscarTalking = true;
+ _oscar.setTalking(true);
_audio.stopEffect(1);
say(9);
say(9, 1, false, 1);
@@ -189,7 +183,7 @@ RunawayRoomScene::ActionResult RunawayRoomScene::execute6090(uint16 action) {
deferTownAction(412);
break;
case 412:
- _oscarTalking = false;
+ _oscar.setTalking(false);
walkTo(Common::Point(718, 543), 4);
say(9, 6);
break;
@@ -199,7 +193,7 @@ RunawayRoomScene::ActionResult RunawayRoomScene::execute6090(uint16 action) {
break;
case 313: // Take the vessel while Oscar is occupied.
if (!_town.vessel) {
- execute6090(312);
+ dispatchCustomSceneAction(312);
}
if (_town.oscarTobacco == 1) {
say(11);
@@ -214,7 +208,7 @@ RunawayRoomScene::ActionResult RunawayRoomScene::execute6090(uint16 action) {
say(11, 1);
return kBackgroundChanged;
case 314: // Oscar chews tobacco; he does not smoke the untreated leaves.
- _oscarTalking = true;
+ _oscar.setTalking(true);
_audio.stopEffect(1);
say(12);
say(12, 1, false, 1);
@@ -225,7 +219,7 @@ RunawayRoomScene::ActionResult RunawayRoomScene::execute6090(uint16 action) {
leaveTownRoom(6350);
break;
case 400: // First meeting at Mama Dorita's door.
- _oscarTalking = true;
+ _oscar.setTalking(true);
_audio.stopEffect(1);
for (uint i = 0; i <= 14; ++i) {
say(0, i, false, (i % 2) == 0);
@@ -234,9 +228,7 @@ RunawayRoomScene::ActionResult RunawayRoomScene::execute6090(uint16 action) {
deferTownAction(401);
break;
case 401: // Oscar returns to his idle animation.
- _oscarTalking = false;
- _oscarIdle = 3;
- _oscarStep = 130;
+ _oscar.startIdle();
break;
case 402: // Oscar has agreed to move the mine's rock.
leaveTownRoom(6082);
@@ -247,7 +239,33 @@ RunawayRoomScene::ActionResult RunawayRoomScene::execute6090(uint16 action) {
return kHandled;
}
-void RunawayRoomScene::startOscarConversation() {
+uint16 Scene6090::dialoguePlayerCue() const {
+ return 81;
+}
+
+uint16 Scene6090::dialogueResponseCue() const {
+ return 91;
+}
+
+void Scene6090::handleCustomDialogueChoice(byte effect) {
+ if (effect == 3) { // Remember that Oscar has already refused the favour.
+ _town.oscarHelpRefused = 1;
+ } else if (effect == 5) { // A gift of chewing tobacco earns his help.
+ say(81, 7);
+ _afterConversation = 402;
+ }
+}
+
+void Scene6090::drawOscar(Graphics::ManagedSurface &viewport, bool foreground) {
+ if ((_position.y < 460) == foreground && !drawingRoomAnimation()) {
+ _oscarAnimation.draw(viewport, _oscar.frame(speaker(), speechFrame()), _camera.x, -_camera.y);
+ }
+ if (foreground) {
+ drawForeground(viewport, 0);
+ }
+}
+
+void Scene6090::startOscarConversation() {
_conversation = 6;
_dialogueDepth = _dialogueNode = _dialogueIntro = 0;
_dialogueEnding = false;
@@ -255,7 +273,7 @@ void RunawayRoomScene::startOscarConversation() {
_choiceIndices.clear();
memset(_dialogue, 0, sizeof(_dialogue));
_afterConversation = 401;
- _oscarTalking = true;
+ _oscar.setTalking(true);
_audio.stopEffect(1);
say(81, _town.oscarTobacco == 1 ? 0 : 8);
say(91, 0, false, 1);
@@ -277,13 +295,5 @@ void RunawayRoomScene::startOscarConversation() {
}
}
-void RunawayRoomScene::oscarDialogueChoice(byte effect) {
- if (effect == 3) { // Remember that Oscar has already refused the favour.
- _town.oscarHelpRefused = 1;
- } else if (effect == 5) { // A gift of chewing tobacco earns his help.
- say(81, 7);
- _afterConversation = 402;
- }
-}
-
+} // End of namespace Runaway
} // End of namespace Hollywood
diff --git a/engines/hollywood/runaway/scene6090.h b/engines/hollywood/runaway/scene6090.h
new file mode 100644
index 00000000000..ef0da6475e8
--- /dev/null
+++ b/engines/hollywood/runaway/scene6090.h
@@ -0,0 +1,61 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+
+#ifndef HOLLYWOOD_RUNAWAY_SCENE6090_H
+#define HOLLYWOOD_RUNAWAY_SCENE6090_H
+
+#include "hollywood/runaway/oscar.h"
+#include "hollywood/runaway/scene.h"
+
+namespace Hollywood {
+namespace Runaway {
+
+class Scene6090 : public RunawayRoomScene {
+public:
+ Scene6090(RunawayAudio &audio, RunawayInventory &inventory, const RunawayStrings &strings, RunawayGameType game);
+
+private:
+ bool loadCustomResources() override;
+ bool applyCustomBackgroundPatches() override;
+ void applyCustomHotspotState() override;
+ void prepareCustomGameplayLoop() override;
+ void runCustomEntrySequence() override;
+ void advanceCustomGameplayLoop(uint32 delta) override;
+ void drawCustomBackgroundComposite(Graphics::ManagedSurface &viewport) override;
+ void drawCustomForegroundComposite(Graphics::ManagedSurface &viewport) override;
+ float actorHeight() const override;
+ Common::U32String hotspotName(byte id) const override;
+ ActionResult dispatchCustomSceneAction(uint16 action) override;
+ uint16 dialoguePlayerCue() const override;
+ uint16 dialogueResponseCue() const override;
+ void handleCustomDialogueChoice(byte effect) override;
+
+ void drawOscar(Graphics::ManagedSurface &viewport, bool foreground);
+ void startOscarConversation();
+
+ OscarAnimation _oscar;
+ RunawayAnimation _oscarAnimation;
+};
+
+} // End of namespace Runaway
+} // End of namespace Hollywood
+
+#endif // HOLLYWOOD_RUNAWAY_SCENE6090_H
diff --git a/engines/hollywood/runaway/scene6130.cpp b/engines/hollywood/runaway/scene6130.cpp
index acad5fee687..724c61c539a 100644
--- a/engines/hollywood/runaway/scene6130.cpp
+++ b/engines/hollywood/runaway/scene6130.cpp
@@ -19,9 +19,8 @@
*
*/
-
#include "common/util.h"
-#include "hollywood/runaway/scene.h"
+#include "hollywood/runaway/scene6130.h"
namespace Hollywood {
namespace {
@@ -50,7 +49,32 @@ const RunawayRoom kRunawayScene6130 = {
kResponses, ARRAYSIZE(kResponses), nullptr, 0, nullptr, 0
};
-void RunawayRoomScene::start6130() {
+namespace Runaway {
+
+Scene6130::Scene6130(RunawayAudio &audio, RunawayInventory &inventory, const RunawayStrings &strings, RunawayGameType game) :
+ RunawayRoomScene(audio, inventory, strings, game), _oscar(false) {}
+
+bool Scene6130::loadCustomResources() {
+ return _oscarAnimation.load(_archive, 6, 106);
+}
+
+bool Scene6130::applyCustomBackgroundPatches() {
+ return (_town.stone != 2 || applyPatch(4)) && (_town.vessel != 2 || applyPatch(5));
+}
+
+void Scene6130::applyCustomHotspotState() {
+ for (uint i = 0; i < 256; ++i) {
+ if (_maps[256 + i] == 4 && _town.stone == 2) {
+ _maps[256 + i] = 0;
+ }
+ }
+}
+
+void Scene6130::prepareCustomGameplayLoop() {
+ _oscar.resume(_now);
+}
+
+void Scene6130::runCustomEntrySequence() {
if (_entryScene == 6131) {
_position = Common::Point(401, 375);
_walkPath.reset(_position);
@@ -64,7 +88,31 @@ void RunawayRoomScene::start6130() {
}
}
-RunawayRoomScene::ActionResult RunawayRoomScene::execute6130(uint16 action) {
+void Scene6130::advanceCustomGameplayLoop(uint32 delta) {
+ _oscar.update(_now, _random, _audio);
+}
+
+void Scene6130::drawCustomBackgroundComposite(Graphics::ManagedSurface &viewport) {
+ _oscarAnimation.draw(viewport, _oscar.frame(speaker(), speechFrame()), _camera.x, -_camera.y);
+}
+
+float Scene6130::actorHeight() const {
+ return _position.y * 1.027668f - 160.57312f;
+}
+
+void Scene6130::setupActorDepth(RunawayActor::RenderParams ¶ms) const {
+ params.depthY[1] = 480;
+ params.depthY[2] = 599;
+}
+
+bool Scene6130::shouldApproachHotspot(byte id, bool use, byte item, bool approach) const {
+ if (!item && id == 4 && !use && _town.stone) {
+ return false;
+ }
+ return approach;
+}
+
+RunawayRoomScene::ActionResult Scene6130::dispatchCustomSceneAction(uint16 action) {
switch (action) {
case 301: // Look toward Douglasville.
say(1, _town.streetVisited);
@@ -86,7 +134,7 @@ RunawayRoomScene::ActionResult RunawayRoomScene::execute6130(uint16 action) {
break;
case 308: // Take the unusually shaped stone.
if (!_town.stone) {
- execute6130(307);
+ dispatchCustomSceneAction(307);
}
say(6);
deferTownAction(408);
@@ -110,4 +158,5 @@ RunawayRoomScene::ActionResult RunawayRoomScene::execute6130(uint16 action) {
return kHandled;
}
+} // End of namespace Runaway
} // End of namespace Hollywood
diff --git a/engines/hollywood/runaway/scene6130.h b/engines/hollywood/runaway/scene6130.h
new file mode 100644
index 00000000000..044338cc44b
--- /dev/null
+++ b/engines/hollywood/runaway/scene6130.h
@@ -0,0 +1,55 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+
+#ifndef HOLLYWOOD_RUNAWAY_SCENE6130_H
+#define HOLLYWOOD_RUNAWAY_SCENE6130_H
+
+#include "hollywood/runaway/oscar.h"
+#include "hollywood/runaway/scene.h"
+
+namespace Hollywood {
+namespace Runaway {
+
+class Scene6130 : public RunawayRoomScene {
+public:
+ Scene6130(RunawayAudio &audio, RunawayInventory &inventory, const RunawayStrings &strings, RunawayGameType game);
+
+private:
+ bool loadCustomResources() override;
+ bool applyCustomBackgroundPatches() override;
+ void applyCustomHotspotState() override;
+ void prepareCustomGameplayLoop() override;
+ void runCustomEntrySequence() override;
+ void advanceCustomGameplayLoop(uint32 delta) override;
+ void drawCustomBackgroundComposite(Graphics::ManagedSurface &viewport) override;
+ float actorHeight() const override;
+ void setupActorDepth(RunawayActor::RenderParams ¶ms) const override;
+ bool shouldApproachHotspot(byte id, bool use, byte item, bool approach) const override;
+ ActionResult dispatchCustomSceneAction(uint16 action) override;
+
+ OscarAnimation _oscar;
+ RunawayAnimation _oscarAnimation;
+};
+
+} // End of namespace Runaway
+} // End of namespace Hollywood
+
+#endif // HOLLYWOOD_RUNAWAY_SCENE6130_H
diff --git a/engines/hollywood/runaway/scene6180.cpp b/engines/hollywood/runaway/scene6180.cpp
index 572c02168a3..8642676477f 100644
--- a/engines/hollywood/runaway/scene6180.cpp
+++ b/engines/hollywood/runaway/scene6180.cpp
@@ -19,9 +19,8 @@
*
*/
-
#include "common/util.h"
-#include "hollywood/runaway/scene.h"
+#include "hollywood/runaway/scene6180.h"
namespace Hollywood {
namespace {
@@ -62,7 +61,33 @@ const RunawayRoom kRunawayScene6180 = {
kResponses, ARRAYSIZE(kResponses), kItemActions, ARRAYSIZE(kItemActions), nullptr, 0
};
-void RunawayRoomScene::start6180() {
+namespace Runaway {
+
+Scene6180::Scene6180(RunawayAudio &audio, RunawayInventory &inventory, const RunawayStrings &strings, RunawayGameType game) :
+ RunawayRoomScene(audio, inventory, strings, game) {}
+
+bool Scene6180::loadCustomResources() {
+ return _doorAnimation.load(_archive, 8, 71) && loadForeground(0, 4) && loadForeground(1, 5) &&
+ _archive.readVariableChunk(6, _doorPatches[0]) && _archive.readVariableChunk(7, _doorPatches[1]);
+}
+
+void Scene6180::applyCustomHotspotState() {
+ for (uint i = 0; i < 256; ++i) {
+ if (_maps[i] == 3) {
+ _maps[i] = 0;
+ }
+ if (_maps[256 + i] == 4 && !_town.saloonDoorKnown) {
+ _maps[256 + i] = 0;
+ }
+ }
+}
+
+void Scene6180::prepareCustomGameplayLoop() {
+ _saloonDoorTick = _now;
+ _saloonDoorFrame = _position.x > 726 ? 7 : 0;
+}
+
+void Scene6180::runCustomEntrySequence() {
if (_entryScene == 6181) {
_position = Common::Point(1023, 519);
_walkPath.reset(_position);
@@ -77,7 +102,7 @@ void RunawayRoomScene::start6180() {
}
}
-void RunawayRoomScene::update6180() {
+void Scene6180::advanceCustomGameplayLoop(uint32 delta) {
if (_roomAction == 401 && !_actionFrames.empty()) {
_actionFrames[0] = 24 + speechFrame();
}
@@ -102,21 +127,37 @@ void RunawayRoomScene::update6180() {
}
}
-void RunawayRoomScene::drawScene6180(Graphics::ManagedSurface &viewport, bool foreground) {
- if (foreground) {
- if (_position.x < 273) {
- drawForeground(viewport, 0);
- }
- if (_position.x > 714) {
- drawForeground(viewport, 1);
- }
- } else {
- applyRunawayPatch(_saloonPatches[_position.x > 726], viewport);
- _ambient.draw(viewport, _saloonDoorFrame, 0, 0);
+void Scene6180::drawCustomBackgroundComposite(Graphics::ManagedSurface &viewport) {
+ applyRunawayPatch(_doorPatches[_position.x > 726], viewport);
+ _doorAnimation.draw(viewport, _saloonDoorFrame, 0, 0);
+}
+
+void Scene6180::drawCustomForegroundComposite(Graphics::ManagedSurface &viewport) {
+ if (_position.x < 273) {
+ drawForeground(viewport, 0);
+ }
+ if (_position.x > 714) {
+ drawForeground(viewport, 1);
+ }
+}
+
+float Scene6180::actorHeight() const {
+ return _position.y * 1.3565892f - 249.069763f;
+}
+
+void Scene6180::findWalkPath(Common::Point target) {
+ walkTown(target);
+}
+
+bool Scene6180::adjustCustomWalkTargetToFloorMask(Common::Point &target) const {
+ if (_originalMaps[_mask[target.y * _background.w + target.x]] == 3) {
+ return true;
}
+ target.x = CLIP<int>(target.x, 202, 679);
+ return false;
}
-RunawayRoomScene::ActionResult RunawayRoomScene::execute6180(uint16 action) {
+RunawayRoomScene::ActionResult Scene6180::dispatchCustomSceneAction(uint16 action) {
switch (action) {
case 302: // Leave the porch and return to Douglasville.
leaveTownRoom(6221);
@@ -163,4 +204,5 @@ RunawayRoomScene::ActionResult RunawayRoomScene::execute6180(uint16 action) {
return kHandled;
}
+} // End of namespace Runaway
} // End of namespace Hollywood
diff --git a/engines/hollywood/runaway/scene6180.h b/engines/hollywood/runaway/scene6180.h
new file mode 100644
index 00000000000..12263b10628
--- /dev/null
+++ b/engines/hollywood/runaway/scene6180.h
@@ -0,0 +1,56 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+
+#ifndef HOLLYWOOD_RUNAWAY_SCENE6180_H
+#define HOLLYWOOD_RUNAWAY_SCENE6180_H
+
+#include "hollywood/runaway/scene.h"
+
+namespace Hollywood {
+namespace Runaway {
+
+class Scene6180 : public RunawayRoomScene {
+public:
+ Scene6180(RunawayAudio &audio, RunawayInventory &inventory, const RunawayStrings &strings, RunawayGameType game);
+
+private:
+ bool loadCustomResources() override;
+ void applyCustomHotspotState() override;
+ void prepareCustomGameplayLoop() override;
+ void runCustomEntrySequence() override;
+ void advanceCustomGameplayLoop(uint32 delta) override;
+ void drawCustomBackgroundComposite(Graphics::ManagedSurface &viewport) override;
+ void drawCustomForegroundComposite(Graphics::ManagedSurface &viewport) override;
+ float actorHeight() const override;
+ void findWalkPath(Common::Point target) override;
+ bool adjustCustomWalkTargetToFloorMask(Common::Point &target) const override;
+ ActionResult dispatchCustomSceneAction(uint16 action) override;
+
+ RunawayAnimation _doorAnimation;
+ Common::Array<byte> _doorPatches[2];
+ byte _saloonDoorFrame = 0;
+ uint32 _saloonDoorTick = 0;
+};
+
+} // End of namespace Runaway
+} // End of namespace Hollywood
+
+#endif // HOLLYWOOD_RUNAWAY_SCENE6180_H
diff --git a/engines/hollywood/runaway/scene6190.cpp b/engines/hollywood/runaway/scene6190.cpp
index 8d1edc6a681..6ae8bf53cb1 100644
--- a/engines/hollywood/runaway/scene6190.cpp
+++ b/engines/hollywood/runaway/scene6190.cpp
@@ -19,9 +19,8 @@
*
*/
-
#include "common/util.h"
-#include "hollywood/runaway/scene.h"
+#include "hollywood/runaway/scene6190.h"
namespace Hollywood {
namespace {
@@ -60,21 +59,21 @@ const RunawayRoom kRunawayScene6190 = {
kResponses, ARRAYSIZE(kResponses), nullptr, 0, nullptr, 0
};
-void RunawayRoomScene::start6190() {
- if (!_town.bankVisited) {
- walkTo(Common::Point(1075, 330), 7);
- deferTownAction(400);
- } else {
- walkTo(Common::Point(669, 413), 7);
- }
+namespace Runaway {
+
+Scene6190::Scene6190(RunawayAudio &audio, RunawayInventory &inventory, const RunawayStrings &strings, RunawayGameType game) :
+ RunawayRoomScene(audio, inventory, strings, game) {}
+
+bool Scene6190::usesAlternateActor() const {
+ return false;
}
-bool RunawayRoomScene::applyBackground6190() {
+bool Scene6190::applyCustomBackgroundPatches() {
return (!_town.bankStampTaken || applyPatch(8)) &&
(_town.bankShelves != 2 || applyPatch(9));
}
-void RunawayRoomScene::updateMaps6190() {
+void Scene6190::applyCustomHotspotState() {
for (uint i = 0; i < 256; ++i) {
byte &id = _maps[256 + i];
// The bucket only appears after the catapult has hit the bank.
@@ -86,7 +85,25 @@ void RunawayRoomScene::updateMaps6190() {
}
}
-RunawayRoomScene::ActionResult RunawayRoomScene::execute6190(uint16 action) {
+void Scene6190::runCustomEntrySequence() {
+ if (!_town.bankVisited) {
+ walkTo(Common::Point(1075, 330), 7);
+ deferTownAction(400);
+ } else {
+ walkTo(Common::Point(669, 413), 7);
+ }
+}
+
+float Scene6190::actorHeight() const {
+ return (_position.y * 0.426829278f + 16.4634151f + _position.x * 0.0980392173f + 41.7647057f) / 2;
+}
+
+void Scene6190::setupActorDepth(RunawayActor::RenderParams ¶ms) const {
+ params.depthY[1] = 599;
+ params.depthY[2] = 388;
+}
+
+RunawayRoomScene::ActionResult Scene6190::dispatchCustomSceneAction(uint16 action) {
switch (action) {
case 302: // Return to the street.
leaveTownRoom(6224);
@@ -142,4 +159,5 @@ RunawayRoomScene::ActionResult RunawayRoomScene::execute6190(uint16 action) {
return kHandled;
}
+} // End of namespace Runaway
} // End of namespace Hollywood
diff --git a/engines/hollywood/runaway/scene6190.h b/engines/hollywood/runaway/scene6190.h
new file mode 100644
index 00000000000..0601569d90c
--- /dev/null
+++ b/engines/hollywood/runaway/scene6190.h
@@ -0,0 +1,47 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+
+#ifndef HOLLYWOOD_RUNAWAY_SCENE6190_H
+#define HOLLYWOOD_RUNAWAY_SCENE6190_H
+
+#include "hollywood/runaway/scene.h"
+
+namespace Hollywood {
+namespace Runaway {
+
+class Scene6190 : public RunawayRoomScene {
+public:
+ Scene6190(RunawayAudio &audio, RunawayInventory &inventory, const RunawayStrings &strings, RunawayGameType game);
+
+private:
+ bool usesAlternateActor() const override;
+ bool applyCustomBackgroundPatches() override;
+ void applyCustomHotspotState() override;
+ void runCustomEntrySequence() override;
+ float actorHeight() const override;
+ void setupActorDepth(RunawayActor::RenderParams ¶ms) const override;
+ ActionResult dispatchCustomSceneAction(uint16 action) override;
+};
+
+} // End of namespace Runaway
+} // End of namespace Hollywood
+
+#endif // HOLLYWOOD_RUNAWAY_SCENE6190_H
diff --git a/engines/hollywood/runaway/scene6200.cpp b/engines/hollywood/runaway/scene6200.cpp
index dd7cccec051..33e06b06dc3 100644
--- a/engines/hollywood/runaway/scene6200.cpp
+++ b/engines/hollywood/runaway/scene6200.cpp
@@ -19,9 +19,8 @@
*
*/
-
#include "common/util.h"
-#include "hollywood/runaway/scene.h"
+#include "hollywood/runaway/scene6200.h"
namespace Hollywood {
namespace {
@@ -61,20 +60,24 @@ const RunawayRoom kRunawayScene6200 = {
kResponses, ARRAYSIZE(kResponses), kItemActions, ARRAYSIZE(kItemActions), nullptr, 0
};
-void RunawayRoomScene::start6200() {
- if (_entryScene == 6201) {
- _position = Common::Point(258, 445);
- _walkPath.reset(_position);
- updateCamera();
- walkTo(Common::Point(211, 506), 5, true);
- } else if (!_town.bodySeen) {
- _facing = 5;
- say(0);
- deferTownAction(400);
- }
+namespace Runaway {
+
+Scene6200::Scene6200(RunawayAudio &audio, RunawayInventory &inventory, const RunawayStrings &strings, RunawayGameType game) :
+ RunawayRoomScene(audio, inventory, strings, game) {}
+
+bool Scene6200::usesAlternateActor() const {
+ return false;
+}
+
+bool Scene6200::loadCustomResources() {
+ return _cellDoorAnimation.load(_archive, 6, 26);
}
-void RunawayRoomScene::updateMaps6200() {
+bool Scene6200::applyCustomBackgroundPatches() {
+ return !_town.firewoodTaken || applyPatch(4);
+}
+
+void Scene6200::applyCustomHotspotState() {
for (uint i = 0; i < 256; ++i) {
// The approach to the cell is scripted; free walking stays in the office.
if (_maps[i] > 1) {
@@ -86,13 +89,45 @@ void RunawayRoomScene::updateMaps6200() {
}
}
-void RunawayRoomScene::drawScene6200(Graphics::ManagedSurface &viewport) {
+void Scene6200::resumeAmbientAudio(bool entering) {
+ const bool restart = entering && _entryScene == 6200;
+ if (restart || !_audio.musicPlaying()) {
+ _audio.playMusic(18);
+ _audio.setMusicVolume(191);
+ } else if (entering) {
+ _audio.setMusicVolume(191);
+ }
+}
+
+void Scene6200::runCustomEntrySequence() {
+ if (_entryScene == 6201) {
+ _position = Common::Point(258, 445);
+ _walkPath.reset(_position);
+ updateCamera();
+ walkTo(Common::Point(211, 506), 5, true);
+ } else if (!_town.bodySeen) {
+ _facing = 5;
+ say(0);
+ deferTownAction(400);
+ }
+}
+
+void Scene6200::drawCustomBackgroundComposite(Graphics::ManagedSurface &viewport) {
if (!drawingRoomAnimation() || _roomAction != 314) {
- _ambient.draw(viewport, _town.cellOpen ? 25 : 0, _camera.x, -_camera.y);
+ _cellDoorAnimation.draw(viewport, _town.cellOpen ? 25 : 0, _camera.x, -_camera.y);
}
}
-RunawayRoomScene::ActionResult RunawayRoomScene::execute6200(uint16 action) {
+float Scene6200::actorHeight() const {
+ return _position.y > 501 ? _position.y * 0.618556678f + 84.4845352f :
+ _position.y * 1.38297868f - 299.255310f;
+}
+
+void Scene6200::setupActorDepth(RunawayActor::RenderParams ¶ms) const {
+ params.depthY[1] = 599;
+}
+
+RunawayRoomScene::ActionResult Scene6200::dispatchCustomSceneAction(uint16 action) {
switch (action) {
case 302: // Return to the street.
leaveTownRoom(6223);
@@ -121,7 +156,7 @@ RunawayRoomScene::ActionResult RunawayRoomScene::execute6200(uint16 action) {
return kBackgroundChanged;
case 314: // Unlock the cell.
if (_town.cellOpen) {
- execute6200(305);
+ dispatchCustomSceneAction(305);
} else {
byte brian[47], door[47];
for (uint i = 0; i < ARRAYSIZE(door); ++i) {
@@ -153,4 +188,15 @@ RunawayRoomScene::ActionResult RunawayRoomScene::execute6200(uint16 action) {
return kHandled;
}
+void Scene6200::handleAnimationFrameHook() {
+ if (_roomAction == 314) {
+ if (_actionStep == 13) {
+ _audio.playEffect(58);
+ } else if (_actionStep == 22) {
+ _audio.playEffect(59);
+ }
+ }
+}
+
+} // End of namespace Runaway
} // End of namespace Hollywood
diff --git a/engines/hollywood/runaway/scene6200.h b/engines/hollywood/runaway/scene6200.h
new file mode 100644
index 00000000000..e2527dd97bb
--- /dev/null
+++ b/engines/hollywood/runaway/scene6200.h
@@ -0,0 +1,53 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+
+#ifndef HOLLYWOOD_RUNAWAY_SCENE6200_H
+#define HOLLYWOOD_RUNAWAY_SCENE6200_H
+
+#include "hollywood/runaway/scene.h"
+
+namespace Hollywood {
+namespace Runaway {
+
+class Scene6200 : public RunawayRoomScene {
+public:
+ Scene6200(RunawayAudio &audio, RunawayInventory &inventory, const RunawayStrings &strings, RunawayGameType game);
+
+private:
+ bool usesAlternateActor() const override;
+ bool loadCustomResources() override;
+ bool applyCustomBackgroundPatches() override;
+ void applyCustomHotspotState() override;
+ void resumeAmbientAudio(bool entering) override;
+ void runCustomEntrySequence() override;
+ void drawCustomBackgroundComposite(Graphics::ManagedSurface &viewport) override;
+ float actorHeight() const override;
+ void setupActorDepth(RunawayActor::RenderParams ¶ms) const override;
+ ActionResult dispatchCustomSceneAction(uint16 action) override;
+ void handleAnimationFrameHook() override;
+
+ RunawayAnimation _cellDoorAnimation;
+};
+
+} // End of namespace Runaway
+} // End of namespace Hollywood
+
+#endif // HOLLYWOOD_RUNAWAY_SCENE6200_H
diff --git a/engines/hollywood/runaway/scene6210.cpp b/engines/hollywood/runaway/scene6210.cpp
index 8eb82ca46e5..a5e8eb1a94d 100644
--- a/engines/hollywood/runaway/scene6210.cpp
+++ b/engines/hollywood/runaway/scene6210.cpp
@@ -19,9 +19,8 @@
*
*/
-
#include "common/util.h"
-#include "hollywood/runaway/scene.h"
+#include "hollywood/runaway/scene6210.h"
namespace Hollywood {
namespace {
@@ -56,13 +55,42 @@ const RunawayRoom kRunawayScene6210 = {
kResponses, ARRAYSIZE(kResponses), nullptr, 0, nullptr, 0
};
-void RunawayRoomScene::start6210() {
+namespace Runaway {
+
+Scene6210::Scene6210(RunawayAudio &audio, RunawayInventory &inventory, const RunawayStrings &strings, RunawayGameType game) :
+ RunawayRoomScene(audio, inventory, strings, game) {}
+
+void Scene6210::resumeAmbientAudio(bool entering) {
+ if (!_audio.musicPlaying()) {
+ _audio.playMusic(18);
+ _audio.setMusicVolume(191);
+ } else if (entering) {
+ _audio.setMusicVolume(191);
+ }
+}
+
+void Scene6210::runCustomEntrySequence() {
_facing = 0;
_town.cellOpen = _town.bodySeen = 1;
_town.cellRefusals = 0;
}
-RunawayRoomScene::ActionResult RunawayRoomScene::execute6210(uint16 action) {
+float Scene6210::actorHeight() const {
+ return _position.y * 0.413793117f + 229.482758f;
+}
+
+void Scene6210::setupActorDepth(RunawayActor::RenderParams ¶ms) const {
+ params.depthY[1] = 599;
+}
+
+bool Scene6210::shouldApproachHotspot(byte id, bool use, byte item, bool approach) const {
+ if (!item && !use && ((id == 5 && _town.bucketSeen) || (id == 8 && _town.bottleSeen))) {
+ return false;
+ }
+ return approach;
+}
+
+RunawayRoomScene::ActionResult Scene6210::dispatchCustomSceneAction(uint16 action) {
switch (action) {
case 302: // Return to the sheriff's office.
leaveTownRoom(6201);
@@ -88,7 +116,7 @@ RunawayRoomScene::ActionResult RunawayRoomScene::execute6210(uint16 action) {
deferTownAction(411);
}
} else if (_town.oscarTobacco && !_town.linimentTaken) {
- execute6210(411);
+ dispatchCustomSceneAction(411);
} else {
say(3, 2);
holdRoomAnimation(412, 4, 28, 16);
@@ -119,11 +147,11 @@ RunawayRoomScene::ActionResult RunawayRoomScene::execute6210(uint16 action) {
walkTo(Common::Point(757, 508), 4, true);
deferTownAction(408);
} else {
- execute6210(310);
+ dispatchCustomSceneAction(310);
}
break;
case 408:
- execute6210(307);
+ dispatchCustomSceneAction(307);
deferTownAction(310);
break;
case 310: // Refuse to take the plate.
@@ -146,4 +174,11 @@ RunawayRoomScene::ActionResult RunawayRoomScene::execute6210(uint16 action) {
return kHandled;
}
+void Scene6210::handleAnimationFrameHook() {
+ if (_roomAction == 410 && _actionStep == 8) {
+ _audio.playEffect(61, 204);
+ }
+}
+
+} // End of namespace Runaway
} // End of namespace Hollywood
diff --git a/engines/hollywood/runaway/scene6210.h b/engines/hollywood/runaway/scene6210.h
new file mode 100644
index 00000000000..aada20da44b
--- /dev/null
+++ b/engines/hollywood/runaway/scene6210.h
@@ -0,0 +1,47 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+
+#ifndef HOLLYWOOD_RUNAWAY_SCENE6210_H
+#define HOLLYWOOD_RUNAWAY_SCENE6210_H
+
+#include "hollywood/runaway/scene.h"
+
+namespace Hollywood {
+namespace Runaway {
+
+class Scene6210 : public RunawayRoomScene {
+public:
+ Scene6210(RunawayAudio &audio, RunawayInventory &inventory, const RunawayStrings &strings, RunawayGameType game);
+
+private:
+ void resumeAmbientAudio(bool entering) override;
+ void runCustomEntrySequence() override;
+ float actorHeight() const override;
+ void setupActorDepth(RunawayActor::RenderParams ¶ms) const override;
+ bool shouldApproachHotspot(byte id, bool use, byte item, bool approach) const override;
+ ActionResult dispatchCustomSceneAction(uint16 action) override;
+ void handleAnimationFrameHook() override;
+};
+
+} // End of namespace Runaway
+} // End of namespace Hollywood
+
+#endif // HOLLYWOOD_RUNAWAY_SCENE6210_H
diff --git a/engines/hollywood/runaway/scene6220.cpp b/engines/hollywood/runaway/scene6220.cpp
index cc726279d89..a840eb5e50a 100644
--- a/engines/hollywood/runaway/scene6220.cpp
+++ b/engines/hollywood/runaway/scene6220.cpp
@@ -19,9 +19,8 @@
*
*/
-
#include "common/util.h"
-#include "hollywood/runaway/scene.h"
+#include "hollywood/runaway/scene6220.h"
namespace Hollywood {
namespace {
@@ -64,7 +63,33 @@ const RunawayRoom kRunawayScene6220 = {
kResponses, ARRAYSIZE(kResponses), kItemActions, ARRAYSIZE(kItemActions), nullptr, 0
};
-void RunawayRoomScene::start6220() {
+namespace Runaway {
+
+Scene6220::Scene6220(RunawayAudio &audio, RunawayInventory &inventory, const RunawayStrings &strings, RunawayGameType game) :
+ RunawayRoomScene(audio, inventory, strings, game) {}
+
+bool Scene6220::loadCustomResources() {
+ return _sushiAnimation.load(_archive, 7, 170) && _brianAnimation.load(_archive, 8, 45) && _shotAnimation.load(_archive, 9, 60);
+}
+
+void Scene6220::applyCustomHotspotState() {
+ for (uint i = 0; i < 256; ++i) {
+ // The balcony shares this mask but is reached through Kevin's room.
+ if (_maps[i] < 2 || _maps[i] > 4) {
+ _maps[i] = 0;
+ }
+ }
+}
+
+void Scene6220::resumeAmbientAudio(bool entering) {
+ if (entering && _entryScene == 6223) {
+ _audio.playMusic(12 + _random.getRandomNumber(4));
+ } else {
+ RunawayRoomScene::resumeAmbientAudio(entering);
+ }
+}
+
+void Scene6220::runCustomEntrySequence() {
struct Entry {
int16 x, y, targetX, targetY;
byte facing;
@@ -86,7 +111,78 @@ void RunawayRoomScene::start6220() {
}
}
-RunawayRoomScene::ActionResult RunawayRoomScene::execute6220(uint16 action) {
+bool Scene6220::updateCustomSequence() {
+ if (_townEncounter.phase == TownEncounter::kInactive) {
+ return false;
+ }
+ updateEncounter();
+ return true;
+}
+
+void Scene6220::drawCustomBackgroundComposite(Graphics::ManagedSurface &viewport) {
+ if (_townEncounter.phase == TownEncounter::kInactive) {
+ return;
+ }
+ const uint frame = _townEncounter.frame;
+ uint sushi, brian, shot;
+ if (_townEncounter.phase == TownEncounter::kRifle) {
+ sushi = frame;
+ shot = frame < 45 ? 59 : MIN<uint>(59, frame - 45);
+ brian = frame <= 45 ? 0 : MIN<uint>(33, frame - 45);
+ } else if (_townEncounter.phase == TownEncounter::kConversation) {
+ sushi = 113 + (speaker() ? speechFrame() : 0);
+ shot = 59;
+ brian = 33;
+ } else {
+ sushi = 125 + frame;
+ shot = 59;
+ brian = MIN<uint>(44, 33 + frame);
+ }
+ _sushiAnimation.draw(viewport, sushi, _camera.x, -_camera.y);
+ _shotAnimation.draw(viewport, shot, _camera.x, -_camera.y);
+ _brianAnimation.draw(viewport, brian, _camera.x, -_camera.y);
+}
+
+bool Scene6220::shouldDrawActor() const {
+ return _townEncounter.phase == TownEncounter::kInactive;
+}
+
+float Scene6220::actorHeight() const {
+ return _position.y * 0.194835678f - 11.706573f;
+}
+
+void Scene6220::setupActorDepth(RunawayActor::RenderParams ¶ms) const {
+ params.depthY[1] = 263;
+ params.depthY[2] = 195;
+ params.depthY[3] = 490;
+ params.depthY[4] = 396;
+ params.depthY[5] = 227;
+ params.depthY[6] = 247;
+ params.depthY[7] = 599;
+ params.depthY[8] = 322;
+ params.depthY[9] = 599;
+}
+
+Common::U32String Scene6220::hotspotName(byte id) const {
+ if (id == 8 && _town.strapSeen == 1) {
+ return Common::U32String("Strap");
+ }
+ return RunawayRoomScene::hotspotName(id);
+}
+
+bool Scene6220::shouldApproachHotspot(byte id, bool use, byte item, bool approach) const {
+ if (id == 8) {
+ if (item && _town.strapSeen != 1) {
+ return false;
+ }
+ if (!item && use && _town.strapSeen == 1) {
+ return true;
+ }
+ }
+ return approach;
+}
+
+RunawayRoomScene::ActionResult Scene6220::dispatchCustomSceneAction(uint16 action) {
switch (action) {
case 302: // Leave town by the railroad tracks.
case 319: // Leave town toward the cemetery.
@@ -154,7 +250,13 @@ RunawayRoomScene::ActionResult RunawayRoomScene::execute6220(uint16 action) {
return kHandled;
}
-void RunawayRoomScene::update6220() {
+void Scene6220::handleAnimationFrameHook() {
+ if (_roomAction == 417 && _actionStep == 22) {
+ _audio.playEffect(17);
+ }
+}
+
+void Scene6220::updateEncounter() {
if (_townEncounter.phase == TownEncounter::kInactive) {
return;
}
@@ -192,28 +294,5 @@ void RunawayRoomScene::update6220() {
}
}
-void RunawayRoomScene::drawScene6220(Graphics::ManagedSurface &viewport) {
- if (_townEncounter.phase == TownEncounter::kInactive) {
- return;
- }
- const uint frame = _townEncounter.frame;
- uint sushi, brian, shot;
- if (_townEncounter.phase == TownEncounter::kRifle) {
- sushi = frame;
- shot = frame < 45 ? 59 : MIN<uint>(59, frame - 45);
- brian = frame <= 45 ? 0 : MIN<uint>(33, frame - 45);
- } else if (_townEncounter.phase == TownEncounter::kConversation) {
- sushi = 113 + (speaker() ? speechFrame() : 0);
- shot = 59;
- brian = 33;
- } else {
- sushi = 125 + frame;
- shot = 59;
- brian = MIN<uint>(44, 33 + frame);
- }
- _npc.draw(viewport, sushi, _camera.x, -_camera.y);
- _machine.draw(viewport, shot, _camera.x, -_camera.y);
- _npcMouth.draw(viewport, brian, _camera.x, -_camera.y);
-}
-
+} // End of namespace Runaway
} // End of namespace Hollywood
diff --git a/engines/hollywood/runaway/scene6220.h b/engines/hollywood/runaway/scene6220.h
new file mode 100644
index 00000000000..3f6058505b8
--- /dev/null
+++ b/engines/hollywood/runaway/scene6220.h
@@ -0,0 +1,63 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+
+#ifndef HOLLYWOOD_RUNAWAY_SCENE6220_H
+#define HOLLYWOOD_RUNAWAY_SCENE6220_H
+
+#include "hollywood/runaway/scene.h"
+
+namespace Hollywood {
+namespace Runaway {
+
+class Scene6220 : public RunawayRoomScene {
+public:
+ Scene6220(RunawayAudio &audio, RunawayInventory &inventory, const RunawayStrings &strings, RunawayGameType game);
+
+private:
+ bool loadCustomResources() override;
+ void applyCustomHotspotState() override;
+ void resumeAmbientAudio(bool entering) override;
+ void runCustomEntrySequence() override;
+ bool updateCustomSequence() override;
+ void drawCustomBackgroundComposite(Graphics::ManagedSurface &viewport) override;
+ bool shouldDrawActor() const override;
+ float actorHeight() const override;
+ void setupActorDepth(RunawayActor::RenderParams ¶ms) const override;
+ Common::U32String hotspotName(byte id) const override;
+ bool shouldApproachHotspot(byte id, bool use, byte item, bool approach) const override;
+ ActionResult dispatchCustomSceneAction(uint16 action) override;
+ void handleAnimationFrameHook() override;
+
+ void updateEncounter();
+
+ RunawayAnimation _sushiAnimation, _brianAnimation, _shotAnimation;
+ struct TownEncounter {
+ enum Phase { kInactive, kRifle, kConversation, kDeparture };
+ Phase phase = kInactive;
+ uint32 tick = 0;
+ uint frame = 0;
+ } _townEncounter;
+};
+
+} // End of namespace Runaway
+} // End of namespace Hollywood
+
+#endif // HOLLYWOOD_RUNAWAY_SCENE6220_H
diff --git a/engines/hollywood/runaway/scene6240.cpp b/engines/hollywood/runaway/scene6240.cpp
index 1f09f621f62..07c9541e108 100644
--- a/engines/hollywood/runaway/scene6240.cpp
+++ b/engines/hollywood/runaway/scene6240.cpp
@@ -19,9 +19,8 @@
*
*/
-
#include "common/util.h"
-#include "hollywood/runaway/scene.h"
+#include "hollywood/runaway/scene6240.h"
namespace Hollywood {
namespace {
@@ -63,7 +62,43 @@ const RunawayRoom kRunawayScene6240 = {
kResponses, ARRAYSIZE(kResponses), kItemActions, ARRAYSIZE(kItemActions), nullptr, 0
};
-void RunawayRoomScene::start6240() {
+namespace Runaway {
+
+Scene6240::Scene6240(RunawayAudio &audio, RunawayInventory &inventory, const RunawayStrings &strings, RunawayGameType game) :
+ RunawayRoomScene(audio, inventory, strings, game) {}
+
+bool Scene6240::usesAlternateActor() const {
+ return false;
+}
+
+bool Scene6240::loadCustomResources() {
+ if (!_plantAnimation.load(_archive, 4, 36)) {
+ return false;
+ }
+ for (uint i = 0; i < ARRAYSIZE(_plantPatches); ++i) {
+ if (!_archive.readVariableChunk(6 + i, _plantPatches[i])) {
+ return false;
+ }
+ }
+ return true;
+}
+
+bool Scene6240::applyCustomBackgroundPatches() {
+ return !_town.flowerPotTaken || applyPatch(9);
+}
+
+void Scene6240::applyCustomHotspotState() {
+ for (uint i = 0; i < 256; ++i) {
+ if (_maps[i] >= 6 && _maps[i] <= 8) {
+ _maps[i] = 0;
+ }
+ if (_maps[256 + i] == 3 && _town.flowerPotTaken) {
+ _maps[256 + i] = 0;
+ }
+ }
+}
+
+void Scene6240::runCustomEntrySequence() {
if (_entryScene == 6241) {
_position = Common::Point(782, 408);
_walkPath.reset(_position);
@@ -76,14 +111,48 @@ void RunawayRoomScene::start6240() {
}
}
-void RunawayRoomScene::drawForeground6240(Graphics::ManagedSurface &viewport) {
+void Scene6240::drawCustomBackgroundComposite(Graphics::ManagedSurface &viewport) {
+ _plantAnimation.draw(viewport, 0, _camera.x, -_camera.y);
+}
+
+void Scene6240::drawCustomForegroundComposite(Graphics::ManagedSurface &viewport) {
// The original moves these plants within the room before applying the camera.
- applyRunawayPatch(_saloonPatches[2], viewport, 0, 440 - _camera.x / 3 - _camera.x);
- applyRunawayPatch(_saloonPatches[1], viewport, 0, 800 - _camera.x / 4 - _camera.x);
- applyRunawayPatch(_saloonPatches[0], viewport, 0, 820 - _camera.x / 3 - _camera.x);
+ applyRunawayPatch(_plantPatches[2], viewport, 0, 440 - _camera.x / 3 - _camera.x);
+ applyRunawayPatch(_plantPatches[1], viewport, 0, 800 - _camera.x / 4 - _camera.x);
+ applyRunawayPatch(_plantPatches[0], viewport, 0, 820 - _camera.x / 3 - _camera.x);
}
-RunawayRoomScene::ActionResult RunawayRoomScene::execute6240(uint16 action) {
+float Scene6240::actorHeight() const {
+ return _position.y * 1.00515461f - 83.762886f;
+}
+
+void Scene6240::setupActorDepth(RunawayActor::RenderParams ¶ms) const {
+ params.depthY[1] = 599;
+ params.depthY[2] = 599;
+ params.depthY[3] = 351;
+ params.depthY[4] = 351;
+}
+
+Common::U32String Scene6240::hotspotName(byte id) const {
+ if (id == 5 && _town.gardeningShed) {
+ return Common::U32String("Gardening shed");
+ }
+ if (id == 7 && _town.carnivorousPlantSeen) {
+ return Common::U32String("Meat-eating plant");
+ }
+ return RunawayRoomScene::hotspotName(id);
+}
+
+void Scene6240::findWalkPath(Common::Point target) {
+ walkTown(target);
+}
+
+bool Scene6240::adjustCustomWalkTargetToFloorMask(Common::Point &target) const {
+ target.x = MIN<int>(target.x, 1510);
+ return false;
+}
+
+RunawayRoomScene::ActionResult Scene6240::dispatchCustomSceneAction(uint16 action) {
switch (action) {
case 302: // Return to the saloon porch.
leaveTownRoom(6181);
@@ -177,7 +246,7 @@ RunawayRoomScene::ActionResult RunawayRoomScene::execute6240(uint16 action) {
break;
case 314: // Refuse to take the carnivorous plant.
if (!_town.carnivorousPlantSeen) {
- execute6240(313);
+ dispatchCustomSceneAction(313);
}
say(12, _random.getRandomBit());
break;
@@ -191,4 +260,11 @@ RunawayRoomScene::ActionResult RunawayRoomScene::execute6240(uint16 action) {
return kHandled;
}
+void Scene6240::handleAnimationFrameHook() {
+ if (_roomAction == 304 && (_actionStep == 11 || _actionStep == 18)) {
+ _audio.playFootstep(3, _random.getRandomBit());
+ }
+}
+
+} // End of namespace Runaway
} // End of namespace Hollywood
diff --git a/engines/hollywood/runaway/scene6240.h b/engines/hollywood/runaway/scene6240.h
new file mode 100644
index 00000000000..e4b50f2bafc
--- /dev/null
+++ b/engines/hollywood/runaway/scene6240.h
@@ -0,0 +1,57 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+
+#ifndef HOLLYWOOD_RUNAWAY_SCENE6240_H
+#define HOLLYWOOD_RUNAWAY_SCENE6240_H
+
+#include "hollywood/runaway/scene.h"
+
+namespace Hollywood {
+namespace Runaway {
+
+class Scene6240 : public RunawayRoomScene {
+public:
+ Scene6240(RunawayAudio &audio, RunawayInventory &inventory, const RunawayStrings &strings, RunawayGameType game);
+
+private:
+ bool usesAlternateActor() const override;
+ bool loadCustomResources() override;
+ bool applyCustomBackgroundPatches() override;
+ void applyCustomHotspotState() override;
+ void runCustomEntrySequence() override;
+ void drawCustomBackgroundComposite(Graphics::ManagedSurface &viewport) override;
+ void drawCustomForegroundComposite(Graphics::ManagedSurface &viewport) override;
+ float actorHeight() const override;
+ void setupActorDepth(RunawayActor::RenderParams ¶ms) const override;
+ Common::U32String hotspotName(byte id) const override;
+ void findWalkPath(Common::Point target) override;
+ bool adjustCustomWalkTargetToFloorMask(Common::Point &target) const override;
+ ActionResult dispatchCustomSceneAction(uint16 action) override;
+ void handleAnimationFrameHook() override;
+
+ RunawayAnimation _plantAnimation;
+ Common::Array<byte> _plantPatches[3];
+};
+
+} // End of namespace Runaway
+} // End of namespace Hollywood
+
+#endif // HOLLYWOOD_RUNAWAY_SCENE6240_H
diff --git a/engines/hollywood/runaway/scene6260.cpp b/engines/hollywood/runaway/scene6260.cpp
index 56217be7477..b50130f93b7 100644
--- a/engines/hollywood/runaway/scene6260.cpp
+++ b/engines/hollywood/runaway/scene6260.cpp
@@ -19,9 +19,8 @@
*
*/
-
#include "common/util.h"
-#include "hollywood/runaway/scene.h"
+#include "hollywood/runaway/scene6260.h"
namespace Hollywood {
namespace {
@@ -62,7 +61,37 @@ const RunawayRoom kRunawayScene6260 = {
kResponses, ARRAYSIZE(kResponses), kItemActions, ARRAYSIZE(kItemActions), nullptr, 0
};
-void RunawayRoomScene::start6260() {
+namespace Runaway {
+
+Scene6260::Scene6260(RunawayAudio &audio, RunawayInventory &inventory, const RunawayStrings &strings, RunawayGameType game) :
+ RunawayRoomScene(audio, inventory, strings, game) {}
+
+bool Scene6260::usesAlternateActor() const {
+ return false;
+}
+
+bool Scene6260::loadCustomResources() {
+ return loadForeground(0, 6);
+}
+
+bool Scene6260::applyCustomBackgroundPatches() {
+ const bool keyVisible = _town.locomotiveKey == 1 || _town.locomotiveKey == 2;
+ return applyPatch(keyVisible ? 8 : 7);
+}
+
+void Scene6260::applyCustomHotspotState() {
+ for (uint i = 0; i < 256; ++i) {
+ // The upper zone is reserved for approaches to the cab and inlet.
+ if (_maps[i] == 2) {
+ _maps[i] = 0;
+ }
+ if (_maps[256 + i] == 5 && (_town.locomotiveKey == 0 || _town.locomotiveKey == 3)) {
+ _maps[256 + i] = 0;
+ }
+ }
+}
+
+void Scene6260::runCustomEntrySequence() {
if (_entryScene == 6261) {
beginRoomAnimation(401, 5, 88, nullptr, 0, true, 60);
} else if (_entryScene == 6262) {
@@ -81,24 +110,26 @@ void RunawayRoomScene::start6260() {
}
}
-bool RunawayRoomScene::applyBackground6260() {
- const bool keyVisible = _town.locomotiveKey == 1 || _town.locomotiveKey == 2;
- return applyPatch(keyVisible ? 8 : 7);
+void Scene6260::drawCustomForegroundComposite(Graphics::ManagedSurface &viewport) {
+ drawForeground(viewport, 0);
}
-void RunawayRoomScene::updateMaps6260() {
- for (uint i = 0; i < 256; ++i) {
- // The upper zone is reserved for approaches to the cab and inlet.
- if (_maps[i] == 2) {
- _maps[i] = 0;
- }
- if (_maps[256 + i] == 5 && (_town.locomotiveKey == 0 || _town.locomotiveKey == 3)) {
- _maps[256 + i] = 0;
- }
+float Scene6260::actorHeight() const {
+ return _position.y * 0.95f - 175;
+}
+
+bool Scene6260::shouldApproachHotspot(byte id, bool use, byte item, bool approach) const {
+ if (!item && id == 5 && !use && _town.locomotiveKey == 2) {
+ return false;
}
+ return approach;
+}
+
+void Scene6260::findWalkPath(Common::Point target) {
+ walkTown(target);
}
-RunawayRoomScene::ActionResult RunawayRoomScene::execute6260(uint16 action) {
+RunawayRoomScene::ActionResult Scene6260::dispatchCustomSceneAction(uint16 action) {
switch (action) {
case 302: // Return to the street.
leaveTownRoom(6225);
@@ -121,7 +152,7 @@ RunawayRoomScene::ActionResult RunawayRoomScene::execute6260(uint16 action) {
break;
case 310: // Pick up the cell key.
if (_town.locomotiveKey == 1) {
- execute6260(309);
+ dispatchCustomSceneAction(309);
}
deferTownAction(410);
break;
@@ -199,4 +230,21 @@ RunawayRoomScene::ActionResult RunawayRoomScene::execute6260(uint16 action) {
return kHandled;
}
+void Scene6260::handleAnimationFrameHook() {
+ if (_roomAction == 304 && _actionStep == 20) {
+ _audio.playEffect(20);
+ } else if (_roomAction == 401 && _actionStep == 32) {
+ _audio.playEffect(22);
+ } else if (_roomAction == 313 && _actionStep == 37) {
+ _audio.playEffect(21, 178);
+ } else if (_roomAction == 402) {
+ if (_actionStep == 3) {
+ _audio.playEffect(56, 230);
+ } else if (_actionStep == 17) {
+ _audio.playEffect(57, 255, 1);
+ }
+ }
+}
+
+} // End of namespace Runaway
} // End of namespace Hollywood
diff --git a/engines/hollywood/runaway/scene6260.h b/engines/hollywood/runaway/scene6260.h
new file mode 100644
index 00000000000..5791b8fc8f9
--- /dev/null
+++ b/engines/hollywood/runaway/scene6260.h
@@ -0,0 +1,51 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+
+#ifndef HOLLYWOOD_RUNAWAY_SCENE6260_H
+#define HOLLYWOOD_RUNAWAY_SCENE6260_H
+
+#include "hollywood/runaway/scene.h"
+
+namespace Hollywood {
+namespace Runaway {
+
+class Scene6260 : public RunawayRoomScene {
+public:
+ Scene6260(RunawayAudio &audio, RunawayInventory &inventory, const RunawayStrings &strings, RunawayGameType game);
+
+private:
+ bool usesAlternateActor() const override;
+ bool loadCustomResources() override;
+ bool applyCustomBackgroundPatches() override;
+ void applyCustomHotspotState() override;
+ void runCustomEntrySequence() override;
+ void drawCustomForegroundComposite(Graphics::ManagedSurface &viewport) override;
+ float actorHeight() const override;
+ bool shouldApproachHotspot(byte id, bool use, byte item, bool approach) const override;
+ void findWalkPath(Common::Point target) override;
+ ActionResult dispatchCustomSceneAction(uint16 action) override;
+ void handleAnimationFrameHook() override;
+};
+
+} // End of namespace Runaway
+} // End of namespace Hollywood
+
+#endif // HOLLYWOOD_RUNAWAY_SCENE6260_H
diff --git a/engines/hollywood/runaway/scene6263.cpp b/engines/hollywood/runaway/scene6263.cpp
index c5978243d46..594e930f295 100644
--- a/engines/hollywood/runaway/scene6263.cpp
+++ b/engines/hollywood/runaway/scene6263.cpp
@@ -19,9 +19,8 @@
*
*/
-
#include "common/util.h"
-#include "hollywood/runaway/scene.h"
+#include "hollywood/runaway/scene6263.h"
namespace Hollywood {
namespace {
@@ -75,8 +74,25 @@ const RunawayRoom kRunawayScene6263 = {
kResponses, ARRAYSIZE(kResponses), kItemActions, ARRAYSIZE(kItemActions), nullptr, 0
};
-bool RunawayRoomScene::loadScene6263() {
- if (!_ambient.load(_archive, 30, 101) || !_overlay.load(_archive, 27, 1)) {
+namespace Runaway {
+
+Scene6263::Scene6263(RunawayAudio &audio, RunawayInventory &inventory, const RunawayStrings &strings, RunawayGameType game) :
+ RunawayRoomScene(audio, inventory, strings, game) {}
+
+bool Scene6263::usesAlternateActor() const {
+ return false;
+}
+
+bool Scene6263::loadWalkMap() {
+ return loadRunawayMask(_archive, 1024, 600, _mask, _originalMaps, 21);
+}
+
+bool Scene6263::loadBackground() {
+ return loadRunawaySurface(_archive, 20, 1024, 600, _background);
+}
+
+bool Scene6263::loadCustomResources() {
+ if (!_boilerAnimation.load(_archive, 30, 101) || !_leverAnimation.load(_archive, 27, 1)) {
return false;
}
for (uint i = 0; i < ARRAYSIZE(_locomotiveGauges); ++i) {
@@ -87,9 +103,9 @@ bool RunawayRoomScene::loadScene6263() {
return true;
}
-void RunawayRoomScene::resume6263() {
- _ambientFrame = _town.boiler >= 2 ? 41 : 0;
- _ambientTick = _now;
+void Scene6263::prepareCustomGameplayLoop() {
+ _boilerFrame = _town.boiler >= 2 ? 41 : 0;
+ _boilerTick = _now;
if (_town.boiler >= 2) {
_audio.playEffect(53, 178, 1, true);
}
@@ -103,20 +119,20 @@ void RunawayRoomScene::resume6263() {
}
}
-void RunawayRoomScene::update6263() {
- if (_town.boiler < 2 || _now - _ambientTick < 80) {
+void Scene6263::advanceCustomGameplayLoop(uint32 delta) {
+ if (_town.boiler < 2 || _now - _boilerTick < 80) {
return;
}
- _ambientTick = _now;
- _ambientFrame = _ambientFrame < 40 ? _ambientFrame + 1 : 41 + _random.getRandomNumber(59);
+ _boilerTick = _now;
+ _boilerFrame = _boilerFrame < 40 ? _boilerFrame + 1 : 41 + _random.getRandomNumber(59);
for (uint i = 0; i < 4; i += 3) {
const int step = _random.getRandomBit() ? 1 : -1;
_locomotiveGaugeFrames[i] = CLIP<int>(_locomotiveGaugeFrames[i] + step, 0, 30);
}
}
-void RunawayRoomScene::drawScene6263(Graphics::ManagedSurface &viewport) {
- _ambient.draw(viewport, _ambientFrame, 0, 0);
+void Scene6263::drawCustomBackgroundComposite(Graphics::ManagedSurface &viewport) {
+ _boilerAnimation.draw(viewport, _boilerFrame, 0, 0);
_locomotiveGaugeFrames[1] = _town.boiler == 3 ? 30 : _town.boiler == 2 ? 15 : 0;
_locomotiveGaugeFrames[2] = _town.waterTank * 6;
if (drawingRoomAnimation()) {
@@ -130,11 +146,29 @@ void RunawayRoomScene::drawScene6263(Graphics::ManagedSurface &viewport) {
_locomotiveGauges[i].draw(viewport, _locomotiveGaugeFrames[i], 0, 0);
}
if (!drawingRoomAnimation() || (_roomAction != 306 && _roomAction != 308 && _roomAction != 401)) {
- _overlay.draw(viewport, 0, 0, 0);
+ _leverAnimation.draw(viewport, 0, 0, 0);
}
}
-RunawayRoomScene::ActionResult RunawayRoomScene::execute6263(uint16 action) {
+float Scene6263::actorHeight() const {
+ return _position.y * 1.04838705f - 175.645157f;
+}
+
+void Scene6263::setupActorDepth(RunawayActor::RenderParams ¶ms) const {
+ params.depthY[1] = 599;
+}
+
+Common::U32String Scene6263::hotspotName(byte id) const {
+ if (id == 3 && _town.steamLever) {
+ return Common::U32String("Steam outlet lever");
+ }
+ if (id == 4 && _town.pressureWheel) {
+ return Common::U32String("Pressure wheel");
+ }
+ return RunawayRoomScene::hotspotName(id);
+}
+
+RunawayRoomScene::ActionResult Scene6263::dispatchCustomSceneAction(uint16 action) {
switch (action) {
case 302: // Climb back out through the window.
if (!_town.cabExited) {
@@ -160,7 +194,7 @@ RunawayRoomScene::ActionResult RunawayRoomScene::execute6263(uint16 action) {
break;
case 306: // Release steam, if the boiler has enough pressure.
if (!_town.steamLever) {
- execute6263(305);
+ dispatchCustomSceneAction(305);
}
beginRoomAnimation(306, 26, 64, kSteamLeverFrames,
_town.boiler == 3 && !_town.locomotiveKey ? 41 : ARRAYSIZE(kSteamLeverFrames), true, 60);
@@ -180,7 +214,7 @@ RunawayRoomScene::ActionResult RunawayRoomScene::execute6263(uint16 action) {
break;
case 308: // Increase the boiler pressure once.
if (!_town.pressureWheel) {
- execute6263(307);
+ dispatchCustomSceneAction(307);
}
if (_town.boiler == 2) {
say(28, 1);
@@ -255,23 +289,7 @@ RunawayRoomScene::ActionResult RunawayRoomScene::execute6263(uint16 action) {
return kHandled;
}
-void RunawayRoomScene::locomotiveAnimationFrame() {
- if (_room == 6260) {
- if (_roomAction == 304 && _actionStep == 20) {
- _audio.playEffect(20);
- } else if (_roomAction == 401 && _actionStep == 32) {
- _audio.playEffect(22);
- } else if (_roomAction == 313 && _actionStep == 37) {
- _audio.playEffect(21, 178);
- } else if (_roomAction == 402) {
- if (_actionStep == 3) {
- _audio.playEffect(56, 230);
- } else if (_actionStep == 17) {
- _audio.playEffect(57, 255, 1);
- }
- }
- return;
- }
+void Scene6263::handleAnimationFrameHook() {
if (_roomAction == 400 && _actionStep == 13) {
_audio.playEffect(23, 204);
} else if (_roomAction == 302 && _actionStep == 10) {
@@ -292,8 +310,8 @@ void RunawayRoomScene::locomotiveAnimationFrame() {
_audio.playEffect(52, 255, 0, true);
} else if (_actionStep == 35) {
_town.boiler = 2;
- _ambientFrame = 0;
- _ambientTick = _now;
+ _boilerFrame = 0;
+ _boilerTick = _now;
_audio.playEffect(53, 178, 1, true);
} else if (_actionStep == 70) {
_audio.stopEffect(0);
@@ -301,4 +319,5 @@ void RunawayRoomScene::locomotiveAnimationFrame() {
}
}
+} // End of namespace Runaway
} // End of namespace Hollywood
diff --git a/engines/hollywood/runaway/scene6263.h b/engines/hollywood/runaway/scene6263.h
new file mode 100644
index 00000000000..0a14c0b48f5
--- /dev/null
+++ b/engines/hollywood/runaway/scene6263.h
@@ -0,0 +1,58 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+
+#ifndef HOLLYWOOD_RUNAWAY_SCENE6263_H
+#define HOLLYWOOD_RUNAWAY_SCENE6263_H
+
+#include "hollywood/runaway/scene.h"
+
+namespace Hollywood {
+namespace Runaway {
+
+class Scene6263 : public RunawayRoomScene {
+public:
+ Scene6263(RunawayAudio &audio, RunawayInventory &inventory, const RunawayStrings &strings, RunawayGameType game);
+
+private:
+ bool usesAlternateActor() const override;
+ bool loadWalkMap() override;
+ bool loadBackground() override;
+ bool loadCustomResources() override;
+ void prepareCustomGameplayLoop() override;
+ void advanceCustomGameplayLoop(uint32 delta) override;
+ void drawCustomBackgroundComposite(Graphics::ManagedSurface &viewport) override;
+ float actorHeight() const override;
+ void setupActorDepth(RunawayActor::RenderParams ¶ms) const override;
+ Common::U32String hotspotName(byte id) const override;
+ ActionResult dispatchCustomSceneAction(uint16 action) override;
+ void handleAnimationFrameHook() override;
+
+ RunawayAnimation _boilerAnimation, _leverAnimation;
+ RunawayAnimation _locomotiveGauges[4];
+ byte _locomotiveGaugeFrames[4] = {};
+ byte _boilerFrame = 0;
+ uint32 _boilerTick = 0;
+};
+
+} // End of namespace Runaway
+} // End of namespace Hollywood
+
+#endif // HOLLYWOOD_RUNAWAY_SCENE6263_H
diff --git a/engines/hollywood/runaway/scene6350.cpp b/engines/hollywood/runaway/scene6350.cpp
index 1cb8714dd93..88b3956d42d 100644
--- a/engines/hollywood/runaway/scene6350.cpp
+++ b/engines/hollywood/runaway/scene6350.cpp
@@ -19,11 +19,10 @@
*
*/
-
#include "common/file.h"
#include "common/textconsole.h"
#include "common/util.h"
-#include "hollywood/runaway/scene.h"
+#include "hollywood/runaway/scene6350.h"
namespace Hollywood {
namespace {
@@ -45,180 +44,75 @@ const RunawayRoom kRunawayScene6350 = {
Common::Point(512, 500), nullptr, 0, nullptr, 0, nullptr, 0
};
-void RunawayRoomScene::resumeTown() {
- prepareCustomGameplayLoop();
- if (!_entering) {
- resumeAmbientAudio(false);
- return;
- }
- _entering = false;
- if (_room == 6350 && !_town.arrived) {
- startTownFilm(1);
- return;
- }
- _town.arrived = 1;
- resumeAmbientAudio(true);
- runCustomEntrySequence();
-}
+namespace Runaway {
-void RunawayRoomScene::prepareCustomGameplayLoop() {
- _oscarTick = _now;
- _saloonDoorTick = _now;
- _saloonDoorFrame = _position.x > 726 ? 7 : 0;
- if (_room == 6263) {
- resume6263();
- }
+Scene6350::Scene6350(RunawayAudio &audio, RunawayInventory &inventory, const RunawayStrings &strings, RunawayGameType game) :
+ RunawayRoomScene(audio, inventory, strings, game) {}
+
+bool Scene6350::usesAlternateActor() const {
+ return false;
}
-void RunawayRoomScene::resumeAmbientAudio(bool entering) {
- if (!entering) {
- if (!_audio.musicPlaying()) {
- _audio.playMusic(_room == 6200 || _room == 6210 ? 18 : 11);
- if (_room == 6200 || _room == 6210) {
- _audio.setMusicVolume(191);
- }
- }
- return;
- }
- if (_room == 6200 || _room == 6210) {
- if (_entryScene == 6200 || !_audio.musicPlaying()) {
- _audio.playMusic(18);
- }
- _audio.setMusicVolume(191);
- } else if (_entryScene == 6223) {
- _audio.playMusic(12 + _random.getRandomNumber(4));
- } else if (!_audio.musicPlaying()) {
- _audio.playMusic(11);
- }
+bool Scene6350::applyCustomBackgroundPatches() {
+ return !_town.arrived || (applyPatch(5) && applyPatch(7));
}
-void RunawayRoomScene::runCustomEntrySequence() {
- if (_room == 6014) {
- execute6014(400);
- } else if (_room == 6080) {
- start6080();
- } else if (_room == 6090) {
- start6090();
- } else if (_room == 6130) {
- start6130();
- } else if (_room == 6180) {
- start6180();
- } else if (_room == 6190) {
- start6190();
- } else if (_room == 6200) {
- start6200();
- } else if (_room == 6210) {
- start6210();
- } else if (_room == 6220) {
- start6220();
- } else if (_room == 6240) {
- start6240();
- } else if (_room == 6260) {
- start6260();
- } else if (_room == 6370) {
- _town.streetVisited = 1;
- start6370();
+void Scene6350::applyCustomHotspotState() {
+ for (uint i = 0; i < 256; ++i) {
+ // The route to the Hopi village has not been discovered yet.
+ if (_maps[256 + i] == 5) {
+ _maps[256 + i] = 0;
+ }
}
}
-void RunawayRoomScene::advanceCustomGameplayLoop(uint32 delta) {
- if (_room == 6180) {
- update6180();
- }
- if (_room == 6090 || _room == 6130) {
- updateOscar();
- }
- if (_room == 6263) {
- update6263();
+void Scene6350::resume() {
+ if (_entering && !_town.arrived) {
+ _entering = false;
+ startTownFilm(1);
+ return;
}
+ RunawayRoomScene::resume();
}
-void RunawayRoomScene::updateTown(uint32 delta) {
- advanceCustomGameplayLoop(delta);
- if (_townEncounter.phase != TownEncounter::kInactive) {
- update6220();
+void Scene6350::finishCustomFilm() {
+ if (_townFilm == 1) {
+ startTownFilm(2);
return;
}
- updateRoomAnimation();
- updateConversation();
- if (_roomAction && _actionFrames.empty() && !speaking() && !_walkPath.active()) {
- const uint16 action = _roomAction;
- _roomAction = 0;
- execute(action);
- }
- if (_hospitalExit.scene && !speaking() && !_roomAction && !_walkPath.active()) {
- _transition = _hospitalExit;
+ _townFilm = 0;
+ _town.arrived = 1;
+ if (!rebuildBackground()) {
+ error("Cannot update Runaway chapter 4 map");
}
+ _audio.playMusic(11);
+ say(0);
+ leaveTownRoom(6220);
}
-void RunawayRoomScene::walkTown(Common::Point target) {
- if (!_pendingHotspot) {
- // Clicks stay on the ground; hotspot approaches may use the reserved zones.
- target.x = CLIP<int>(target.x, 0, _room == 6080 ? 1152 : _background.w - 1);
- target.y = CLIP<int>(target.y, 0, _background.h - 1);
- if (_room == 6180) {
- if (_originalMaps[_mask[target.y * _background.w + target.x]] == 3) {
- _walkPath.findPath(RunawayWalkMap(_background.w, _background.h, _mask, _originalMaps), target);
- return;
- }
- target.x = CLIP<int>(target.x, 202, 679);
- } else if (_room == 6240) {
- target.x = MIN<int>(target.x, 1510);
- }
- while (target.y < _background.h - 1 && !_maps[_mask[target.y * _background.w + target.x]]) {
- ++target.y;
- }
- while (target.y > 0 && !_maps[_mask[target.y * _background.w + target.x]]) {
- --target.y;
- }
- }
- _walkPath.findPath(RunawayWalkMap(_background.w, _background.h, _mask, _originalMaps), target);
+bool Scene6350::drawCustomComposite(Graphics::ManagedSurface &viewport) {
+ return true;
}
-void RunawayRoomScene::deferTownAction(uint16 action) {
- _roomAction = action;
- _actionFrames.clear();
+bool Scene6350::shouldUpdateActor() const {
+ return false;
}
-void RunawayRoomScene::townAnimationFrame() {
- if (_room == 6220 && _roomAction == 417 && _actionStep == 22) {
- _audio.playEffect(17);
- } else if (_room == 6240 && _roomAction == 304 && (_actionStep == 11 || _actionStep == 18)) {
- _audio.playFootstep(3, _random.getRandomBit());
- }
- if (_room == 6080) {
- mineAnimationFrame();
- return;
- }
- if (_room == 6260 || _room == 6263) {
- locomotiveAnimationFrame();
- return;
+Common::U32String Scene6350::hotspotName(byte id) const {
+ if (id == 2 && _town.arrived) {
+ return Common::U32String("Douglasville");
}
- if (_room == 6200 && _roomAction == 314) {
- if (_actionStep == 13) {
- _audio.playEffect(58);
- } else if (_actionStep == 22) {
- _audio.playEffect(59);
- }
- } else if (_room == 6210 && _roomAction == 410 && _actionStep == 8) {
- _audio.playEffect(61, 204);
- } else if (_room == 6370 && _roomAction == 401 && _actionStep == 24) {
- _audio.playEffect(12);
+ if (id == 3 && _town.houseVisited) {
+ return Common::U32String("Mama Dorita's house");
}
+ return RunawayRoomScene::hotspotName(id);
}
-void RunawayRoomScene::leaveTownRoom(uint16 scene) {
- const RunawayRoom *room = findRunawayRoom(scene);
- if (!room) {
- warning("Runaway: scene %u is not implemented yet", scene);
- return;
- }
- _hospitalExit.scene = scene;
- _hospitalExit.position = room->entry;
- _hospitalExit.facing = 3;
+bool Scene6350::shouldPlayGameplayClickPath() const {
+ return false;
}
-RunawayRoomScene::ActionResult RunawayRoomScene::execute6350(uint16 action) {
+RunawayRoomScene::ActionResult Scene6350::dispatchCustomSceneAction(uint16 action) {
switch (action) {
case 1: // Looking at the overview does not start a speech.
break;
@@ -243,11 +137,11 @@ RunawayRoomScene::ActionResult RunawayRoomScene::execute6350(uint16 action) {
return kHandled;
}
-void RunawayRoomScene::startTownFilm(byte film) {
+void Scene6350::startTownFilm(byte film) {
typedef RunawaySequence S;
_townFilm = film;
const bool gog = Common::File::exists("DATAVC00.000");
- _filmCommands.clear();
+ _townFilmCommands.clear();
// GOG moved the animated portraits out of the main films, changing the
// frame numbers after each conversation. Keep both releases' cue points.
if (film == 1) {
@@ -299,7 +193,7 @@ void RunawayRoomScene::startTownFilm(byte film) {
{S::kEnd}
};
for (uint i = 0; i < ARRAYSIZE(commands); ++i)
- _filmCommands.push_back(commands[i]);
+ _townFilmCommands.push_back(commands[i]);
} else {
const S::Command commands[] = {
{S::kOpen, 2},
@@ -354,24 +248,10 @@ void RunawayRoomScene::startTownFilm(byte film) {
{S::kEnd}
};
for (uint i = 0; i < ARRAYSIZE(commands); ++i)
- _filmCommands.push_back(commands[i]);
+ _townFilmCommands.push_back(commands[i]);
}
- _sequence.start(_filmCommands.data(), _text, _now, 'F');
-}
-
-void RunawayRoomScene::finishTownFilm() {
- if (_townFilm == 1) {
- startTownFilm(2);
- return;
- }
- _townFilm = 0;
- _town.arrived = 1;
- if (!rebuildBackground()) {
- error("Cannot update Runaway chapter 4 map");
- }
- _audio.playMusic(11);
- say(0);
- leaveTownRoom(6220);
+ _sequence.start(_townFilmCommands.data(), _text, _now, 'F');
}
+} // End of namespace Runaway
} // End of namespace Hollywood
diff --git a/engines/hollywood/runaway/scene6350.h b/engines/hollywood/runaway/scene6350.h
new file mode 100644
index 00000000000..99f1a446e99
--- /dev/null
+++ b/engines/hollywood/runaway/scene6350.h
@@ -0,0 +1,55 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+
+#ifndef HOLLYWOOD_RUNAWAY_SCENE6350_H
+#define HOLLYWOOD_RUNAWAY_SCENE6350_H
+
+#include "hollywood/runaway/scene.h"
+
+namespace Hollywood {
+namespace Runaway {
+
+class Scene6350 : public RunawayRoomScene {
+public:
+ Scene6350(RunawayAudio &audio, RunawayInventory &inventory, const RunawayStrings &strings, RunawayGameType game);
+ void resume() override;
+
+private:
+ bool usesAlternateActor() const override;
+ bool applyCustomBackgroundPatches() override;
+ void applyCustomHotspotState() override;
+ void finishCustomFilm() override;
+ bool drawCustomComposite(Graphics::ManagedSurface &viewport) override;
+ bool shouldUpdateActor() const override;
+ Common::U32String hotspotName(byte id) const override;
+ bool shouldPlayGameplayClickPath() const override;
+ ActionResult dispatchCustomSceneAction(uint16 action) override;
+
+ void startTownFilm(byte film);
+
+ byte _townFilm = 0;
+ Common::Array<RunawaySequence::Command> _townFilmCommands;
+};
+
+} // End of namespace Runaway
+} // End of namespace Hollywood
+
+#endif // HOLLYWOOD_RUNAWAY_SCENE6350_H
diff --git a/engines/hollywood/runaway/scene6370.cpp b/engines/hollywood/runaway/scene6370.cpp
index e2ca4528dac..2614e26d0ee 100644
--- a/engines/hollywood/runaway/scene6370.cpp
+++ b/engines/hollywood/runaway/scene6370.cpp
@@ -19,9 +19,8 @@
*
*/
-
#include "common/util.h"
-#include "hollywood/runaway/scene.h"
+#include "hollywood/runaway/scene6370.h"
namespace Hollywood {
@@ -31,19 +30,59 @@ const RunawayRoom kRunawayScene6370 = {
Common::Point(1443, 648), nullptr, 0, nullptr, 0, nullptr, 0
};
-void RunawayRoomScene::start6370() {
- _willyPose = 0;
+namespace Runaway {
+
+Scene6370::Scene6370(RunawayAudio &audio, RunawayInventory &inventory, const RunawayStrings &strings, RunawayGameType game) :
+ RunawayRoomScene(audio, inventory, strings, game) {}
+
+bool Scene6370::usesAlternateActor() const {
+ return false;
+}
+
+bool Scene6370::loadCustomResources() {
+ return _sushiAnimation.load(_archive, 4, 88) && _computerAnimation.load(_archive, 5, 20);
+}
+
+void Scene6370::runCustomEntrySequence() {
+ _town.streetVisited = 1;
+ _sushiPose = 0;
walkTo(Common::Point(1292, 689), 7, true);
deferTownAction(401);
}
-RunawayRoomScene::ActionResult RunawayRoomScene::execute6370(uint16 action) {
+void Scene6370::drawCustomBackgroundComposite(Graphics::ManagedSurface &viewport) {
+ _computerAnimation.draw(viewport, (_now / 80) % 20, _camera.x, -_camera.y);
+ if (!drawingRoomAnimation()) {
+ uint frame = _sushiPose;
+ if (_sushiPose == 79) {
+ frame += MIN<uint>(8, (_now - _sushiTick) / 80);
+ } else if (_sushiPose == 63 && speaker()) {
+ frame += speechFrame();
+ }
+ _sushiAnimation.draw(viewport, frame, _camera.x, -_camera.y);
+ }
+}
+
+float Scene6370::actorHeight() const {
+ return _position.y * 0.634920657f - 221.190475f;
+}
+
+void Scene6370::setupActorDepth(RunawayActor::RenderParams ¶ms) const {
+ params.depthY[1] = 800;
+ params.depthY[2] = 646;
+ params.depthY[3] = 400;
+ params.depthY[4] = 800;
+ params.depthY[5] = 645;
+ params.depthY[6] = 684;
+}
+
+RunawayRoomScene::ActionResult Scene6370::dispatchCustomSceneAction(uint16 action) {
switch (action) {
case 401: // Sushi turns away from her computer.
beginRoomAnimationRange(401, 4, 88, 0, 63, false);
break;
case 1401: // Introduce Brian or greet him on a return visit.
- _willyPose = 63;
+ _sushiPose = 63;
if (!_town.sushiMet) {
say(90, 0, false, 1);
say(80, 1);
@@ -67,8 +106,8 @@ RunawayRoomScene::ActionResult RunawayRoomScene::execute6370(uint16 action) {
case 403: // Finish the conversation and return to the street.
_town.sushiMet = 1;
_audio.playMusic(20);
- _willyPose = 79;
- _ambientTick = _now;
+ _sushiPose = 79;
+ _sushiTick = _now;
walkTo(Common::Point(1443, 648), 1, true);
leaveTownRoom(6222);
break;
@@ -78,20 +117,29 @@ RunawayRoomScene::ActionResult RunawayRoomScene::execute6370(uint16 action) {
return kHandled;
}
-void RunawayRoomScene::drawScene6370(Graphics::ManagedSurface &viewport) {
- _ambient.draw(viewport, (_now / 80) % 20, _camera.x, -_camera.y);
- if (!drawingRoomAnimation()) {
- uint frame = _willyPose;
- if (_willyPose == 79) {
- frame += MIN<uint>(8, (_now - _ambientTick) / 80);
- } else if (_willyPose == 63 && speaker()) {
- frame += speechFrame();
- }
- _npc.draw(viewport, frame, _camera.x, -_camera.y);
+void Scene6370::handleAnimationFrameHook() {
+ if (_roomAction == 401 && _actionStep == 24) {
+ _audio.playEffect(12);
+ }
+}
+
+void Scene6370::handleCustomDialogueChoice(byte effect) {
+ if (effect == 2) { // Ask Sushi to repeat Douglasville's history.
+ say(90, 6, false, 1);
+ say(80, 7);
+ say(90, 7, false, 1);
+ say(80, 8);
+ say(90, 8, false, 1);
+ } else if (effect == 3) { // Learn where a map of the mine might be kept.
+ _town.mineMapKnown = 1;
+ } else if (effect == 4) { // Learn that the bank's safe is in its basement.
+ _town.basementKnown = 1;
+ } else if (effect == 10) { // Identify the prisoner as Douglasville's doctor.
+ _town.doctorKnown = 1;
}
}
-void RunawayRoomScene::startSushiConversation(bool introduction) {
+void Scene6370::startSushiConversation(bool introduction) {
_conversation = 5;
_dialogueDepth = _dialogueNode = _dialogueIntro = 0;
_dialogueEnding = false;
@@ -131,20 +179,5 @@ void RunawayRoomScene::startSushiConversation(bool introduction) {
_dialogue[12][1].enabled = _town.safeSeen;
}
-void RunawayRoomScene::sushiDialogueChoice(byte effect) {
- if (effect == 2) { // Ask Sushi to repeat Douglasville's history.
- say(90, 6, false, 1);
- say(80, 7);
- say(90, 7, false, 1);
- say(80, 8);
- say(90, 8, false, 1);
- } else if (effect == 3) { // Learn where a map of the mine might be kept.
- _town.mineMapKnown = 1;
- } else if (effect == 4) { // Learn that the bank's safe is in its basement.
- _town.basementKnown = 1;
- } else if (effect == 10) { // Identify the prisoner as Douglasville's doctor.
- _town.doctorKnown = 1;
- }
-}
-
+} // End of namespace Runaway
} // End of namespace Hollywood
diff --git a/engines/hollywood/runaway/scene6370.h b/engines/hollywood/runaway/scene6370.h
new file mode 100644
index 00000000000..b4942d1f753
--- /dev/null
+++ b/engines/hollywood/runaway/scene6370.h
@@ -0,0 +1,55 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+
+#ifndef HOLLYWOOD_RUNAWAY_SCENE6370_H
+#define HOLLYWOOD_RUNAWAY_SCENE6370_H
+
+#include "hollywood/runaway/scene.h"
+
+namespace Hollywood {
+namespace Runaway {
+
+class Scene6370 : public RunawayRoomScene {
+public:
+ Scene6370(RunawayAudio &audio, RunawayInventory &inventory, const RunawayStrings &strings, RunawayGameType game);
+
+private:
+ bool usesAlternateActor() const override;
+ bool loadCustomResources() override;
+ void runCustomEntrySequence() override;
+ void drawCustomBackgroundComposite(Graphics::ManagedSurface &viewport) override;
+ float actorHeight() const override;
+ void setupActorDepth(RunawayActor::RenderParams ¶ms) const override;
+ ActionResult dispatchCustomSceneAction(uint16 action) override;
+ void handleAnimationFrameHook() override;
+ void handleCustomDialogueChoice(byte effect) override;
+
+ void startSushiConversation(bool introduction);
+
+ RunawayAnimation _sushiAnimation, _computerAnimation;
+ byte _sushiPose = 54;
+ uint32 _sushiTick = 0;
+};
+
+} // End of namespace Runaway
+} // End of namespace Hollywood
+
+#endif // HOLLYWOOD_RUNAWAY_SCENE6370_H
diff --git a/engines/hollywood/runaway/scene_registry.cpp b/engines/hollywood/runaway/scene_registry.cpp
new file mode 100644
index 00000000000..8e7672f2a4e
--- /dev/null
+++ b/engines/hollywood/runaway/scene_registry.cpp
@@ -0,0 +1,153 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+
+#include "common/util.h"
+#include "hollywood/runaway/scene_registry.h"
+#include "hollywood/runaway/scene6014.h"
+#include "hollywood/runaway/scene6080.h"
+#include "hollywood/runaway/scene6090.h"
+#include "hollywood/runaway/scene6130.h"
+#include "hollywood/runaway/scene6180.h"
+#include "hollywood/runaway/scene6190.h"
+#include "hollywood/runaway/scene6200.h"
+#include "hollywood/runaway/scene6210.h"
+#include "hollywood/runaway/scene6220.h"
+#include "hollywood/runaway/scene6240.h"
+#include "hollywood/runaway/scene6260.h"
+#include "hollywood/runaway/scene6263.h"
+#include "hollywood/runaway/scene6270.h"
+#include "hollywood/runaway/scene6290.h"
+#include "hollywood/runaway/scene6350.h"
+#include "hollywood/runaway/scene6370.h"
+
+namespace Hollywood {
+namespace {
+
+typedef RunawayScene *(*SceneFactory)(RunawayAudio &, RunawayInventory &, const RunawayStrings &, RunawayGameType);
+
+struct SceneDefinition {
+ const RunawayRoom *room;
+ SceneFactory create;
+};
+
+template<class Scene>
+RunawayScene *createScene(RunawayAudio &audio, RunawayInventory &inventory, const RunawayStrings &strings, RunawayGameType game) {
+ return new Scene(audio, inventory, strings, game);
+}
+
+const SceneDefinition kSceneDefinitions[] = {
+ {&kRunawayScene2020, createScene<RunawayRoomScene>},
+ {&kRunawayScene2060, createScene<RunawayRoomScene>},
+ {&kRunawayScene2080, createScene<RunawayRoomScene>},
+ {&kRunawayScene4030, createScene<RunawayRoomScene>},
+ {&kRunawayScene4050, createScene<RunawayRoomScene>},
+ {&kRunawayScene4060, createScene<RunawayRoomScene>},
+ {&kRunawayScene4070, createScene<RunawayRoomScene>},
+ {&kRunawayScene4090, createScene<RunawayRoomScene>},
+ {&kRunawayScene4100, createScene<RunawayRoomScene>},
+ {&kRunawayScene4140, createScene<RunawayRoomScene>},
+ {&kRunawayScene5010, createScene<RunawayRoomScene>},
+ {&kRunawayScene5020, createScene<RunawayRoomScene>},
+ {&kRunawayScene5050, createScene<RunawayRoomScene>},
+ {&kRunawayScene5060, createScene<RunawayRoomScene>},
+ {&kRunawayScene5070, createScene<RunawayRoomScene>},
+ {&kRunawayScene5080, createScene<RunawayRoomScene>},
+ {&kRunawayScene5100, createScene<RunawayRoomScene>},
+ {&kRunawayScene5110, createScene<RunawayRoomScene>},
+ {&kRunawayScene5130, createScene<RunawayRoomScene>},
+ {&kRunawayScene5140, createScene<RunawayRoomScene>},
+ {&kRunawayScene5160, createScene<RunawayRoomScene>},
+ {&kRunawayScene5170, createScene<RunawayRoomScene>},
+ {&kRunawayScene6014, createScene<Runaway::Scene6014>},
+ {&kRunawayScene6080, createScene<Runaway::Scene6080>},
+ {&kRunawayScene6090, createScene<Runaway::Scene6090>},
+ {&kRunawayScene6130, createScene<Runaway::Scene6130>},
+ {&kRunawayScene6180, createScene<Runaway::Scene6180>},
+ {&kRunawayScene6190, createScene<Runaway::Scene6190>},
+ {&kRunawayScene6200, createScene<Runaway::Scene6200>},
+ {&kRunawayScene6210, createScene<Runaway::Scene6210>},
+ {&kRunawayScene6220, createScene<Runaway::Scene6220>},
+ {&kRunawayScene6240, createScene<Runaway::Scene6240>},
+ {&kRunawayScene6260, createScene<Runaway::Scene6260>},
+ {&kRunawayScene6263, createScene<Runaway::Scene6263>},
+ {&kRunawayScene6270, createScene<Runaway::Scene6270>},
+ {&kRunawayScene6290, createScene<Runaway::Scene6290>},
+ {&kRunawayScene6350, createScene<Runaway::Scene6350>},
+ {&kRunawayScene6370, createScene<Runaway::Scene6370>}
+};
+
+} // End of anonymous namespace
+
+const RunawayRoom *findRunawayRoom(uint16 number) {
+ if (number >= 2021 && number <= 2023) {
+ number = kHospitalBedroom;
+ }
+ if (number == 4010 || (number >= 4061 && number <= 4065)) {
+ number = kMuseumHall;
+ } else if (number >= 4071 && number <= 4072) {
+ number = kMuseumWilly;
+ } else if (number == 4101) {
+ number = kMuseumSecurity;
+ } else if (number >= 4141 && number <= 4142) {
+ number = kMuseumKeypad;
+ } else if (number == 5021 || number == 5022 || number == 5061 || number == 5062 ||
+ number == 5081 || number == 5101 || number == 5171) {
+ number -= number % 10;
+ } else if (number >= 6221 && number <= 6225) {
+ number = 6220;
+ } else if (number == 6015) {
+ number = 6014;
+ } else if (number == 6081 || number == 6082) {
+ number = 6080;
+ } else if (number == 6131) {
+ number = 6130;
+ } else if (number == 6181) {
+ number = 6180;
+ } else if (number == 6241) {
+ number = 6240;
+ } else if (number == 6201) {
+ number = 6200;
+ } else if (number == 6261 || number == 6262 || number == 6265) {
+ number = 6260;
+ } else if (number == 6264) {
+ number = 6263;
+ } else if (number == 6291) {
+ number = 6290;
+ }
+ for (uint i = 0; i < ARRAYSIZE(kSceneDefinitions); ++i) {
+ if (kSceneDefinitions[i].room->number == number) {
+ return kSceneDefinitions[i].room;
+ }
+ }
+ return nullptr;
+}
+
+RunawayScene *createRunawayRoomScene(const RunawayRoom &room, RunawayAudio &audio, RunawayInventory &inventory,
+ const RunawayStrings &strings, RunawayGameType game) {
+ for (uint i = 0; i < ARRAYSIZE(kSceneDefinitions); ++i) {
+ if (kSceneDefinitions[i].room->number == room.number) {
+ return kSceneDefinitions[i].create(audio, inventory, strings, game);
+ }
+ }
+ return nullptr;
+}
+
+} // End of namespace Hollywood
diff --git a/engines/hollywood/runaway/scene_registry.h b/engines/hollywood/runaway/scene_registry.h
new file mode 100644
index 00000000000..a1ca14d0126
--- /dev/null
+++ b/engines/hollywood/runaway/scene_registry.h
@@ -0,0 +1,40 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+
+#ifndef HOLLYWOOD_RUNAWAY_SCENE_REGISTRY_H
+#define HOLLYWOOD_RUNAWAY_SCENE_REGISTRY_H
+
+#include "hollywood/runaway/detection.h"
+
+namespace Hollywood {
+
+class RunawayAudio;
+class RunawayInventory;
+class RunawayScene;
+class RunawayStrings;
+struct RunawayRoom;
+
+RunawayScene *createRunawayRoomScene(const RunawayRoom &room, RunawayAudio &audio, RunawayInventory &inventory,
+ const RunawayStrings &strings, RunawayGameType game);
+
+} // End of namespace Hollywood
+
+#endif // HOLLYWOOD_RUNAWAY_SCENE_REGISTRY_H
diff --git a/engines/hollywood/runaway/town.cpp b/engines/hollywood/runaway/town.cpp
new file mode 100644
index 00000000000..a02f6461784
--- /dev/null
+++ b/engines/hollywood/runaway/town.cpp
@@ -0,0 +1,96 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+
+#include "common/textconsole.h"
+#include "common/util.h"
+#include "hollywood/runaway/scene.h"
+
+namespace Hollywood {
+
+void RunawayRoomScene::resumeTown() {
+ prepareCustomGameplayLoop();
+ if (!_entering) {
+ resumeAmbientAudio(false);
+ return;
+ }
+ _entering = false;
+ _town.arrived = 1;
+ resumeAmbientAudio(true);
+ runCustomEntrySequence();
+}
+
+void RunawayRoomScene::resumeAmbientAudio(bool entering) {
+ if (!_audio.musicPlaying()) {
+ _audio.playMusic(11);
+ }
+}
+
+void RunawayRoomScene::updateTown(uint32 delta) {
+ advanceCustomGameplayLoop(delta);
+ if (updateCustomSequence()) {
+ return;
+ }
+ updateRoomAnimation();
+ updateConversation();
+ if (_roomAction && _actionFrames.empty() && !speaking() && !_walkPath.active()) {
+ const uint16 action = _roomAction;
+ _roomAction = 0;
+ execute(action);
+ }
+ if (_hospitalExit.scene && !speaking() && !_roomAction && !_walkPath.active()) {
+ _transition = _hospitalExit;
+ }
+}
+
+void RunawayRoomScene::walkTown(Common::Point target) {
+ if (!_pendingHotspot) {
+ // Clicks stay on the ground; hotspot approaches may use the reserved zones.
+ target.x = CLIP<int>(target.x, 0, _background.w - 1);
+ target.y = CLIP<int>(target.y, 0, _background.h - 1);
+ if (!adjustCustomWalkTargetToFloorMask(target)) {
+ while (target.y < _background.h - 1 && !_maps[_mask[target.y * _background.w + target.x]]) {
+ ++target.y;
+ }
+ while (target.y > 0 && !_maps[_mask[target.y * _background.w + target.x]]) {
+ --target.y;
+ }
+ }
+ }
+ _walkPath.findPath(RunawayWalkMap(_background.w, _background.h, _mask, _originalMaps), target);
+}
+
+void RunawayRoomScene::deferTownAction(uint16 action) {
+ _roomAction = action;
+ _actionFrames.clear();
+}
+
+void RunawayRoomScene::leaveTownRoom(uint16 scene) {
+ const RunawayRoom *room = findRunawayRoom(scene);
+ if (!room) {
+ warning("Runaway: scene %u is not implemented yet", scene);
+ return;
+ }
+ _hospitalExit.scene = scene;
+ _hospitalExit.position = room->entry;
+ _hospitalExit.facing = 3;
+}
+
+} // End of namespace Hollywood
More information about the Scummvm-git-logs
mailing list