From d3413715f3a116f2d7cc989643284ca022f42dff Mon Sep 17 00:00:00 2001 From: Jennifer Taylor Date: Tue, 2 Jan 2024 02:45:07 +0000 Subject: [PATCH] Add force unlock songs support to the rest of IIDX. --- bemani/backend/iidx/cannonballers.py | 41 +++++++++++++++++++++------- bemani/backend/iidx/copula.py | 41 +++++++++++++++++++++------- bemani/backend/iidx/pendual.py | 41 +++++++++++++++++++++------- bemani/backend/iidx/rootage.py | 41 +++++++++++++++++++++------- bemani/backend/iidx/sinobuz.py | 41 +++++++++++++++++++++------- bemani/backend/iidx/spada.py | 41 +++++++++++++++++++++------- 6 files changed, 186 insertions(+), 60 deletions(-) diff --git a/bemani/backend/iidx/cannonballers.py b/bemani/backend/iidx/cannonballers.py index 805621a..3f244f4 100644 --- a/bemani/backend/iidx/cannonballers.py +++ b/bemani/backend/iidx/cannonballers.py @@ -176,6 +176,12 @@ class IIDXCannonBallers(IIDXCourse, IIDXBase): "category": "game_config", "setting": "omnimix_events_enabled", }, + { + "name": "Force Song Unlock", + "tip": "Force unlock all songs.", + "category": "game_config", + "setting": "force_unlock_songs", + }, ], "ints": [ { @@ -1665,9 +1671,22 @@ class IIDXCannonBallers(IIDXCourse, IIDXBase): secret_dict = profile.get_dict("secret") secret = Node.void("secret") root.add_child(secret) - secret.add_child(Node.s64_array("flg1", secret_dict.get_int_array("flg1", 3))) - secret.add_child(Node.s64_array("flg2", secret_dict.get_int_array("flg2", 3))) - secret.add_child(Node.s64_array("flg3", secret_dict.get_int_array("flg3", 3))) + + game_config = self.get_game_config() + if game_config.get_bool("force_unlock_songs"): + secret.add_child(Node.s64_array("flg1", [-1, -1, -1])) + secret.add_child(Node.s64_array("flg2", [-1, -1, -1])) + secret.add_child(Node.s64_array("flg3", [-1, -1, -1])) + else: + secret.add_child( + Node.s64_array("flg1", secret_dict.get_int_array("flg1", 3)) + ) + secret.add_child( + Node.s64_array("flg2", secret_dict.get_int_array("flg2", 3)) + ) + secret.add_child( + Node.s64_array("flg3", secret_dict.get_int_array("flg3", 3)) + ) # Favorites for folder in ["favorite1", "favorite2", "favorite3"]: @@ -2240,13 +2259,15 @@ class IIDXCannonBallers(IIDXCourse, IIDXBase): newprofile.replace_dict("machine_judge_adjust", judge_dict) # Secret flags saving - secret = request.child("secret") - if secret is not None: - secret_dict = newprofile.get_dict("secret") - secret_dict.replace_int_array("flg1", 3, secret.child_value("flg1")) - secret_dict.replace_int_array("flg2", 3, secret.child_value("flg2")) - secret_dict.replace_int_array("flg3", 3, secret.child_value("flg3")) - newprofile.replace_dict("secret", secret_dict) + game_config = self.get_game_config() + if not game_config.get_bool("force_unlock_songs"): + secret = request.child("secret") + if secret is not None: + secret_dict = newprofile.get_dict("secret") + secret_dict.replace_int_array("flg1", 3, secret.child_value("flg1")) + secret_dict.replace_int_array("flg2", 3, secret.child_value("flg2")) + secret_dict.replace_int_array("flg3", 3, secret.child_value("flg3")) + newprofile.replace_dict("secret", secret_dict) # Basic achievements achievements = request.child("achievements") diff --git a/bemani/backend/iidx/copula.py b/bemani/backend/iidx/copula.py index 890afc6..08cc41a 100644 --- a/bemani/backend/iidx/copula.py +++ b/bemani/backend/iidx/copula.py @@ -173,6 +173,12 @@ class IIDXCopula(IIDXCourse, IIDXBase): "category": "game_config", "setting": "omnimix_events_enabled", }, + { + "name": "Force Song Unlock", + "tip": "Force unlock all songs.", + "category": "game_config", + "setting": "force_unlock_songs", + }, ], "ints": [ { @@ -1596,9 +1602,22 @@ class IIDXCopula(IIDXCourse, IIDXBase): secret_dict = profile.get_dict("secret") secret = Node.void("secret") root.add_child(secret) - secret.add_child(Node.s64_array("flg1", secret_dict.get_int_array("flg1", 4))) - secret.add_child(Node.s64_array("flg2", secret_dict.get_int_array("flg2", 4))) - secret.add_child(Node.s64_array("flg3", secret_dict.get_int_array("flg3", 4))) + + game_config = self.get_game_config() + if game_config.get_bool("force_unlock_songs"): + secret.add_child(Node.s64_array("flg1", [-1, -1, -1, -1])) + secret.add_child(Node.s64_array("flg2", [-1, -1, -1, -1])) + secret.add_child(Node.s64_array("flg3", [-1, -1, -1, -1])) + else: + secret.add_child( + Node.s64_array("flg1", secret_dict.get_int_array("flg1", 4)) + ) + secret.add_child( + Node.s64_array("flg2", secret_dict.get_int_array("flg2", 4)) + ) + secret.add_child( + Node.s64_array("flg3", secret_dict.get_int_array("flg3", 4)) + ) # Favorites for folder in ["favorite1", "favorite2", "favorite3"]: @@ -2119,13 +2138,15 @@ class IIDXCopula(IIDXCourse, IIDXBase): newprofile.replace_dict("machine_judge_adjust", judge_dict) # Secret flags saving - secret = request.child("secret") - if secret is not None: - secret_dict = newprofile.get_dict("secret") - secret_dict.replace_int_array("flg1", 4, secret.child_value("flg1")) - secret_dict.replace_int_array("flg2", 4, secret.child_value("flg2")) - secret_dict.replace_int_array("flg3", 4, secret.child_value("flg3")) - newprofile.replace_dict("secret", secret_dict) + game_config = self.get_game_config() + if not game_config.get_bool("force_unlock_songs"): + secret = request.child("secret") + if secret is not None: + secret_dict = newprofile.get_dict("secret") + secret_dict.replace_int_array("flg1", 4, secret.child_value("flg1")) + secret_dict.replace_int_array("flg2", 4, secret.child_value("flg2")) + secret_dict.replace_int_array("flg3", 4, secret.child_value("flg3")) + newprofile.replace_dict("secret", secret_dict) # Basic achievements achievements = request.child("achievements") diff --git a/bemani/backend/iidx/pendual.py b/bemani/backend/iidx/pendual.py index a94d7de..c6c2b1e 100644 --- a/bemani/backend/iidx/pendual.py +++ b/bemani/backend/iidx/pendual.py @@ -176,6 +176,12 @@ class IIDXPendual(IIDXCourse, IIDXBase): "category": "game_config", "setting": "omnimix_events_enabled", }, + { + "name": "Force Song Unlock", + "tip": "Force unlock all songs.", + "category": "game_config", + "setting": "force_unlock_songs", + }, ], "ints": [ { @@ -1598,9 +1604,22 @@ class IIDXPendual(IIDXCourse, IIDXBase): secret_dict = profile.get_dict("secret") secret = Node.void("secret") root.add_child(secret) - secret.add_child(Node.s64_array("flg1", secret_dict.get_int_array("flg1", 3))) - secret.add_child(Node.s64_array("flg2", secret_dict.get_int_array("flg2", 3))) - secret.add_child(Node.s64_array("flg3", secret_dict.get_int_array("flg3", 3))) + + game_config = self.get_game_config() + if game_config.get_bool("force_unlock_songs"): + secret.add_child(Node.s64_array("flg1", [-1, -1, -1])) + secret.add_child(Node.s64_array("flg2", [-1, -1, -1])) + secret.add_child(Node.s64_array("flg3", [-1, -1, -1])) + else: + secret.add_child( + Node.s64_array("flg1", secret_dict.get_int_array("flg1", 3)) + ) + secret.add_child( + Node.s64_array("flg2", secret_dict.get_int_array("flg2", 3)) + ) + secret.add_child( + Node.s64_array("flg3", secret_dict.get_int_array("flg3", 3)) + ) # Tran medals and shit achievements = Node.void("achievements") @@ -2094,13 +2113,15 @@ class IIDXPendual(IIDXCourse, IIDXBase): newprofile.replace_dict("machine_judge_adjust", judge_dict) # Secret flags saving - secret = request.child("secret") - if secret is not None: - secret_dict = newprofile.get_dict("secret") - secret_dict.replace_int_array("flg1", 3, secret.child_value("flg1")) - secret_dict.replace_int_array("flg2", 3, secret.child_value("flg2")) - secret_dict.replace_int_array("flg3", 3, secret.child_value("flg3")) - newprofile.replace_dict("secret", secret_dict) + game_config = self.get_game_config() + if not game_config.get_bool("force_unlock_songs"): + secret = request.child("secret") + if secret is not None: + secret_dict = newprofile.get_dict("secret") + secret_dict.replace_int_array("flg1", 3, secret.child_value("flg1")) + secret_dict.replace_int_array("flg2", 3, secret.child_value("flg2")) + secret_dict.replace_int_array("flg3", 3, secret.child_value("flg3")) + newprofile.replace_dict("secret", secret_dict) # Basic achievements achievements = request.child("achievements") diff --git a/bemani/backend/iidx/rootage.py b/bemani/backend/iidx/rootage.py index 68a2995..819207f 100644 --- a/bemani/backend/iidx/rootage.py +++ b/bemani/backend/iidx/rootage.py @@ -176,6 +176,12 @@ class IIDXRootage(IIDXCourse, IIDXBase): "category": "game_config", "setting": "omnimix_events_enabled", }, + { + "name": "Force Song Unlock", + "tip": "Force unlock all songs.", + "category": "game_config", + "setting": "force_unlock_songs", + }, ], "ints": [ { @@ -1350,9 +1356,22 @@ class IIDXRootage(IIDXCourse, IIDXBase): secret_dict = profile.get_dict("secret") secret = Node.void("secret") root.add_child(secret) - secret.add_child(Node.s64_array("flg1", secret_dict.get_int_array("flg1", 3))) - secret.add_child(Node.s64_array("flg2", secret_dict.get_int_array("flg2", 3))) - secret.add_child(Node.s64_array("flg3", secret_dict.get_int_array("flg3", 3))) + + game_config = self.get_game_config() + if game_config.get_bool("force_unlock_songs"): + secret.add_child(Node.s64_array("flg1", [-1, -1, -1])) + secret.add_child(Node.s64_array("flg2", [-1, -1, -1])) + secret.add_child(Node.s64_array("flg3", [-1, -1, -1])) + else: + secret.add_child( + Node.s64_array("flg1", secret_dict.get_int_array("flg1", 3)) + ) + secret.add_child( + Node.s64_array("flg2", secret_dict.get_int_array("flg2", 3)) + ) + secret.add_child( + Node.s64_array("flg3", secret_dict.get_int_array("flg3", 3)) + ) # Favorites for folder in ["favorite1", "favorite2", "favorite3"]: @@ -1982,13 +2001,15 @@ class IIDXRootage(IIDXCourse, IIDXBase): newprofile.replace_dict("machine_judge_adjust", judge_dict) # Secret flags saving - secret = request.child("secret") - if secret is not None: - secret_dict = newprofile.get_dict("secret") - secret_dict.replace_int_array("flg1", 3, secret.child_value("flg1")) - secret_dict.replace_int_array("flg2", 3, secret.child_value("flg2")) - secret_dict.replace_int_array("flg3", 3, secret.child_value("flg3")) - newprofile.replace_dict("secret", secret_dict) + game_config = self.get_game_config() + if not game_config.get_bool("force_unlock_songs"): + secret = request.child("secret") + if secret is not None: + secret_dict = newprofile.get_dict("secret") + secret_dict.replace_int_array("flg1", 3, secret.child_value("flg1")) + secret_dict.replace_int_array("flg2", 3, secret.child_value("flg2")) + secret_dict.replace_int_array("flg3", 3, secret.child_value("flg3")) + newprofile.replace_dict("secret", secret_dict) # Basic achievements achievements = request.child("achievements") diff --git a/bemani/backend/iidx/sinobuz.py b/bemani/backend/iidx/sinobuz.py index d4d26d9..0ce47e2 100644 --- a/bemani/backend/iidx/sinobuz.py +++ b/bemani/backend/iidx/sinobuz.py @@ -174,6 +174,12 @@ class IIDXSinobuz(IIDXCourse, IIDXBase): "category": "game_config", "setting": "omnimix_events_enabled", }, + { + "name": "Force Song Unlock", + "tip": "Force unlock all songs.", + "category": "game_config", + "setting": "force_unlock_songs", + }, ], "ints": [ { @@ -1609,9 +1615,22 @@ class IIDXSinobuz(IIDXCourse, IIDXBase): secret_dict = profile.get_dict("secret") secret = Node.void("secret") root.add_child(secret) - secret.add_child(Node.s64_array("flg1", secret_dict.get_int_array("flg1", 3))) - secret.add_child(Node.s64_array("flg2", secret_dict.get_int_array("flg2", 3))) - secret.add_child(Node.s64_array("flg3", secret_dict.get_int_array("flg3", 3))) + + game_config = self.get_game_config() + if game_config.get_bool("force_unlock_songs"): + secret.add_child(Node.s64_array("flg1", [-1, -1, -1])) + secret.add_child(Node.s64_array("flg2", [-1, -1, -1])) + secret.add_child(Node.s64_array("flg3", [-1, -1, -1])) + else: + secret.add_child( + Node.s64_array("flg1", secret_dict.get_int_array("flg1", 3)) + ) + secret.add_child( + Node.s64_array("flg2", secret_dict.get_int_array("flg2", 3)) + ) + secret.add_child( + Node.s64_array("flg3", secret_dict.get_int_array("flg3", 3)) + ) # Favorites for folder in ["favorite1", "favorite2", "favorite3"]: @@ -2174,13 +2193,15 @@ class IIDXSinobuz(IIDXCourse, IIDXBase): newprofile.replace_dict("machine_judge_adjust", judge_dict) # Secret flags saving - secret = request.child("secret") - if secret is not None: - secret_dict = newprofile.get_dict("secret") - secret_dict.replace_int_array("flg1", 3, secret.child_value("flg1")) - secret_dict.replace_int_array("flg2", 3, secret.child_value("flg2")) - secret_dict.replace_int_array("flg3", 3, secret.child_value("flg3")) - newprofile.replace_dict("secret", secret_dict) + game_config = self.get_game_config() + if not game_config.get_bool("force_unlock_songs"): + secret = request.child("secret") + if secret is not None: + secret_dict = newprofile.get_dict("secret") + secret_dict.replace_int_array("flg1", 3, secret.child_value("flg1")) + secret_dict.replace_int_array("flg2", 3, secret.child_value("flg2")) + secret_dict.replace_int_array("flg3", 3, secret.child_value("flg3")) + newprofile.replace_dict("secret", secret_dict) # Basic achievements achievements = request.child("achievements") diff --git a/bemani/backend/iidx/spada.py b/bemani/backend/iidx/spada.py index b4e4e9e..d90ca29 100644 --- a/bemani/backend/iidx/spada.py +++ b/bemani/backend/iidx/spada.py @@ -169,6 +169,12 @@ class IIDXSpada(IIDXBase): "category": "game_config", "setting": "omnimix_events_enabled", }, + { + "name": "Force Song Unlock", + "tip": "Force unlock all songs.", + "category": "game_config", + "setting": "force_unlock_songs", + }, ], "ints": [ { @@ -1255,9 +1261,22 @@ class IIDXSpada(IIDXBase): secret_dict = profile.get_dict("secret") secret = Node.void("secret") root.add_child(secret) - secret.add_child(Node.s64_array("flg1", secret_dict.get_int_array("flg1", 2))) - secret.add_child(Node.s64_array("flg2", secret_dict.get_int_array("flg2", 2))) - secret.add_child(Node.s64_array("flg3", secret_dict.get_int_array("flg3", 2))) + + game_config = self.get_game_config() + if game_config.get_bool("force_unlock_songs"): + secret.add_child(Node.s64_array("flg1", [-1, -1])) + secret.add_child(Node.s64_array("flg2", [-1, -1])) + secret.add_child(Node.s64_array("flg3", [-1, -1])) + else: + secret.add_child( + Node.s64_array("flg1", secret_dict.get_int_array("flg1", 2)) + ) + secret.add_child( + Node.s64_array("flg2", secret_dict.get_int_array("flg2", 2)) + ) + secret.add_child( + Node.s64_array("flg3", secret_dict.get_int_array("flg3", 2)) + ) # Tran medals and shit achievements = Node.void("achievements") @@ -1688,13 +1707,15 @@ class IIDXSpada(IIDXBase): newprofile.replace_dict("machine_judge_adjust", judge_dict) # Secret flags saving - secret = request.child("secret") - if secret is not None: - secret_dict = newprofile.get_dict("secret") - secret_dict.replace_int_array("flg1", 2, secret.child_value("flg1")) - secret_dict.replace_int_array("flg2", 2, secret.child_value("flg2")) - secret_dict.replace_int_array("flg3", 2, secret.child_value("flg3")) - newprofile.replace_dict("secret", secret_dict) + game_config = self.get_game_config() + if not game_config.get_bool("force_unlock_songs"): + secret = request.child("secret") + if secret is not None: + secret_dict = newprofile.get_dict("secret") + secret_dict.replace_int_array("flg1", 2, secret.child_value("flg1")) + secret_dict.replace_int_array("flg2", 2, secret.child_value("flg2")) + secret_dict.replace_int_array("flg3", 2, secret.child_value("flg3")) + newprofile.replace_dict("secret", secret_dict) # Basic achievements achievements = request.child("achievements")