[Scummvm-git-logs] scummvm master -> 17971c3c96c5e3096812b622119aafedf98de230
dreammaster
noreply at scummvm.org
Thu Aug 22 04:56:40 UTC 2024
This automated email contains information about 2 new commits which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .
Summary:
54bc323f51 M4: RIDDLE: More room 407 init
17971c3c96 M4: RIDDLE: Added room 407 setHotspots
Commit: 54bc323f51bfa347ff6c37ce38511a2305bdcdd8
https://github.com/scummvm/scummvm/commit/54bc323f51bfa347ff6c37ce38511a2305bdcdd8
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2024-08-21T21:56:16-07:00
Commit Message:
M4: RIDDLE: More room 407 init
Changed paths:
engines/m4/riddle/rooms/room.cpp
engines/m4/riddle/rooms/room.h
engines/m4/riddle/rooms/section4/room406.cpp
engines/m4/riddle/rooms/section4/room406.h
engines/m4/riddle/rooms/section4/room407.cpp
engines/m4/riddle/rooms/section4/room407.h
diff --git a/engines/m4/riddle/rooms/room.cpp b/engines/m4/riddle/rooms/room.cpp
index 138132fe07e..7be76d4b6ec 100644
--- a/engines/m4/riddle/rooms/room.cpp
+++ b/engines/m4/riddle/rooms/room.cpp
@@ -577,6 +577,11 @@ const char *Room::getItemsPlacedDigi() const {
return (val >= 1 && val <= 5) ? NAMES[val - 1] : nullptr;
}
+void Room::disableHotspots() {
+ for (auto *hs = _G(currentSceneDef).hotspots; hs; hs = hs->next)
+ hs->active = false;
+}
+
} // namespace Rooms
} // namespace Riddle
} // namespace M4
diff --git a/engines/m4/riddle/rooms/room.h b/engines/m4/riddle/rooms/room.h
index ac544abf7ab..064c36574f2 100644
--- a/engines/m4/riddle/rooms/room.h
+++ b/engines/m4/riddle/rooms/room.h
@@ -112,6 +112,11 @@ protected:
bool setItemsPlacedFlags();
const char *getItemsPlacedDigi() const;
+ /**
+ * Sets all the hotspots to be inactive
+ */
+ void disableHotspots();
+
public:
Room() : M4::Room() {}
~Room() override {}
diff --git a/engines/m4/riddle/rooms/section4/room406.cpp b/engines/m4/riddle/rooms/section4/room406.cpp
index a101dab24e6..af4af7d2e43 100644
--- a/engines/m4/riddle/rooms/section4/room406.cpp
+++ b/engines/m4/riddle/rooms/section4/room406.cpp
@@ -1010,11 +1010,6 @@ void Room406::parser() {
}
#undef LOOK
-void Room406::disableHotspots() {
- for (auto *hs = _G(currentSceneDef).hotspots; hs; hs = hs->next)
- hs->active = false;
-}
-
void Room406::setHotspots() {
for (auto *hs = _G(currentSceneDef).hotspots; hs; hs = hs->next)
hs->active = true;
diff --git a/engines/m4/riddle/rooms/section4/room406.h b/engines/m4/riddle/rooms/section4/room406.h
index 9ed7e34e533..8a3512d6fb6 100644
--- a/engines/m4/riddle/rooms/section4/room406.h
+++ b/engines/m4/riddle/rooms/section4/room406.h
@@ -56,7 +56,6 @@ private:
int _deskOpening = 0;
int _cabinetOpens = 0;
- void disableHotspots();
void setHotspots();
bool takeKeys();
bool takeBilliardBall();
diff --git a/engines/m4/riddle/rooms/section4/room407.cpp b/engines/m4/riddle/rooms/section4/room407.cpp
index 36a37254f19..746f8f5620a 100644
--- a/engines/m4/riddle/rooms/section4/room407.cpp
+++ b/engines/m4/riddle/rooms/section4/room407.cpp
@@ -46,10 +46,174 @@ void Room407::init() {
if (_G(game).previous_room == KERNEL_RESTORING_GAME) {
if (_val5 == 1010) {
- // TODO
- } else {
- // TODO
+ ws_demand_facing(9);
+ _ripMedReach = series_load("RIP TREK MED REACH POS3");
+ setGlobals1(_ripMedReach, 10, 10, 10, 10, 0, 10, 1, 1, 1);
+ sendWSMessage_110000(-1);
+ _drawerPopup = series_place_sprite("407 DRAWER POPUP", 0, 0, 0, 100, 0x200);
+ disableHotspots();
+ hotspot_set_active(" ", true);
+
+ if (_xyzzy2 == 1101) {
+ _drawerPopupHose = series_place_sprite("407 DRAWER POPUP HOSE", 0, 0, 0, 100, 0x100);
+ hotspot_set_active("GARDEN HOSE", true);
+ }
+
+ if (_xyzzy5 == 1101) {
+ _stopperInDrawer = series_place_sprite("407 STOPPER IN DRAWER", 0, 0, 0, 100, 0x100);
+ hotspot_set_active("RUBBER PLUG", true);
+ }
+
+ if (_xyzzy3 == 1101) {
+ _tubeInDrawer = series_place_sprite("407 TUBE IN DRAWER", 0, 0, 0, 100, 0x100);
+ hotspot_set_active("SURGICAL TUBE", true);
+ }
+
+ if (_xyzzy4 == 1101) {
+ _handleInDrawer = series_place_sprite("407 PUMP HANDLE IN DRAWER", 0, 0, 0, 100, 0x100);
+ hotspot_set_active("PUMP GRIPS", true);
+ }
+ } else if (_frotz10 == 1030) {
+ _tabletopPopup = series_place_sprite("407 TABLETOP POPUP", 0, 0, 0, 100, 0x200);
+ disableHotspots();
+ hotspot_set_active(" ", true);
+
+ if (_xyzzy3 == 1117)
+ _tabletopPopupWithItems1 = series_place_sprite(
+ "407 TABLETOP POPUP WITH ITEMS", 0, 0, 0, 100, 0);
+
+ if (_val9 == 1110)
+ _tabletopPopupWithItems1 = series_place_sprite(
+ "407 TABLETOP POPUP WITH ITEMS",
+ (_val3 == 1010) ? 1 : 2,
+ 0, 0, 100, 0x100);
+
+ if (_val10 == 1113)
+ _tabletopPopupWithItems1 = series_place_sprite(
+ "407 TABLETOP POPUP WITH ITEMS", 3, 0, 0, 100, 0x100);
+
+ } else if (_int1 == 1030) {
+ _pivotPopup = series_place_sprite("407 PIVOT POPUP", 0, 0, 0, 100, 0x200);
+
+ if (_val10 == 1113)
+ _tabletopPopupWithItems3 = series_place_sprite(
+ "407 TABLE PIVOT WITH LEVER", 0, 0, 0, 100, 0x200);
+
+ disableHotspots();
+ hotspot_set_active(" ", true);
+
+ } else if (_int3 == 1030) {
+ _glassTopPopup = series_place_sprite("407 GLASS TOP POPUP", 0, 0, 0, 100, 0x200);
+
+ if (_val6 == 1010)
+ _glassTopPopupWithItems1 = series_place_sprite(
+ "407 GLASS TOP POPUP WITH ITEMS", 1, 0, 0, 100, 0x100);
+ else if (_xyzzy6 == 1116)
+ _glassTopPopupWithItems2 = series_place_sprite(
+ "407 GLASS TOP POPUP WITH ITEMS", 0, 0, 0, 100, 0x100);
+
+ disableHotspots();
+ hotspot_set_active(" ", true);
+
+ } else if (_int4 == 1030) {
+ _glassTopPopup = series_place_sprite("407 GLASS BOTTOM POPUP", 0, 0, 0, 100, 0x200);
+
+ if (_xyzzy6 == 1116)
+ _glassTopPopupWithItems2 = series_place_sprite(
+ "407 GLS BOTTOM PU WITH ITEMS", 0, 0, 0, 100, 0x100);
+
+ if (_xyzzy8 == 1116)
+ _glassBottomWithItems1 = series_place_sprite(
+ "407 GLS BOTTOM PU WITH ITEMS", 1, 0, 0, 100, 0x100);
+
+ if (_xyzzy5 == 1116)
+ _glassBottomWithItems2 = series_place_sprite(
+ "407 GLS BOTTOM PU WITH ITEMS", 4, 0, 0, 100, 0x100);
+
+ if (_val10 == 1113)
+ _tabletopPopupWithItems3 = series_place_sprite(
+ "407 GLS BOTTOM PU WITH ITEMS", 5, 0, 0, 100, 0x100);
+
+ disableHotspots();
+ hotspot_set_active(" ", true);
+
+ } else if (_int2 == 1030) {
+ _glassTopPopup = series_place_sprite("407 FULL GLASS POPUP",
+ 0, 0, 0, 100, 0x200);
+
+ if (_xyzzy6 == 1116)
+ _glassTopPopupWithItems2 = series_place_sprite(
+ "407 FULL GLASS POPUP", 0, 0, 0, 100, 0x100);
+
+ if (_xyzzy8 == 1116)
+ _glassBottomWithItems1 = series_place_sprite(
+ "407 FULL GLASS POPUP WITH ITEMS", 1, 0, 0, 100, 0x100);
+
+ if (_xyzzy5 == 1116)
+ _glassBottomWithItems1 = series_place_sprite(
+ "407 FULL GLASS POPUP WITH ITEMS", 4, 0, 0, 100, 0x100);
+
+ disableHotspots();
+ hotspot_set_active(" ", true);
+
+ } else if (_int5 == 1030) {
+ _roofPiston = series_place_sprite("407 ROOF PISTON/BRACE", 0, 0, 0, 100, 0x200);
+
+ if (_val10 == 1114)
+ _tabletopPopupWithItems3 = series_place_sprite(
+ "407 ROOF PISTON WITH ITEMS", 1, 0, 0, 100, 0x100);
+
+ if (_xyzzy1 == 1114)
+ _roofPistonWithItems = series_place_sprite(
+ "407 ROOF PISTON WITH ITEMS", 0, 0, 0, 100, 0);
+
+ disableHotspots();
+ hotspot_set_active(" ", true);
+
+ } else if (_int6 == 1030) {
+ _glassGone = series_place_sprite("407 GLASS GONE CU PU", 0, 0, 0, 100, 0x200);
+ disableHotspots();
+ hotspot_set_active(" ", true);
+
+ } else if (_int7 == 1030) {
+ _comboLockPopup = series_place_sprite(
+ "407 COMBINATION LOCK POPUP", 0, 0, 0, 100, 0x200);
+ disableHotspots();
+ hotspot_set_active(" ", true);
+ _comboLockNumerals = series_load("407 COMBINATION LOCK NUMERALS");
+ _407pu08b = series_load("407PU08B");
+ _407pu08c = series_load("407PU08C");
+ _407pu08d = series_load("407PU08D");
+
+ _lockButton1 = TriggerMachineByHash(1, 1, 0, 0, 0, 0, 0, 0, 100, 0, 0,
+ triggerMachineByHashCallbackNegative, "LOCK button 1");
+ _lockButton2 = TriggerMachineByHash(1, 1, 0, 0, 0, 0, 0, 0, 100, 0, 0,
+ triggerMachineByHashCallbackNegative, "LOCK button 2");
+ _lockButton3 = TriggerMachineByHash(1, 1, 0, 0, 0, 0, 0, 0, 100, 0, 0,
+ triggerMachineByHashCallbackNegative, "LOCK button 3");
+ _lockButton4 = TriggerMachineByHash(1, 1, 0, 0, 0, 0, 0, 0, 100, 0, 0,
+ triggerMachineByHashCallbackNegative, "LOCK button 4");
+
+ sendWSMessage_10000(1, _lockButton1, _comboLockNumerals,
+ _buttonFrame1 * 2 + 1, _buttonFrame1 * 2 + 1, -1,
+ _comboLockNumerals, _buttonFrame1 * 2 + 1,
+ _buttonFrame1 * 2 + 1, 0);
+ sendWSMessage_10000(1, _lockButton2, _comboLockNumerals,
+ _buttonFrame1 * 2 + 1, _buttonFrame1 * 2 + 1, -1,
+ _comboLockNumerals, _buttonFrame1 * 2 + 1,
+ _buttonFrame1 * 2 + 1, 0);
+ sendWSMessage_10000(1, _lockButton3, _comboLockNumerals,
+ _buttonFrame1 * 2 + 1, _buttonFrame1 * 2 + 1, -1,
+ _comboLockNumerals, _buttonFrame1 * 2 + 1,
+ _buttonFrame1 * 2 + 1, 0);
+
+ hotspot_set_active("BUTTON", true);
+ hotspot_set_active("BUTTON ", true);
+ hotspot_set_active("BUTTON ", true);
+ hotspot_set_active("BUTTON ", true);
+
}
+ // TODO
} else {
static const char *HOTSPOTS[] = {
"GARDEN HOSE", "RUBBER PLUG", "SURGICAL TUBE",
@@ -104,10 +268,10 @@ void Room407::init() {
_int5 = 1031;
_int6 = 1031;
_int7 = 1031;
- _int10 = 0;
- _int11 = 0;
- _int12 = 0;
- _int13 = 0;
+ _buttonFrame1 = 0;
+ _buttonFrame2 = 0;
+ _buttonFrame3 = 0;
+ _buttonFrame4 = 0;
_int14 = 0;
_bottle = series_place_sprite("407BOTLE", 0, 0, -53, 100, 0xf00);
diff --git a/engines/m4/riddle/rooms/section4/room407.h b/engines/m4/riddle/rooms/section4/room407.h
index 3a48ed2bb62..9613979b954 100644
--- a/engines/m4/riddle/rooms/section4/room407.h
+++ b/engines/m4/riddle/rooms/section4/room407.h
@@ -67,10 +67,10 @@ private:
int _int5 = 0;
int _int6 = 0;
int _int7 = 0;
- int _int10 = 0;
- int _int11 = 0;
- int _int12 = 0;
- int _int13 = 0;
+ int _buttonFrame1 = 0;
+ int _buttonFrame2 = 0;
+ int _buttonFrame3 = 0;
+ int _buttonFrame4 = 0;
int _int14 = 0;
int _waterFlowTube = 0;
@@ -87,6 +87,36 @@ private:
machine *_niche = nullptr;
machine *_tpist = nullptr;
machine *_pump = nullptr;
+ int _ripMedReach = 0;
+ machine *_drawerPopup = nullptr;
+ machine *_drawerPopupHose = nullptr;
+ machine *_stopperInDrawer = nullptr;
+ machine *_tubeInDrawer = nullptr;
+ machine *_handleInDrawer = nullptr;
+ machine *_tabletopPopup = nullptr;
+ machine *_tabletopPopupWithItems1 = nullptr;
+ machine *_tabletopPopupWithItems2 = nullptr;
+ machine *_tabletopPopupWithItems3 = nullptr;
+ machine *_pivotPopup = nullptr;
+ machine *_glassTopPopup = nullptr;
+ machine *_glassTopPopupWithItems1 = nullptr;
+ machine *_glassTopPopupWithItems2 = nullptr;
+ machine *_glassBottomWithItems1 = nullptr;
+ machine *_glassBottomWithItems2 = nullptr;
+ machine *_roofPiston = nullptr;
+ machine *_roofPistonWithItems = nullptr;
+ machine *_glassGone = nullptr;
+ machine *_comboLockPopup = nullptr;
+ int _comboLockNumerals = 0;
+ int _407pu08b = 0;
+ int _407pu08c = 0;
+ int _407pu08d = 0;
+ machine *_lockButton1 = nullptr;
+ machine *_lockButton2 = nullptr;
+ machine *_lockButton3 = nullptr;
+ machine *_lockButton4 = nullptr;
+
+ void setHotspots();
public:
Room407() : Room() {}
Commit: 17971c3c96c5e3096812b622119aafedf98de230
https://github.com/scummvm/scummvm/commit/17971c3c96c5e3096812b622119aafedf98de230
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2024-08-21T21:56:16-07:00
Commit Message:
M4: RIDDLE: Added room 407 setHotspots
Changed paths:
engines/m4/riddle/rooms/room.cpp
engines/m4/riddle/rooms/room.h
engines/m4/riddle/rooms/section4/room407.cpp
diff --git a/engines/m4/riddle/rooms/room.cpp b/engines/m4/riddle/rooms/room.cpp
index 7be76d4b6ec..8e937b4e908 100644
--- a/engines/m4/riddle/rooms/room.cpp
+++ b/engines/m4/riddle/rooms/room.cpp
@@ -582,6 +582,11 @@ void Room::disableHotspots() {
hs->active = false;
}
+void Room::enableHotspots() {
+ for (auto *hs = _G(currentSceneDef).hotspots; hs; hs = hs->next)
+ hs->active = true;
+}
+
} // namespace Rooms
} // namespace Riddle
} // namespace M4
diff --git a/engines/m4/riddle/rooms/room.h b/engines/m4/riddle/rooms/room.h
index 064c36574f2..f610c2ddb4a 100644
--- a/engines/m4/riddle/rooms/room.h
+++ b/engines/m4/riddle/rooms/room.h
@@ -117,6 +117,11 @@ protected:
*/
void disableHotspots();
+ /**
+ * Sets all the hotspots to be active
+ */
+ void enableHotspots();
+
public:
Room() : M4::Room() {}
~Room() override {}
diff --git a/engines/m4/riddle/rooms/section4/room407.cpp b/engines/m4/riddle/rooms/section4/room407.cpp
index 746f8f5620a..1e27a08c089 100644
--- a/engines/m4/riddle/rooms/section4/room407.cpp
+++ b/engines/m4/riddle/rooms/section4/room407.cpp
@@ -212,8 +212,9 @@ void Room407::init() {
hotspot_set_active("BUTTON ", true);
hotspot_set_active("BUTTON ", true);
+ } else {
+ setHotspots();
}
- // TODO
} else {
static const char *HOTSPOTS[] = {
"GARDEN HOSE", "RUBBER PLUG", "SURGICAL TUBE",
@@ -304,6 +305,156 @@ void Room407::parser() {
// TODO
}
+void Room407::setHotspots() {
+ disableHotspots();
+
+ hotspot_set_active(" ", true);
+
+ if (_val5 == 1010) {
+ if (_xyzzy2 == 1101)
+ hotspot_set_active("GARDEN HOSE", true);
+ if (_xyzzy5 == 1101)
+ hotspot_set_active("RUBBER PLUG", true);
+ if (_xyzzy3 == 1101)
+ hotspot_set_active("SURGICAL TUBE", true);
+ if (_xyzzy4 == 1101)
+ hotspot_set_active("PUMP GRIPS", true);
+
+ } else if (_frotz10 == 1030 || _int1 == 1030 ||
+ _int3 == 1030 || _int4 == 1030 || _int2 == 1030 ||
+ _int5 == 1030 || _int6 == 1030) {
+ // No implementation
+ } else if (_int7 == 1030) {
+ hotspot_set_active("BUTTON", true);
+ hotspot_set_active("BUTTON ", true);
+ hotspot_set_active("BUTTON ", true);
+ hotspot_set_active("BUTTON ", true);
+
+ } else {
+ enableHotspots();
+
+ hotspot_set_active("GARDEN HOSE", false);
+ hotspot_set_active("RUBBER PLUG", false);
+ hotspot_set_active("SURGICAL TUBE", false);
+ hotspot_set_active("PUMP GRIPS", false);
+ hotspot_set_active("BUTTON", false);
+ hotspot_set_active("BUTTON ", false);
+ hotspot_set_active("BUTTON ", false);
+ hotspot_set_active("BUTTON ", false);
+
+ if (_xyzzy4 != 1115)
+ hotspot_set_active("PUMP GRIPS ", false);
+ if (_xyzzy1 != 1115)
+ hotspot_set_active("PUMP ROD", false);
+ if (_xyzzy1 != 1114)
+ hotspot_set_active("PUMP ROD ", false);
+ if (_val9 != 1100)
+ hotspot_set_active("FAUCET HANDLE", false);
+ if (_val8 != 1100)
+ hotspot_set_active("FAUCET PIPE", false);
+ if (_val9 != 1110)
+ hotspot_set_active("AIR VALVE/HANDLE", false);
+ if (_val9 != 1110)
+ hotspot_set_active("AIR VALVE", false);
+ if (_val10 != 1112)
+ hotspot_set_active("LEVER KEY", false);
+ if (_val10 != 1113)
+ hotspot_set_active("LEVER KEY ", false);
+ if (_val10 != 1114)
+ hotspot_set_active("LEVER KEY ", false);
+ if (_val10 != 1117)
+ hotspot_set_active("NOZZLES/TUBE", false);
+ if (_xyzzy3 != 1117)
+ hotspot_set_active("NOZZLES", false);
+ if (_xyzzy6 != 1112)
+ hotspot_set_active("PERIODIC TABLE", false);
+ if (_xyzzy6 != 1116)
+ hotspot_set_active("PERIODIC TABLE/JAR", false);
+ if (_xyzzy6 != 1120)
+ hotspot_set_active("PERIODIC TABLE ", false);
+
+ if (inv_object_is_here("EMERALD/CORK"))
+ hotspot_set_active("EMERALD/CORK", false);
+
+ if (_xyzzy7 == 1112) {
+ if (_xyzzy5 != 1116)
+ hotspot_set_active("JAR/RUBBER PLUG", false);
+ if (_xyzzy9 != 1116)
+ hotspot_set_active("JAR/CORK", false);
+ if (_xyzzy8 != 1116)
+ hotspot_set_active("EMERALD PIN/CORK", false);
+ } else {
+ hotspot_set_active("GLASS JAR", false);
+ hotspot_set_active("JAR/RUBBER PLUG", false);
+ hotspot_set_active("JAR/CORK", false);
+ hotspot_set_active("EMERALD PIN/CORK", false);
+ }
+
+ if (_xyzzy7 != 1114 && _xyzzy7 != 1140) {
+ hotspot_set_active("JAR/CORK ", false);
+ hotspot_set_active("JAR/GRIPS ", false);
+ hotspot_set_active("GLASS JAR ", false);
+ hotspot_set_active("JAR/RUBBER PLUG ", false);
+ } else {
+ if (_xyzzy5 != 1116 && _xyzzy5 != 1130)
+ hotspot_set_active("JAR/RUBBER PLUG ", false);
+ if (_xyzzy9 != 1116 && _xyzzy9 != 1130)
+ hotspot_set_active("JAR/CORK ", false);
+ if (_xyzzy4 != 1116 && _xyzzy4 != 1130)
+ hotspot_set_active("JAR/GRIP ", false);
+ }
+
+ if (_val8 != 1116 && _val8 != 1140)
+ hotspot_set_active("FAUCET PIPE ", false);
+ if (_xyzzy2 != 1116)
+ hotspot_set_active("GARDEN HOSE ", false);
+ if (_xyzzy3 != 1116)
+ hotspot_set_active("SURGICAL TUBE ", false);
+ if (_xyzzy2 != 1130)
+ hotspot_set_active("GARDEN HOSE ", false);
+ if (_val8 != 1130)
+ hotspot_set_active("FAUCET PIPE ", false);
+ if (_xyzzy3 != 1130 && _xyzzy3 != 1140)
+ hotspot_set_active("SURGICAL TUBE ", false);
+ if (_xyzzy3 != 1100)
+ hotspot_set_active("SURGICAL TUBE ", false);
+ if (_xyzzy2 != 1140)
+ hotspot_set_active("GARDEN HOSE ", false);
+ if (_xyzzy2 != 1100)
+ hotspot_set_active("GARDEN HOSE ", false);
+
+ if (_frotz2) {
+ hotspot_set_active("ARMORED CABINET", false);
+
+ if (_frotz4)
+ hotspot_set_active("LETTER", false);
+ if (!_frotz4)
+ hotspot_set_active("BUTTONS", false);
+
+ } else {
+ hotspot_set_active("MICROSCOPE", false);
+ hotspot_set_active("BUTTONS", false);
+ hotspot_set_active("LETTER", false);
+ }
+
+ hotspot_set_active("WATER", false);
+ hotspot_set_active("WATER ", false);
+ hotspot_set_active("WATER ", false);
+
+ if (!_val4) {
+ if (_val8 == 1100) {
+ if (_xyzzy3 != 1100)
+ hotspot_set_active("WATER", true);
+ else if (_xyzzy2 != 1100)
+ hotspot_set_active("WATER ", true);
+ } else {
+ if (_xyzzy3 == 1130 && _xyzzy2 != 1130)
+ hotspot_set_active("WATER ", true);
+ }
+ }
+ }
+}
+
} // namespace Rooms
} // namespace Riddle
} // namespace M4
More information about the Scummvm-git-logs
mailing list