From e1bc62f1de5828c9fb52b6f4981d4e86ad4b8554 Mon Sep 17 00:00:00 2001 From: 0O0o0oOoO00 <11174151+0O0o0oOoO00@users.noreply.github.com> Date: Sun, 16 Nov 2025 21:08:10 +0800 Subject: [PATCH] add: flexible action point upper limit when running OpsiHazard1Leveling --- config/template.json | 1 + module/config/argument/args.json | 4 ++++ module/config/argument/argument.yaml | 1 + module/config/config_generated.py | 1 + module/config/full_config_generated.py | 1 + module/config/i18n/en-US.json | 4 ++++ module/config/i18n/ja-JP.json | 4 ++++ module/config/i18n/zh-CN.json | 4 ++++ module/config/i18n/zh-TW.json | 4 ++++ module/os/operation_siren.py | 3 ++- 10 files changed, 26 insertions(+), 1 deletion(-) diff --git a/config/template.json b/config/template.json index 997edd295..856973bba 100644 --- a/config/template.json +++ b/config/template.json @@ -2631,6 +2631,7 @@ }, "OpsiHazard1Leveling": { "HigherPriority": false, + "ActionPointUpperLimit": 3000, "NoOpsiMeowfficerFarming": false, "NoYellowCoinLimit": false, "TargetZone": 0 diff --git a/module/config/argument/args.json b/module/config/argument/args.json index c16cfe99d..7a49263b8 100644 --- a/module/config/argument/args.json +++ b/module/config/argument/args.json @@ -16834,6 +16834,10 @@ "type": "checkbox", "value": false }, + "ActionPointUpperLimit": { + "type": "input", + "value": 3000 + }, "NoOpsiMeowfficerFarming": { "type": "checkbox", "value": false diff --git a/module/config/argument/argument.yaml b/module/config/argument/argument.yaml index 0b7fd72e0..2eeee658c 100644 --- a/module/config/argument/argument.yaml +++ b/module/config/argument/argument.yaml @@ -744,6 +744,7 @@ OpsiMeowfficerFarming: value: 0 OpsiHazard1Leveling: HigherPriority: false + ActionPointUpperLimit: 3000 NoOpsiMeowfficerFarming: false NoYellowCoinLimit: false TargetZone: diff --git a/module/config/config_generated.py b/module/config/config_generated.py index c51175c1a..910dc30bf 100644 --- a/module/config/config_generated.py +++ b/module/config/config_generated.py @@ -445,6 +445,7 @@ class GeneratedConfig: # Group `OpsiHazard1Leveling` OpsiHazard1Leveling_HigherPriority = False + OpsiHazard1Leveling_ActionPointUpperLimit = 3000 OpsiHazard1Leveling_NoOpsiMeowfficerFarming = False OpsiHazard1Leveling_NoYellowCoinLimit = False OpsiHazard1Leveling_TargetZone = 0 # 0, 44, 22 diff --git a/module/config/full_config_generated.py b/module/config/full_config_generated.py index fc8b091b8..1e11513d7 100644 --- a/module/config/full_config_generated.py +++ b/module/config/full_config_generated.py @@ -1910,6 +1910,7 @@ class FullGeneratedConfig: OpsiHazard1Leveling_Scheduler_FailureInterval = None OpsiHazard1Leveling_Scheduler_ServerUpdate = None OpsiHazard1Leveling_OpsiHazard1Leveling_HigherPriority = None + OpsiHazard1Leveling_OpsiHazard1Leveling_ActionPointUpperLimit = None OpsiHazard1Leveling_OpsiHazard1Leveling_NoOpsiMeowfficerFarming = None OpsiHazard1Leveling_OpsiHazard1Leveling_NoYellowCoinLimit = None OpsiHazard1Leveling_OpsiHazard1Leveling_TargetZone = None diff --git a/module/config/i18n/en-US.json b/module/config/i18n/en-US.json index c0f9fca25..f702d7bd3 100644 --- a/module/config/i18n/en-US.json +++ b/module/config/i18n/en-US.json @@ -2633,6 +2633,10 @@ "name": "OpsiHazard1Leveling.HigherPriority.name", "help": "OpsiHazard1Leveling.HigherPriority.help" }, + "ActionPointUpperLimit": { + "name": "OpsiHazard1Leveling.ActionPointUpperLimit.name", + "help": "OpsiHazard1Leveling.ActionPointUpperLimit.help" + }, "NoOpsiMeowfficerFarming": { "name": "OpsiHazard1Leveling.NoOpsiMeowfficerFarming.name", "help": "OpsiHazard1Leveling.NoOpsiMeowfficerFarming.help" diff --git a/module/config/i18n/ja-JP.json b/module/config/i18n/ja-JP.json index e5a9d5a6b..99bf45403 100644 --- a/module/config/i18n/ja-JP.json +++ b/module/config/i18n/ja-JP.json @@ -2633,6 +2633,10 @@ "name": "OpsiHazard1Leveling.HigherPriority.name", "help": "OpsiHazard1Leveling.HigherPriority.help" }, + "ActionPointUpperLimit": { + "name": "OpsiHazard1Leveling.ActionPointUpperLimit.name", + "help": "OpsiHazard1Leveling.ActionPointUpperLimit.help" + }, "NoOpsiMeowfficerFarming": { "name": "OpsiHazard1Leveling.NoOpsiMeowfficerFarming.name", "help": "OpsiHazard1Leveling.NoOpsiMeowfficerFarming.help" diff --git a/module/config/i18n/zh-CN.json b/module/config/i18n/zh-CN.json index 2f8480495..0b4e933c4 100644 --- a/module/config/i18n/zh-CN.json +++ b/module/config/i18n/zh-CN.json @@ -2633,6 +2633,10 @@ "name": "更高优先级", "help": "开启后会将优先级调整到紧急委托前面" }, + "ActionPointUpperLimit": { + "name": "行动力超过 X 后执行短猫", + "help": "" + }, "NoOpsiMeowfficerFarming": { "name": "不启动短猫", "help": "" diff --git a/module/config/i18n/zh-TW.json b/module/config/i18n/zh-TW.json index 335c49ac3..2504ef634 100644 --- a/module/config/i18n/zh-TW.json +++ b/module/config/i18n/zh-TW.json @@ -2633,6 +2633,10 @@ "name": "OpsiHazard1Leveling.HigherPriority.name", "help": "OpsiHazard1Leveling.HigherPriority.help" }, + "ActionPointUpperLimit": { + "name": "OpsiHazard1Leveling.ActionPointUpperLimit.name", + "help": "OpsiHazard1Leveling.ActionPointUpperLimit.help" + }, "NoOpsiMeowfficerFarming": { "name": "OpsiHazard1Leveling.NoOpsiMeowfficerFarming.name", "help": "OpsiHazard1Leveling.NoOpsiMeowfficerFarming.help" diff --git a/module/os/operation_siren.py b/module/os/operation_siren.py index 7e0d0b164..e8cb32c18 100644 --- a/module/os/operation_siren.py +++ b/module/os/operation_siren.py @@ -902,6 +902,7 @@ class OperationSiren(OperationSiren): full_config = self.config.full_config no_opsi_meowfficer_farming = full_config.OpsiHazard1Leveling_OpsiHazard1Leveling_NoOpsiMeowfficerFarming no_yellow_coin_limit = full_config.OpsiHazard1Leveling_OpsiHazard1Leveling_NoYellowCoinLimit + action_point_upper_limit = full_config.OpsiHazard1Leveling_OpsiHazard1Leveling_ActionPointUpperLimit if no_opsi_meowfficer_farming: logger.info(f"No OpsiMeowfficerFarming is enabled in OpsiHazard1Leveling") @@ -936,7 +937,7 @@ class OperationSiren(OperationSiren): if self.config.OpsiGeneral_BuyActionPointLimit > 0: keep_current_ap = False self.action_point_set(cost=70, keep_current_ap=keep_current_ap, check_rest_ap=True) - if self._action_point_total >= 3000 and not no_opsi_meowfficer_farming: + if self._action_point_total >= action_point_upper_limit and not no_opsi_meowfficer_farming: with self.config.multi_set(): self.config.task_delay(server_update=True) if not self.is_in_opsi_explore():