[Scummvm-git-logs] scummvm master -> 8367736a31e902446f14094e795f20aff0b4397b
Strangerke
noreply at scummvm.org
Thu Nov 21 23:39:45 UTC 2024
This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .
Summary:
8367736a31 M4: RIDDLE: Room 701: Implement inventoryCheck
Commit: 8367736a31e902446f14094e795f20aff0b4397b
https://github.com/scummvm/scummvm/commit/8367736a31e902446f14094e795f20aff0b4397b
Author: Strangerke (arnaud.boutonne at gmail.com)
Date: 2024-11-22T00:39:22+01:00
Commit Message:
M4: RIDDLE: Room 701: Implement inventoryCheck
Changed paths:
engines/m4/riddle/rooms/section7/room701.cpp
engines/m4/riddle/rooms/section7/room701.h
diff --git a/engines/m4/riddle/rooms/section7/room701.cpp b/engines/m4/riddle/rooms/section7/room701.cpp
index 5ec1915af85..b32cca51229 100644
--- a/engines/m4/riddle/rooms/section7/room701.cpp
+++ b/engines/m4/riddle/rooms/section7/room701.cpp
@@ -39,7 +39,7 @@ void Room701::init() {
_itemDigiName = nullptr;
_field8C = 0;
- _field50 = 0;
+ _field50_counter = 0;
_field9E_triggerNum = -1;
_field130 = 0;
@@ -75,7 +75,7 @@ void Room701::init() {
if (setItemsPlacedFlags()) {
_field88 = 1;
_itemDigiName = getItemsPlacedDigi();
- ++_field50;
+ ++_field50_counter;
}
ws_demand_location(_G(my_walker), 50, 264);
@@ -388,10 +388,10 @@ void Room701::daemon() {
case 43:
sendWSMessage_120000(_G(my_walker), -1);
- subDaemon_D447C();
+ updateCounter();
sendWSMessage_150000(_G(my_walker), -1);
- if (_field50 == 1) {
+ if (_field50_counter == 1) {
_field8C = 1;
_agentPoshExpressMach02 = TriggerMachineByHash(1, 1, 0, 0, 0, 0, 0, 0, 100, 768, false, triggerMachineByHashCallback, "agent posh express");
ws_hide_walker(_G(my_walker));
@@ -400,7 +400,7 @@ void Room701::daemon() {
sendWSMessage_1a0000(_agentPoshExpressMach, 11);
digi_play("701X02", 1, 255, 2200, -1);
- } else if (_field50 > 0) {
+ } else if (_field50_counter > 0) {
_field8C = 1;
_agentPoshExpressMach02 = TriggerMachineByHash(1, 1, 0, 0, 0, 0, 0, 0, 100, 768, 0, triggerMachineByHashCallback, "agent posh express");
ws_hide_walker(_G(my_walker));
@@ -816,8 +816,120 @@ void Room701::conv701a() {
digi_play(digiName, 1, 255, 1, -1);
}
-void Room701::subDaemon_D447C() {
- warning("STUB - subDaemon_D447C()");
+void Room701::updateCounter() {
+ if (_G(flags[V364]) == 1) {
+ ++_field50_counter;
+ switch (_G(flags[V005])) {
+ case 1:
+ _G(flags[V351]) = 1;
+ break;
+
+ case 2:
+ _G(flags[V352]) = 1;
+ break;
+
+ case 3:
+ _G(flags[V353]) = 1;
+ break;
+
+ case 4:
+ _G(flags[V354]) = 1;
+ break;
+
+ default:
+ break;
+ }
+ }
+
+ if (_G(flags[V365]) == 1) {
+ _G(flags[V355]) = 1;
+ ++_field50_counter;
+ }
+
+ if (_G(flags[V366]) == 1) {
+ _G(flags[V356]) = 1;
+ ++_field50_counter;
+ }
+
+ if (_G(flags[V367]) == 1) {
+ _G(flags[V357]) = 1;
+ ++_field50_counter;
+ }
+
+ if (_G(flags[V368]) == 1) {
+ _G(flags[V358]) = 1;
+ ++_field50_counter;
+ }
+
+ if (_G(flags[V369]) == 1) {
+ _G(flags[V359]) = 1;
+ ++_field50_counter;
+ }
+
+ if (_G(flags[V370]) == 1) {
+ _G(flags[V360]) = 1;
+ ++_field50_counter;
+ }
+
+ if (_G(flags[V371]) == 1) {
+ _G(flags[V361]) = 1;
+ ++_field50_counter;
+ }
+
+ if (_G(flags[V372]) == 1) {
+ _G(flags[V362]) = 1;
+ ++_field50_counter;
+ }
+
+ if (_G(flags[V373]) == 1) {
+ _G(flags[V363]) = 1;
+ ++_field50_counter;
+ }
+}
+
+bool Room701::inventoryCheck() {
+ for (int i = 0; i < 12; ++i)
+ _fieldD0[i] = 0;
+
+ _fieldFC_index = 0;
+
+ if (inv_player_has("CRYSTAL SKULL"))
+ _fieldD0[_fieldFC_index++] = 1;
+
+ if (inv_player_has("STICK AND SHELL MAP"))
+ _fieldD0[_fieldFC_index++] = 2;
+
+ if (inv_player_has("WHEELED TOY"))
+ _fieldD0[_fieldFC_index++] = 3;
+
+ if (inv_player_has("REBUS AMULET"))
+ _fieldD0[_fieldFC_index++] = 4;
+
+ if (inv_player_has("SHRUNKEN HEAD"))
+ _fieldD0[_fieldFC_index++] = 5;
+
+ if (inv_player_has("SILVER BUTTERFLY"))
+ _fieldD0[_fieldFC_index++] = 6;
+
+ if (inv_player_has("POSTAGE STAMP"))
+ _fieldD0[_fieldFC_index++] = 7;
+
+ if (inv_player_has("GERMAN BANKNOTE"))
+ _fieldD0[_fieldFC_index++] = 8;
+
+ if (inv_player_has("WHALE BONE HORN"))
+ _fieldD0[_fieldFC_index++] = 9;
+
+ if (inv_player_has("CHISEL"))
+ _fieldD0[_fieldFC_index++] = 10;
+
+ if (inv_player_has("INCENSE BURNER"))
+ _fieldD0[_fieldFC_index++] = 11;
+
+ if (inv_player_has("ROMANOV EMERALD"))
+ _fieldD0[_fieldFC_index++] = 12;
+
+ return _fieldFC_index > 0;
}
} // namespace Rooms
diff --git a/engines/m4/riddle/rooms/section7/room701.h b/engines/m4/riddle/rooms/section7/room701.h
index 74dc0d1ea0c..be2421dd6d9 100644
--- a/engines/m4/riddle/rooms/section7/room701.h
+++ b/engines/m4/riddle/rooms/section7/room701.h
@@ -41,13 +41,14 @@ public:
private:
void conv701a();
- void subDaemon_D447C();
+ void updateCounter();
+ bool inventoryCheck();
const char *_itemDigiName = nullptr;
Common::String _convDigiName_1 = "";
Common::String _convDigiName_2 = "";
- int32 _field50 = 0;
+ int32 _field50_counter = 0;
int32 _field6C = 0;
int32 _field72 = 0;
int32 _field88 = 0;
@@ -57,6 +58,8 @@ private:
int32 _field98 = 0;
int32 _field9E_triggerNum = -1;
int32 _fieldB4 = 0;
+ int32 _fieldD0[12] = {0,0,0,0,0,0,0,0,0,0,0,0};
+ int32 _fieldFC_index = 0;
int32 _field130 = 0;
int32 _field134 = 0;
More information about the Scummvm-git-logs
mailing list