[Scummvm-git-logs] scummvm master -> c4f0180e91fcdb2395db9c88472c2cd38dfda069

Strangerke noreply at scummvm.org
Mon Nov 25 08:52:05 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:
6a1743adfc M4: RIDDLE: room 702 - Implement syncGame, some renaming and comments
c4f0180e91 M4: RIDDLE: room 703 - Start working on room (preload, init, pre-parser, callback)


Commit: 6a1743adfcff46adb7332015be151eaa3a3b7d33
    https://github.com/scummvm/scummvm/commit/6a1743adfcff46adb7332015be151eaa3a3b7d33
Author: Strangerke (arnaud.boutonne at gmail.com)
Date: 2024-11-25T09:51:37+01:00

Commit Message:
M4: RIDDLE: room 702 - Implement syncGame, some renaming and comments

Changed paths:
    engines/m4/riddle/rooms/section7/room702.cpp
    engines/m4/riddle/rooms/section7/room702.h


diff --git a/engines/m4/riddle/rooms/section7/room702.cpp b/engines/m4/riddle/rooms/section7/room702.cpp
index 3397c3a8611..e203aeaf732 100644
--- a/engines/m4/riddle/rooms/section7/room702.cpp
+++ b/engines/m4/riddle/rooms/section7/room702.cpp
@@ -34,16 +34,16 @@ void Room702::preload() {
 }
 
 void Room702::init() {
-	_field3C = player_been_here(702) ? 1 : 0;
+	_alreadyBeen702Fl = player_been_here(702);
 	_G(flags[V212]) = 0;
 
 	if (_G(game).previous_room != KERNEL_RESTORING_GAME) {
 		_field40 = 0;
-		_field44 = 0;
-		_field48 = 0;
+		_field44_mode = 0;
+		_field48_should = 0;
 		_field4C_triggerNum = -1;
-		_field50 = 0;
-		_field54 = 0;
+		_field50_mode = 0;
+		_field54_should = 0;
 		_field58 = -1;
 	}
 
@@ -115,10 +115,10 @@ void Room702::pre_parser() {
 }
 
 void Room702::parser() {
-	bool ecx = player_said_any("look", "look at");
+	bool lookFl = player_said_any("look", "look at");
 	bool talkFl = player_said_any("talk", "talk to");
-	bool esi = player_said("take");
-	bool edi = player_said_any("push", "pull", "gear", "open", "close");
+	bool takeFl = player_said("take");
+	bool gearFl = player_said_any("push", "pull", "gear", "open", "close");
 
 	if (player_said("CIGAR BAND", "GUARD") && inv_player_has("CIGAR BAND") && !_G(flags[V211])) {
 		_G(flags[V211]) = 1;
@@ -134,18 +134,18 @@ void Room702::parser() {
 		} else {
 			int32 who = conv_whos_talking();
 			if (who <= 0) {
-				_field54 = 2101;
+				_field54_should = 2101;
 			} else if (who == 1) {
-				_field48 = 1103;
+				_field48_should = 1103;
 			}
 			conv_resume(conv_get_handle());
 		}
 	} else if (talkFl && player_said("GUARD")) {
 		player_set_commands_allowed(false);
-		if (_field40 == 0) {
+		if (!_field40) {
 			_field58 = -1;
-			_field44 = 1000;
-			_field48 = 1100;
+			_field44_mode = 1000;
+			_field48_should = 1100;
 			_G(kernel).trigger_mode = KT_DAEMON;
 			kernel_trigger_dispatchx(kernel_trigger_create(100));
 			_G(kernel).trigger_mode = KT_PARSE;
@@ -155,16 +155,16 @@ void Room702::parser() {
 			sendWSMessage_10000(1, _guardShadowMach, _702GuardShadow2Series, 1, 1, -1, _702GuardShadow2Series, 1, 1, 0);
 			_G(flags[V212]) = 0;
 			_field58 = -1;
-			_field44 = 1000;
-			_field48 = 1100;
+			_field44_mode = 1000;
+			_field48_should = 1100;
 		}
-	} else if (ecx && player_said("TEMPLE"))
+	} else if (lookFl && player_said("TEMPLE"))
 		digi_play("702R02", 1, 255, -1, -1);
-	else if (ecx && player_said("WALL"))
+	else if (lookFl && player_said("WALL"))
 		digi_play("702R03", 1, 255, -1, -1);
-	else if (ecx && player_said("CEREMONIAL TORANA"))
+	else if (lookFl && player_said("CEREMONIAL TORANA"))
 		digi_play("702R04", 1, 255, -1, -1);
-	else if (ecx && player_said("Ring")) {
+	else if (lookFl && player_said("Ring")) {
 		switch (_G(kernel).trigger) {
 		case -1:
 			player_set_commands_allowed(false);
@@ -180,7 +180,7 @@ void Room702::parser() {
 		default:
 			break;
 		}
-	} else if (ecx && player_said("GUARD")) {
+	} else if (lookFl && player_said("GUARD")) {
 		switch (_G(kernel).trigger) {
 		case -1:
 			player_set_commands_allowed(false);
@@ -204,7 +204,7 @@ void Room702::parser() {
 			break;
 		}
 	} // ecx && player_said("GUARD")
-	else if (esi && _G(player).click_y <= 374) {
+	else if (takeFl && _G(player).click_y <= 374) {
 		switch (imath_ranged_rand(1, 6)) {
 		case 1:
 			digi_play("com006", 1, 255, -1, -1);
@@ -360,7 +360,7 @@ void Room702::parser() {
 			break;
 		}
 	} // player_said_any("  ", "   ") || (player_said("CIGAR BAND", "GUARD") && _G(flags[V211]))
-	else if (ecx && player_said(" ")) {
+	else if (lookFl && player_said(" ")) {
 		switch (_G(kernel).trigger) {
 		case -1:
 			player_set_commands_allowed(false);
@@ -386,7 +386,7 @@ void Room702::parser() {
 	} // ecx && player_said(" ")
 	else if (player_said("GUARD", "CIGAR") || player_said("GUARD", "CIGAR WITHOUT BAND"))
 		digi_play("com083", 1, 255, -1, -1);
-	else if (!esi && !edi && player_said("GUARD"))
+	else if (!takeFl && !gearFl && player_said("GUARD"))
 		digi_play("702R21", 1, 255, -1, -1);
 	else
 		return;
@@ -523,8 +523,8 @@ void Room702::daemon() {
 		break;
 
 	case 101:
-		if (_field44 == 1000) {
-			switch (_field48) {
+		if (_field44_mode == 1000) {
+			switch (_field48_should) {
 			case 1100:
 				ws_hide_walker(_G(my_walker));
 				player_set_commands_allowed(false);
@@ -534,9 +534,9 @@ void Room702::daemon() {
 				sendWSMessage_10000(1, _ripTalksGuardMach, _ripShowsRingSeries, 1, 1, -1, _ripShowsRingSeries, 1, 1, 0);
 				sendWSMessage_10000(1, _ripTalksGuardShadowMach, _safariShadow1Series, 1, 1, 100, _safariShadow1Series, 1, 1, 0);
 
-				_field48 = 1102;
-				_field50 = 2000;
-				_field54 = 2100;
+				_field48_should = 1102;
+				_field50_mode = 2000;
+				_field54_should = 2100;
 
 				kernel_trigger_dispatchx(kernel_trigger_create(110));
 
@@ -549,7 +549,7 @@ void Room702::daemon() {
 				conv_export_value_curr(_G(flags[V222]), 2);
 				conv_play(conv_get_handle());
 
-				_field48 = 1103;
+				_field48_should = 1103;
 
 				kernel_trigger_dispatchx(kernel_trigger_create(100));
 
@@ -564,7 +564,7 @@ void Room702::daemon() {
 				terminateMachine(_ripTalksGuardMach);
 				terminateMachine(_ripTalksGuardShadowMach);
 
-				_field54 = 2106;
+				_field54_should = 2106;
 
 				ws_unhide_walker(_G(my_walker));
 				player_set_commands_allowed(true);
@@ -583,12 +583,12 @@ void Room702::daemon() {
 		break;
 
 	case 103:
-		_field48 = 1105;
+		_field48_should = 1105;
 		break;
 
 	case 110:
-		if (_field50 == 2000) {
-			switch (_field54) {
+		if (_field50_mode == 2000) {
+			switch (_field54_should) {
 			case 2100:
 			case 2101:
 			case 2103:
@@ -607,13 +607,13 @@ void Room702::daemon() {
 		break;
 
 	case 111:
-		if (_field50 == 2000) {
-			switch (_field54) {
+		if (_field50_mode == 2000) {
+			switch (_field54_should) {
 			case 2100:
 			case 2101:
 				sendWSMessage_10000(1, _guardMach, _guardTalksAndBowsSeries, 8, 8, 110, _guardTalksAndBowsSeries, 8, 8, 0);
 				sendWSMessage_10000(1, _guardShadowMach, _702GuardShadow1Series, 8, 8, -1, _702GuardShadow1Series, 8, 8, 0);
-				_field54 = 2101;
+				_field54_should = 2101;
 
 				break;
 
@@ -621,7 +621,7 @@ void Room702::daemon() {
 				_G(kernel).trigger_mode = KT_PARSE;
 				digi_play(conv_sound_to_play(), 1, 255, 1, -1);
 				_G(kernel).trigger_mode = KT_DAEMON;
-				_field54 = 2104;
+				_field54_should = 2104;
 				kernel_timing_trigger(1, 111, nullptr);
 
 				break;
@@ -642,7 +642,7 @@ void Room702::daemon() {
 			case 2107:
 				sendWSMessage_10000(1, _guardMach, _guardTalksAndBowsSeries, 48, 58, 110, _guardTalksAndBowsSeries, 58, 58, 0);
 				sendWSMessage_10000(1, _guardShadowMach, _702GuardShadow1Series, 48, 58, -1, _702GuardShadow1Series, 58, 58, 0);
-				_field54 = 2108;
+				_field54_should = 2108;
 
 				break;
 
@@ -650,13 +650,13 @@ void Room702::daemon() {
 				digi_play("702_S01", 1, 255, -1, -1);
 				sendWSMessage_10000(1, _guardMach, _guardTalksAndBowsSeries, 58, 82, 110, _guardTalksAndBowsSeries, 82, 82, 0);
 				sendWSMessage_10000(1, _guardShadowMach, _702GuardShadow1Series, 58, 82, -1, _702GuardShadow1Series, 82, 82, 0);
-				_field54 = 2109;
+				_field54_should = 2109;
 
 				break;
 
 			case 2109:
 				terminateMachine(_ringCloseupMach);
-				_field54 = 2103;
+				_field54_should = 2103;
 				kernel_timing_trigger(1, 111, nullptr);
 
 				break;
@@ -688,16 +688,25 @@ void Room702::conv702a() {
 		int32 entry = conv_current_entry();
 
 		if (node == 1 && (entry == 1 || entry == 2)) {
-			_field54 = 2107;
+			_field54_should = 2107;
 		} else {
-			_field54 = 2103;
+			_field54_should = 2103;
 		}
 	} else if (who == 1) {
-		_field48 = 1104;
+		_field48_should = 1104;
 		digi_play(conv_sound_to_play(), 1, 255, 1, -1);
 	}
 }
 
+void Room702::syncGame(Common::Serializer &s) {
+	s.syncAsSint32LE(_field40);
+	s.syncAsSint32LE(_field44_mode);
+	s.syncAsSint32LE(_field48_should);
+	s.syncAsSint32LE(_field4C_triggerNum);
+	s.syncAsSint32LE(_field50_mode);
+	s.syncAsSint32LE(_field54_should);
+	s.syncAsSint32LE(_field58);
+}
 } // namespace Rooms
 } // namespace Riddle
 } // namespace M4
diff --git a/engines/m4/riddle/rooms/section7/room702.h b/engines/m4/riddle/rooms/section7/room702.h
index 6fccd920358..2fa2785d6af 100644
--- a/engines/m4/riddle/rooms/section7/room702.h
+++ b/engines/m4/riddle/rooms/section7/room702.h
@@ -38,19 +38,21 @@ public:
 	void pre_parser() override;
 	void parser() override;
 	void daemon() override;
+	void syncGame(Common::Serializer &s) override;
 
 private:
 	static void callback(frac16 myMessage, machine *sender);
 	void conv702a();
 
-	int32 _field3C = 0;
+	bool _alreadyBeen702Fl = false; // Unused : Set but never used
+
 	int32 _field40 = 0;
-	int32 _field44 = 0;
-	int32 _field48 = 0;
+	int32 _field44_mode = 0;
+	int32 _field48_should = 0;
 	int32 _field4C_triggerNum = 0;
-	int32 _field50 = 0;
-	int32 _field54 = 0;
-	int32 _field58 = 0;
+	int32 _field50_mode = 0;
+	int32 _field54_should = 0;
+	int32 _field58 = 0; // Useless (but synchronized?) - Always -1?
 
 	int32 _702GuardShadow1Series = 0;
 	int32 _702GuardShadow2Series = 0;


Commit: c4f0180e91fcdb2395db9c88472c2cd38dfda069
    https://github.com/scummvm/scummvm/commit/c4f0180e91fcdb2395db9c88472c2cd38dfda069
Author: Strangerke (arnaud.boutonne at gmail.com)
Date: 2024-11-25T09:51:38+01:00

Commit Message:
M4: RIDDLE: room 703 - Start working on room (preload, init, pre-parser, callback)

Changed paths:
    engines/m4/riddle/rooms/section7/room703.cpp
    engines/m4/riddle/rooms/section7/room703.h


diff --git a/engines/m4/riddle/rooms/section7/room703.cpp b/engines/m4/riddle/rooms/section7/room703.cpp
index db60eb67524..559fbe30475 100644
--- a/engines/m4/riddle/rooms/section7/room703.cpp
+++ b/engines/m4/riddle/rooms/section7/room703.cpp
@@ -21,18 +21,132 @@
 
 #include "m4/riddle/rooms/section7/room703.h"
 #include "m4/graphics/gr_series.h"
+#include "m4/gui/gui_vmng_screen.h"
 #include "m4/riddle/vars.h"
 
 namespace M4 {
 namespace Riddle {
 namespace Rooms {
 
+void Room703::preload() {
+	_G(player).walker_type = WALKER_ALT;
+	_G(player).shadow_type = SHADOW_ALT;
+	LoadWSAssets("OTHER SCRIPT", _G(master_palette));
+}
+
 void Room703::init() {
+	_ripTrekMedReachHandPos1Series = series_load("RIP TREK MED REACH HAND POS1", -1, nullptr);
+	digi_preload("950_S40", -1);
+	digi_preload("950_S40a", -1);
+
+	if (_G(flags[V224])) {
+		hotspot_set_active(_G(currentSceneDef).hotspots, "MONK #1", false);
+		hotspot_set_active(_G(currentSceneDef).hotspots, "MONK #2", false);
+		hotspot_set_active(_G(currentSceneDef).hotspots, "MONK #3", false);
+		hotspot_set_active(_G(currentSceneDef).hotspots, "MONK #4", false);
+		hotspot_set_active(_G(currentSceneDef).hotspots, "EMPTY NICHE", false);
+	}
+
+	switch (_G(game).previous_room) {
+	case KERNEL_RESTORING_GAME:
+		digi_preload("950_s39", -1);
+		break;
+
+	case 702:
+		if (!player_been_here(703)) {
+			_G(flags[V217]) = 3;
+			_G(flags[V218]) = 1;
+			_G(flags[V219]) = 5;
+			_G(flags[V220]) = 2;
+			_G(flags[V221]) = 4;
+		}
+
+		MoveScreenDelta(_G(game_buff_ptr), -320, 0);
+		ws_demand_location(_G(my_walker), 630, 450);
+		ws_demand_facing(_G(my_walker), 1);
+		ws_walk(_G(my_walker), 625, 357, nullptr, -1, 1, true);
+
+		break;
+
+	case 704:
+		MoveScreenDelta(_G(game_buff_ptr), -640, 0);
+		player_first_walk(1299, 300, 9, 1170, 318, 9, true);
+
+		break;
+
+	case 706:
+		player_first_walk(0, 300, 9, 130, 318, 8, true);
+		break;
+
+	case 707:
+		MoveScreenDelta(_G(game_buff_ptr), -320, 0);
+		ws_demand_location(_G(my_walker), 648, 358);
+		ws_demand_facing(_G(my_walker), 5);
+		player_set_commands_allowed(false);
+		ws_hide_walker(_G(my_walker));
+		_703RipGoesDownStairsSeries = series_load("703 RIP GOES DOWN STAIRS", -1, nullptr);
+		_ripStairsMach = TriggerMachineByHash(1, 1, 0, 0, 0, 0, 320, 0, 100, 0, false, callback, "rip stairs machine");
+		sendWSMessage_10000(1, _ripStairsMach, _703RipGoesDownStairsSeries, 4, 39, 140, _703RipGoesDownStairsSeries, 39, 39, 0);
+
+		break;
+
+	default:
+		digi_preload("950_s39");
+		player_first_walk(1299, 400, 10, 970, 318, 10, true);
+		break;
+	}
+
+	if (_G(flags[V217])) {
+		hotspot_set_active(_G(currentSceneDef).hotspots, "EMPTY NICHE", false);
+	} else {
+		hotspot_set_active(_G(currentSceneDef).hotspots, "PRAYER WHEEL #4", false);
+	}
+
+	switch (_G(flags[V217])) {
+	case 1:
+		_prayerWheelMach = series_place_sprite("703 PEACE PRAYER WHEEL", 0, 640, 0, 100, 1280);
+		break;
+
+	case 2:
+		_prayerWheelMach = series_place_sprite("703 INSIGHT PRAYER WHEEL", 0, 640, 0, 100, 1280);
+		break;
+
+	case 3:
+		_prayerWheelMach = series_place_sprite("703 SERENITY PRAYER WHEEL", 0, 640, 0, 100, 1280);
+		break;
+
+	case 4:
+		_prayerWheelMach = series_place_sprite("703 TRUTH PRAYER WHEEL", 0, 640, 0, 100, 1280);
+		break;
+
+	case 5:
+		_prayerWheelMach = series_place_sprite("703 WISDOM PRAYER WHEEL", 0, 640, 0, 100, 1280);
+		break;
+
+	default:
+		break;
+	}
+
+	digi_play_loop("950_s39", 3, 255, -1, -1);
+}
+
+void Room703::pre_parser() {
+	if (player_said("rm702") && (inv_player_has("WISDOM WHEEL") || inv_player_has("SERENITY WHEEL") || inv_player_has("PEACE WHEEL") || inv_player_has("INSIGHT WHEEL") || inv_player_has("TRUTH WHEEL"))) {
+		_G(player).need_to_walk = false;
+		_G(player).ready_to_walk = true;
+		_G(player).waiting_for_walk = false;
+	}
+}
+
+void Room703::parser() {
 }
 
 void Room703::daemon() {
 }
 
+void Room703::callback(frac16 myMessage, machine *sender) {
+	kernel_trigger_dispatchx(myMessage);
+}
 } // namespace Rooms
 } // namespace Riddle
 } // namespace M4
diff --git a/engines/m4/riddle/rooms/section7/room703.h b/engines/m4/riddle/rooms/section7/room703.h
index a1ecc331b59..b2b4bdf1ab7 100644
--- a/engines/m4/riddle/rooms/section7/room703.h
+++ b/engines/m4/riddle/rooms/section7/room703.h
@@ -33,8 +33,20 @@ public:
 	Room703() : Room() {}
 	~Room703() override {}
 
+	void preload() override;
 	void init() override;
+	void pre_parser() override;
+	void parser() override;
 	void daemon() override;
+
+private:
+	static void callback(frac16 myMessage, machine *sender);
+	
+	machine *_prayerWheelMach = nullptr;
+	machine *_ripStairsMach = nullptr;
+	
+	int32 _703RipGoesDownStairsSeries = 0;
+	int32 _ripTrekMedReachHandPos1Series = 0;
 };
 
 } // namespace Rooms




More information about the Scummvm-git-logs mailing list