diff --git a/config/template.json b/config/template.json index 76c31accb..27b7b2e80 100644 --- a/config/template.json +++ b/config/template.json @@ -164,6 +164,7 @@ }, "RoguePath": { "Path": "The_Hunt", + "DomainStrategy": "fight", "Bonus": "Blessing Cosmos", "PresetResonanceFilter": "preset-1", "ResonanceSelectionStrategy": "follow-presets", diff --git a/module/config/argument/args.json b/module/config/argument/args.json index 898d5a3a4..30c173349 100644 --- a/module/config/argument/args.json +++ b/module/config/argument/args.json @@ -1147,6 +1147,14 @@ "Elation" ] }, + "DomainStrategy": { + "type": "select", + "value": "fight", + "option": [ + "fight", + "leave" + ] + }, "Bonus": { "type": "select", "value": "Blessing Cosmos", diff --git a/module/config/argument/argument.yaml b/module/config/argument/argument.yaml index 7f0ead4ec..e020ba999 100644 --- a/module/config/argument/argument.yaml +++ b/module/config/argument/argument.yaml @@ -198,6 +198,9 @@ RoguePath: Path: value: The_Hunt option: [ Preservation, Remembrance, Nihility, Abundance, The_Hunt, Destruction, Elation ] + DomainStrategy: + value: fight + option: [ fight, leave ] Bonus: value: Blessing Cosmos option: [ Blessing Cosmos, Miracle Cosmos, Fragmented Cosmos ] diff --git a/module/config/config_generated.py b/module/config/config_generated.py index 5188ef7cc..c1c6ee40b 100644 --- a/module/config/config_generated.py +++ b/module/config/config_generated.py @@ -115,6 +115,7 @@ class GeneratedConfig: # Group `RoguePath` RoguePath_Path = 'The_Hunt' # Preservation, Remembrance, Nihility, Abundance, The_Hunt, Destruction, Elation + RoguePath_DomainStrategy = 'fight' # fight, leave RoguePath_Bonus = 'Blessing Cosmos' # Blessing Cosmos, Miracle Cosmos, Fragmented Cosmos RoguePath_PresetResonanceFilter = 'preset-1' # preset-1, custom RoguePath_ResonanceSelectionStrategy = 'follow-presets' # follow-presets, unrecorded-first, before-random diff --git a/module/config/i18n/en-US.json b/module/config/i18n/en-US.json index b47b1de74..1cac1902c 100644 --- a/module/config/i18n/en-US.json +++ b/module/config/i18n/en-US.json @@ -767,6 +767,12 @@ "Destruction": "Destruction", "Elation": "Elation" }, + "DomainStrategy": { + "name": "Domain Strategy", + "help": "Prefer Combat: Suitable for normal builds, longer clear time\nPrefer Occurrence: Require efficient builds, shorter clear time", + "fight": "Prefer Combat", + "leave": "Prefer Occurrence" + }, "Bonus": { "name": "Blessings of Trailblaze", "help": "", diff --git a/module/config/i18n/es-ES.json b/module/config/i18n/es-ES.json index 13216886d..6883386e3 100644 --- a/module/config/i18n/es-ES.json +++ b/module/config/i18n/es-ES.json @@ -767,6 +767,12 @@ "Destruction": "Destrucción", "Elation": "Exultación" }, + "DomainStrategy": { + "name": "Estrategia de dominio", + "help": "Prefiero Batalla: Adecuado para configuraciones normales, tiempo de eliminación más prolongado\\Prefiero Evento: Requiere configuraciones eficientes, tiempo de eliminación más corto", + "fight": "Prefiero Batalla", + "leave": "Prefiero Evento" + }, "Bonus": { "name": "Bendiciones", "help": "", diff --git a/module/config/i18n/ja-JP.json b/module/config/i18n/ja-JP.json index fa0474152..d65e40e13 100644 --- a/module/config/i18n/ja-JP.json +++ b/module/config/i18n/ja-JP.json @@ -767,6 +767,12 @@ "Destruction": "Destruction", "Elation": "Elation" }, + "DomainStrategy": { + "name": "RoguePath.DomainStrategy.name", + "help": "RoguePath.DomainStrategy.help", + "fight": "fight", + "leave": "leave" + }, "Bonus": { "name": "RoguePath.Bonus.name", "help": "RoguePath.Bonus.help", diff --git a/module/config/i18n/zh-CN.json b/module/config/i18n/zh-CN.json index b60cd00bc..246958b77 100644 --- a/module/config/i18n/zh-CN.json +++ b/module/config/i18n/zh-CN.json @@ -767,6 +767,12 @@ "Destruction": "毁灭", "Elation": "欢愉" }, + "DomainStrategy": { + "name": "区域策略", + "help": "偏好战斗:适用于平民队伍,通关时间较长\n偏好事件:需要高练队伍,通关时间较短", + "fight": "偏好战斗", + "leave": "偏好事件" + }, "Bonus": { "name": "开拓祝福三选一", "help": "", diff --git a/module/config/i18n/zh-TW.json b/module/config/i18n/zh-TW.json index 542cc5be7..59e48e6f3 100644 --- a/module/config/i18n/zh-TW.json +++ b/module/config/i18n/zh-TW.json @@ -767,6 +767,12 @@ "Destruction": "毀滅", "Elation": "歡愉" }, + "DomainStrategy": { + "name": "區域策略", + "help": "偏好戰鬥:適用於平民隊伍,通關時間較長\n偏好事件:需要高練隊伍,通關時間較短", + "fight": "偏好戰鬥", + "leave": "偏好事件" + }, "Bonus": { "name": "開拓祝福三選一", "help": "", diff --git a/tasks/rogue/event/event.py b/tasks/rogue/event/event.py index b82a49509..1b5e9ce5b 100644 --- a/tasks/rogue/event/event.py +++ b/tasks/rogue/event/event.py @@ -1,3 +1,4 @@ +from module.base.button import ClickButton from module.base.utils import area_limit from module.logger import logger from tasks.rogue.assets.assets_rogue_event import CHOOSE_OPTION, CHOOSE_OPTION_CONFIRM, CHOOSE_STORY, OCR_EVENT @@ -39,5 +40,14 @@ class RogueEvent(RogueUI): self.interval_reset(CHOOSE_OPTION) return True - # ocr, OCR_EVENT + if self.interval_is_reached(CHOOSE_OPTION, interval=2): + option = self._event_option_filter(options) + self.device.click(option) + self.interval_reset(CHOOSE_OPTION) + return True + return False + + def _event_option_filter(self, options: list[ClickButton]) -> ClickButton: + # TODO: OCR options instead of choosing the last one + return options[-1]