From bb8a6d6044db936cf17bef519af121dfc574b22e Mon Sep 17 00:00:00 2001 From: positnuec <93694981+positnuec@users.noreply.github.com> Date: Thu, 2 Jul 2026 17:47:24 +0800 Subject: [PATCH] Refactor: separate submarine_mode for clearer semantics --- config/template.json | 36 ++- module/combat/auto_search_combat.py | 6 +- module/combat/combat.py | 16 +- module/combat/submarine.py | 18 +- module/config/argument/args.json | 336 ++++++++++++++++---------- module/config/argument/argument.yaml | 9 +- module/config/config_generated.py | 3 +- module/config/config_updater.py | 12 + module/config/i18n/en-US.json | 24 +- module/config/i18n/ja-JP.json | 56 +++-- module/config/i18n/zh-CN.json | 26 +- module/config/i18n/zh-TW.json | 24 +- module/config/redirect_utils/utils.py | 14 ++ module/handler/fast_forward.py | 2 +- module/handler/strategy.py | 2 +- module/map/fleet.py | 13 +- module/os/map.py | 2 +- module/os_combat/combat.py | 2 +- module/raid/raid.py | 2 +- 19 files changed, 364 insertions(+), 239 deletions(-) diff --git a/config/template.json b/config/template.json index 97b2eae14..6c141dbcc 100644 --- a/config/template.json +++ b/config/template.json @@ -191,8 +191,9 @@ "Submarine": { "Fleet": 0, "AutoRecommend": false, - "Mode": "do_not_use", "AutoSearchMode": "sub_standby", + "HuntMode": "do_not_use", + "CallMode": "do_not_use", "DistanceToBoss": "2_grid_to_boss" }, "Emotion": { @@ -269,8 +270,9 @@ "Submarine": { "Fleet": 0, "AutoRecommend": false, - "Mode": "do_not_use", "AutoSearchMode": "sub_standby", + "HuntMode": "do_not_use", + "CallMode": "do_not_use", "DistanceToBoss": "2_grid_to_boss" }, "Emotion": { @@ -347,8 +349,9 @@ "Submarine": { "Fleet": 0, "AutoRecommend": false, - "Mode": "do_not_use", "AutoSearchMode": "sub_standby", + "HuntMode": "do_not_use", + "CallMode": "do_not_use", "DistanceToBoss": "2_grid_to_boss" }, "Emotion": { @@ -438,8 +441,9 @@ "Submarine": { "Fleet": 0, "AutoRecommend": false, - "Mode": "do_not_use", "AutoSearchMode": "sub_standby", + "HuntMode": "do_not_use", + "CallMode": "do_not_use", "DistanceToBoss": "2_grid_to_boss" }, "Emotion": { @@ -517,8 +521,9 @@ "Submarine": { "Fleet": 0, "AutoRecommend": false, - "Mode": "do_not_use", "AutoSearchMode": "sub_standby", + "HuntMode": "do_not_use", + "CallMode": "do_not_use", "DistanceToBoss": "2_grid_to_boss" }, "Emotion": { @@ -595,8 +600,9 @@ "Submarine": { "Fleet": 0, "AutoRecommend": false, - "Mode": "do_not_use", "AutoSearchMode": "sub_standby", + "HuntMode": "do_not_use", + "CallMode": "do_not_use", "DistanceToBoss": "2_grid_to_boss" }, "Emotion": { @@ -833,8 +839,9 @@ "Submarine": { "Fleet": 0, "AutoRecommend": false, - "Mode": "do_not_use", "AutoSearchMode": "sub_standby", + "HuntMode": "do_not_use", + "CallMode": "do_not_use", "DistanceToBoss": "2_grid_to_boss" }, "Emotion": { @@ -915,8 +922,9 @@ "Submarine": { "Fleet": 0, "AutoRecommend": false, - "Mode": "do_not_use", "AutoSearchMode": "sub_standby", + "HuntMode": "do_not_use", + "CallMode": "do_not_use", "DistanceToBoss": "2_grid_to_boss" }, "Emotion": { @@ -997,8 +1005,9 @@ "Submarine": { "Fleet": 0, "AutoRecommend": false, - "Mode": "do_not_use", "AutoSearchMode": "sub_standby", + "HuntMode": "do_not_use", + "CallMode": "do_not_use", "DistanceToBoss": "2_grid_to_boss" }, "Emotion": { @@ -1079,8 +1088,9 @@ "Submarine": { "Fleet": 0, "AutoRecommend": false, - "Mode": "do_not_use", "AutoSearchMode": "sub_standby", + "HuntMode": "do_not_use", + "CallMode": "do_not_use", "DistanceToBoss": "2_grid_to_boss" }, "Emotion": { @@ -1161,8 +1171,9 @@ "Submarine": { "Fleet": 0, "AutoRecommend": false, - "Mode": "do_not_use", "AutoSearchMode": "sub_standby", + "HuntMode": "do_not_use", + "CallMode": "do_not_use", "DistanceToBoss": "2_grid_to_boss" }, "Emotion": { @@ -1239,8 +1250,9 @@ "Submarine": { "Fleet": 0, "AutoRecommend": false, - "Mode": "do_not_use", "AutoSearchMode": "sub_standby", + "HuntMode": "do_not_use", + "CallMode": "do_not_use", "DistanceToBoss": "2_grid_to_boss" }, "Emotion": { diff --git a/module/combat/auto_search_combat.py b/module/combat/auto_search_combat.py index 36d97edd4..c83dd2962 100644 --- a/module/combat/auto_search_combat.py +++ b/module/combat/auto_search_combat.py @@ -343,8 +343,8 @@ class AutoSearchCombat(MapOperation, Combat, CampaignStatus): self.submarine_call_reset() submarine_mode = 'do_not_use' if self.config.Submarine_Fleet: - submarine_mode = self.config.Submarine_Mode - force_call = battle[0] == battle[1] - 1 if battle is not None else False + submarine_mode = self.config.Submarine_CallMode + is_boss = battle[0] == battle[1] - 1 if battle is not None else False self.combat_auto_reset() self.combat_manual_reset() self.device.stuck_record_clear() @@ -358,7 +358,7 @@ class AutoSearchCombat(MapOperation, Combat, CampaignStatus): exp_confirm_timer = Timer(1, count=2) for _ in self.loop(): - if self.handle_submarine_call(submarine_mode, call=force_call): + if self.handle_submarine_call(call_mode=submarine_mode, is_boss=is_boss): continue if self.handle_combat_auto(auto): continue diff --git a/module/combat/combat.py b/module/combat/combat.py index 40f76a324..675308250 100644 --- a/module/combat/combat.py +++ b/module/combat/combat.py @@ -348,11 +348,12 @@ class Combat(Level, HPBalancer, Retirement, SubmarineCall, CombatAuto, CombatMan return False - def combat_execute(self, auto='combat_auto', submarine='do_not_use', drop=None): + def combat_execute(self, auto='combat_auto', submarine='do_not_use', is_boss=False, drop=None): """ Args: auto (str): ['combat_auto', 'combat_manual', 'stand_still_in_the_middle', 'hide_in_bottom_left'] - submarine (str): ['do_not_use', 'hunt_only', 'every_combat'] + submarine (str): do_not_use, boss_only, every_combat + is_boss (bool): True on BOSS battle drop (DropImage): """ logger.info('Combat execute') @@ -379,7 +380,7 @@ class Combat(Level, HPBalancer, Retirement, SubmarineCall, CombatAuto, CombatMan if auto != 'combat_auto' and self.auto_mode_checked and self.is_combat_executing(): if self.handle_combat_weapon_release(): continue - if self.handle_submarine_call(submarine): + if self.handle_submarine_call(call_mode=submarine, is_boss=is_boss): continue # bunch of popup handlers if self.handle_popup_confirm('COMBAT_EXECUTE'): @@ -629,7 +630,7 @@ class Combat(Level, HPBalancer, Retirement, SubmarineCall, CombatAuto, CombatMan if self.handle_in_map_with_enemy_searching(drop=drop): break - def combat(self, balance_hp=None, emotion_reduce=None, auto_mode=None, submarine_mode=None, + def combat(self, balance_hp=None, emotion_reduce=None, auto_mode=None, submarine_mode=None, is_boss=False, save_get_items=None, expected_end=None, fleet_index=1): """ Execute a combat. @@ -639,7 +640,8 @@ class Combat(Level, HPBalancer, Retirement, SubmarineCall, CombatAuto, CombatMan balance_hp (bool): emotion_reduce (bool): auto_mode (str): combat_auto, combat_manual, stand_still_in_the_middle, hide_in_bottom_left - submarine_mode (str): do_not_use, hunt_only, every_combat + submarine_mode (str): do_not_use, boss_only, every_combat + is_boss (bool): True on BOSS battle save_get_items (bool, DropImage): expected_end (str, callable): fleet_index (int): 1 or 2 @@ -651,7 +653,7 @@ class Combat(Level, HPBalancer, Retirement, SubmarineCall, CombatAuto, CombatMan if submarine_mode is None: submarine_mode = 'do_not_use' if self.config.Submarine_Fleet: - submarine_mode = self.config.Submarine_Mode + submarine_mode = self.config.Submarine_CallMode self.battle_status_click_interval = 7 if save_get_items else 0 # if not hasattr(self, 'emotion'): @@ -667,7 +669,7 @@ class Combat(Level, HPBalancer, Retirement, SubmarineCall, CombatAuto, CombatMan self.combat_preparation( balance_hp=balance_hp, emotion_reduce=emotion_reduce, auto=auto_mode, fleet_index=fleet_index) self.combat_execute( - auto=auto_mode, submarine=submarine_mode, drop=drop) + auto=auto_mode, submarine=submarine_mode, drop=drop, is_boss=is_boss) self.combat_status( drop=drop, expected_end=expected_end) # self.handle_map_after_combat_story() diff --git a/module/combat/submarine.py b/module/combat/submarine.py index 7d1e2797f..5be0a155b 100644 --- a/module/combat/submarine.py +++ b/module/combat/submarine.py @@ -16,19 +16,21 @@ class SubmarineCall(ModuleBase): self.submarine_call_timer.reset() self.submarine_call_flag = False - def handle_submarine_call(self, submarine='do_not_use', call=False): + def handle_submarine_call(self, call_mode='do_not_use', is_boss=False): """ + Args: + call_mode (str): do_not_use, boss_only, every_combat + is_boss (bool): True on BOSS battle + Returns: - str: If call. + bool: If clicked submarine call button. """ if self.submarine_call_flag: return False - if call and submarine == 'boss_only': - pass - else: - if submarine in ['do_not_use', 'hunt_only', 'boss_only', 'hunt_and_boss']: - self.submarine_call_flag = True - return False + if call_mode == 'do_not_use' or (call_mode == 'boss_only' and not is_boss): + self.submarine_call_flag = True + return False + if self.submarine_call_timer.reached(): logger.info('Submarine call timer reached') self.submarine_call_flag = True diff --git a/module/config/argument/args.json b/module/config/argument/args.json index 805fc8cef..642cded13 100644 --- a/module/config/argument/args.json +++ b/module/config/argument/args.json @@ -896,17 +896,6 @@ "type": "checkbox", "value": false }, - "Mode": { - "type": "select", - "value": "do_not_use", - "option": [ - "do_not_use", - "hunt_only", - "boss_only", - "hunt_and_boss", - "every_combat" - ] - }, "AutoSearchMode": { "type": "select", "value": "sub_standby", @@ -915,6 +904,23 @@ "sub_auto_call" ] }, + "HuntMode": { + "type": "select", + "value": "do_not_use", + "option": [ + "do_not_use", + "hunt" + ] + }, + "CallMode": { + "type": "select", + "value": "do_not_use", + "option": [ + "do_not_use", + "boss_only", + "every_combat" + ] + }, "DistanceToBoss": { "type": "select", "value": "2_grid_to_boss", @@ -1292,17 +1298,6 @@ "type": "checkbox", "value": false }, - "Mode": { - "type": "select", - "value": "do_not_use", - "option": [ - "do_not_use", - "hunt_only", - "boss_only", - "hunt_and_boss", - "every_combat" - ] - }, "AutoSearchMode": { "type": "select", "value": "sub_standby", @@ -1311,6 +1306,23 @@ "sub_auto_call" ] }, + "HuntMode": { + "type": "select", + "value": "do_not_use", + "option": [ + "do_not_use", + "hunt" + ] + }, + "CallMode": { + "type": "select", + "value": "do_not_use", + "option": [ + "do_not_use", + "boss_only", + "every_combat" + ] + }, "DistanceToBoss": { "type": "select", "value": "2_grid_to_boss", @@ -1688,17 +1700,6 @@ "type": "checkbox", "value": false }, - "Mode": { - "type": "select", - "value": "do_not_use", - "option": [ - "do_not_use", - "hunt_only", - "boss_only", - "hunt_and_boss", - "every_combat" - ] - }, "AutoSearchMode": { "type": "select", "value": "sub_standby", @@ -1707,6 +1708,23 @@ "sub_auto_call" ] }, + "HuntMode": { + "type": "select", + "value": "do_not_use", + "option": [ + "do_not_use", + "hunt" + ] + }, + "CallMode": { + "type": "select", + "value": "do_not_use", + "option": [ + "do_not_use", + "boss_only", + "every_combat" + ] + }, "DistanceToBoss": { "type": "select", "value": "2_grid_to_boss", @@ -2184,17 +2202,6 @@ "type": "checkbox", "value": false }, - "Mode": { - "type": "select", - "value": "do_not_use", - "option": [ - "do_not_use", - "hunt_only", - "boss_only", - "hunt_and_boss", - "every_combat" - ] - }, "AutoSearchMode": { "type": "select", "value": "sub_standby", @@ -2203,6 +2210,23 @@ "sub_auto_call" ] }, + "HuntMode": { + "type": "select", + "value": "do_not_use", + "option": [ + "do_not_use", + "hunt" + ] + }, + "CallMode": { + "type": "select", + "value": "do_not_use", + "option": [ + "do_not_use", + "boss_only", + "every_combat" + ] + }, "DistanceToBoss": { "type": "select", "value": "2_grid_to_boss", @@ -2596,17 +2620,6 @@ "type": "checkbox", "value": false }, - "Mode": { - "type": "select", - "value": "do_not_use", - "option": [ - "do_not_use", - "hunt_only", - "boss_only", - "hunt_and_boss", - "every_combat" - ] - }, "AutoSearchMode": { "type": "select", "value": "sub_standby", @@ -2615,6 +2628,23 @@ "sub_auto_call" ] }, + "HuntMode": { + "type": "select", + "value": "do_not_use", + "option": [ + "do_not_use", + "hunt" + ] + }, + "CallMode": { + "type": "select", + "value": "do_not_use", + "option": [ + "do_not_use", + "boss_only", + "every_combat" + ] + }, "DistanceToBoss": { "type": "select", "value": "2_grid_to_boss", @@ -3010,17 +3040,6 @@ "type": "checkbox", "value": false }, - "Mode": { - "type": "select", - "value": "do_not_use", - "option": [ - "do_not_use", - "hunt_only", - "boss_only", - "hunt_and_boss", - "every_combat" - ] - }, "AutoSearchMode": { "type": "select", "value": "sub_standby", @@ -3029,6 +3048,23 @@ "sub_auto_call" ] }, + "HuntMode": { + "type": "select", + "value": "do_not_use", + "option": [ + "do_not_use", + "hunt" + ] + }, + "CallMode": { + "type": "select", + "value": "do_not_use", + "option": [ + "do_not_use", + "boss_only", + "every_combat" + ] + }, "DistanceToBoss": { "type": "select", "value": "2_grid_to_boss", @@ -4412,17 +4448,6 @@ "type": "checkbox", "value": false }, - "Mode": { - "type": "select", - "value": "do_not_use", - "option": [ - "do_not_use", - "hunt_only", - "boss_only", - "hunt_and_boss", - "every_combat" - ] - }, "AutoSearchMode": { "type": "select", "value": "sub_standby", @@ -4431,6 +4456,23 @@ "sub_auto_call" ] }, + "HuntMode": { + "type": "select", + "value": "do_not_use", + "option": [ + "do_not_use", + "hunt" + ] + }, + "CallMode": { + "type": "select", + "value": "do_not_use", + "option": [ + "do_not_use", + "boss_only", + "every_combat" + ] + }, "DistanceToBoss": { "type": "select", "value": "2_grid_to_boss", @@ -4844,17 +4886,6 @@ "type": "checkbox", "value": false }, - "Mode": { - "type": "select", - "value": "do_not_use", - "option": [ - "do_not_use", - "hunt_only", - "boss_only", - "hunt_and_boss", - "every_combat" - ] - }, "AutoSearchMode": { "type": "select", "value": "sub_standby", @@ -4863,6 +4894,23 @@ "sub_auto_call" ] }, + "HuntMode": { + "type": "select", + "value": "do_not_use", + "option": [ + "do_not_use", + "hunt" + ] + }, + "CallMode": { + "type": "select", + "value": "do_not_use", + "option": [ + "do_not_use", + "boss_only", + "every_combat" + ] + }, "DistanceToBoss": { "type": "select", "value": "2_grid_to_boss", @@ -5276,17 +5324,6 @@ "type": "checkbox", "value": false }, - "Mode": { - "type": "select", - "value": "do_not_use", - "option": [ - "do_not_use", - "hunt_only", - "boss_only", - "hunt_and_boss", - "every_combat" - ] - }, "AutoSearchMode": { "type": "select", "value": "sub_standby", @@ -5295,6 +5332,23 @@ "sub_auto_call" ] }, + "HuntMode": { + "type": "select", + "value": "do_not_use", + "option": [ + "do_not_use", + "hunt" + ] + }, + "CallMode": { + "type": "select", + "value": "do_not_use", + "option": [ + "do_not_use", + "boss_only", + "every_combat" + ] + }, "DistanceToBoss": { "type": "select", "value": "2_grid_to_boss", @@ -5708,17 +5762,6 @@ "type": "checkbox", "value": false }, - "Mode": { - "type": "select", - "value": "do_not_use", - "option": [ - "do_not_use", - "hunt_only", - "boss_only", - "hunt_and_boss", - "every_combat" - ] - }, "AutoSearchMode": { "type": "select", "value": "sub_standby", @@ -5727,6 +5770,23 @@ "sub_auto_call" ] }, + "HuntMode": { + "type": "select", + "value": "do_not_use", + "option": [ + "do_not_use", + "hunt" + ] + }, + "CallMode": { + "type": "select", + "value": "do_not_use", + "option": [ + "do_not_use", + "boss_only", + "every_combat" + ] + }, "DistanceToBoss": { "type": "select", "value": "2_grid_to_boss", @@ -6140,17 +6200,6 @@ "type": "checkbox", "value": false }, - "Mode": { - "type": "select", - "value": "do_not_use", - "option": [ - "do_not_use", - "hunt_only", - "boss_only", - "hunt_and_boss", - "every_combat" - ] - }, "AutoSearchMode": { "type": "select", "value": "sub_standby", @@ -6159,6 +6208,23 @@ "sub_auto_call" ] }, + "HuntMode": { + "type": "select", + "value": "do_not_use", + "option": [ + "do_not_use", + "hunt" + ] + }, + "CallMode": { + "type": "select", + "value": "do_not_use", + "option": [ + "do_not_use", + "boss_only", + "every_combat" + ] + }, "DistanceToBoss": { "type": "select", "value": "2_grid_to_boss", @@ -6562,17 +6628,6 @@ "type": "checkbox", "value": false }, - "Mode": { - "type": "select", - "value": "do_not_use", - "option": [ - "do_not_use", - "hunt_only", - "boss_only", - "hunt_and_boss", - "every_combat" - ] - }, "AutoSearchMode": { "type": "select", "value": "sub_standby", @@ -6582,6 +6637,23 @@ ], "display": "hide" }, + "HuntMode": { + "type": "select", + "value": "do_not_use", + "option": [ + "do_not_use", + "hunt" + ] + }, + "CallMode": { + "type": "select", + "value": "do_not_use", + "option": [ + "do_not_use", + "boss_only", + "every_combat" + ] + }, "DistanceToBoss": { "type": "select", "value": "2_grid_to_boss", diff --git a/module/config/argument/argument.yaml b/module/config/argument/argument.yaml index 4bf3b17e6..0e1522a09 100644 --- a/module/config/argument/argument.yaml +++ b/module/config/argument/argument.yaml @@ -213,12 +213,15 @@ Submarine: value: 0 option: [ 0, 1, 2 ] AutoRecommend: false - Mode: - value: do_not_use - option: [ do_not_use, hunt_only, boss_only, hunt_and_boss, every_combat ] AutoSearchMode: value: sub_standby option: [ sub_standby, sub_auto_call ] + HuntMode: + value: do_not_use + option: [ do_not_use, hunt ] + CallMode: + value: do_not_use + option: [ do_not_use, boss_only, every_combat ] DistanceToBoss: value: '2_grid_to_boss' option: [ to_boss_position, 1_grid_to_boss, 2_grid_to_boss, use_open_ocean_support ] diff --git a/module/config/config_generated.py b/module/config/config_generated.py index 33184fe80..c8a0fb388 100644 --- a/module/config/config_generated.py +++ b/module/config/config_generated.py @@ -112,8 +112,9 @@ class GeneratedConfig: # Group `Submarine` Submarine_Fleet = 0 # 0, 1, 2 Submarine_AutoRecommend = False - Submarine_Mode = 'do_not_use' # do_not_use, hunt_only, boss_only, hunt_and_boss, every_combat Submarine_AutoSearchMode = 'sub_standby' # sub_standby, sub_auto_call + Submarine_HuntMode = 'do_not_use' # do_not_use, hunt + Submarine_CallMode = 'do_not_use' # do_not_use, boss_only, every_combat Submarine_DistanceToBoss = '2_grid_to_boss' # to_boss_position, 1_grid_to_boss, 2_grid_to_boss, use_open_ocean_support # Group `Emotion` diff --git a/module/config/config_updater.py b/module/config/config_updater.py index c4c89767f..82ff87e64 100644 --- a/module/config/config_updater.py +++ b/module/config/config_updater.py @@ -622,6 +622,18 @@ class ConfigUpdater: # ] # ] + redirection += [ + ( + f'{task}.Submarine.Mode', + (f'{task}.Submarine.HuntMode', f'{task}.Submarine.CallMode'), + submarine_mode_redirect + ) for task in [ + 'Main', 'Main2', 'Main3', 'GemsFarming', + 'Event', 'Event2', 'EventA', 'EventB', 'EventC', 'EventD', 'EventSp', 'Raid', 'RaidDaily', + 'Sos', 'WarArchives', + ] + ] + @cached_property def args(self): return read_file(filepath_args()) diff --git a/module/config/i18n/en-US.json b/module/config/i18n/en-US.json index b82330041..c25456545 100644 --- a/module/config/i18n/en-US.json +++ b/module/config/i18n/en-US.json @@ -1045,24 +1045,28 @@ "name": "Hard Mode Auto-Recommend", "help": "Auto-fills empty submarine fleet if using via recommend button in Hard Mode" }, - "Mode": { - "name": "Submarine Mode", - "help": "Effective only when auto search disabled. Reminder: 'Hunt and Boss' is actually a mix of 'Hunt Only' and 'Boss Only', it does hunt and summon submarines at boss if available.", - "do_not_use": "Don't Use", - "hunt_only": "Hunt Only", - "boss_only": "BOSS Only", - "hunt_and_boss": "Hunt and BOSS", - "every_combat": "Every Combat" - }, "AutoSearchMode": { "name": "Submarine Roles in Auto Search", "help": "Effective only for auto search", "sub_standby": "Standby", "sub_auto_call": "Auto Call" }, + "HuntMode": { + "name": "Hunt Mode", + "help": "Effective only when auto search is disabled, adjusts submarine hunting settings in-stage", + "do_not_use": "Standby", + "hunt": "Hunt" + }, + "CallMode": { + "name": "Call Submarine", + "help": "Attempt to call submarines by clicking the call button during combat", + "do_not_use": "Don't Use", + "boss_only": "BOSS Only", + "every_combat": "Every Combat" + }, "DistanceToBoss": { "name": "Before BOSS battle move the submarine near BOSS", - "help": "Effective only if \"Submarine Mode\" is \"BOSS Only\" or \"Hunt and BOSS\"\nSelecting \"X Grids To BOSS\" needs to ensure that the submarine hunting range can cover the BOSS. Distance is calculated using the Manhattan Distance. Selecting \"Use Open Ocean Support\" requires submarine with aforementioned skill", + "help": "Effective only if \"Call Submarine\" is \"BOSS Only\"\nSelecting \"X Grids To BOSS\" needs to ensure that the submarine hunting range can cover the BOSS. Distance is calculated using the Manhattan Distance. Selecting \"Use Open Ocean Support\" requires submarine with aforementioned skill", "to_boss_position": "To BOSS Location", "1_grid_to_boss": "1 Grid To BOSS", "2_grid_to_boss": "2 Grids To BOSS", diff --git a/module/config/i18n/ja-JP.json b/module/config/i18n/ja-JP.json index 08ae260c6..0433f2b3a 100644 --- a/module/config/i18n/ja-JP.json +++ b/module/config/i18n/ja-JP.json @@ -1031,42 +1031,46 @@ }, "Submarine": { "_info": { - "name": "Submarine._info.name", - "help": "Submarine._info.help" + "name": "潜水艦設定", + "help": "" }, "Fleet": { - "name": "Submarine.Fleet.name", - "help": "Submarine.Fleet.help", - "0": "0", + "name": "潜水艦艦隊番号", + "help": "", + "0": "使用しない", "1": "1", "2": "2" }, "AutoRecommend": { - "name": "Submarine.AutoRecommend.name", - "help": "Submarine.AutoRecommend.help" - }, - "Mode": { - "name": "Submarine.Mode.name", - "help": "Submarine.Mode.help", - "do_not_use": "do_not_use", - "hunt_only": "hunt_only", - "boss_only": "boss_only", - "hunt_and_boss": "hunt_and_boss", - "every_combat": "every_combat" + "name": "推薦編成", + "help": "難易度ハードモードで潜水艦艦隊を使用するが未設定の場合、推薦ボタンで自動編成します" }, "AutoSearchMode": { - "name": "Submarine.AutoSearchMode.name", - "help": "Submarine.AutoSearchMode.help", - "sub_standby": "sub_standby", - "sub_auto_call": "sub_auto_call" + "name": "潜水艦自律索敵設定", + "help": "自律索敵でのみ有効", + "sub_standby": "待機", + "sub_auto_call": "自動召喚" + }, + "HuntMode": { + "name": "狩猟モード設定", + "help": "自律索敵を使用しない場合のみ有効、ステージ内で潜水艦の狩猟設定を調整します", + "do_not_use": "待機", + "hunt": "狩猟" + }, + "CallMode": { + "name": "潜水艦出撃設定", + "help": "戦闘中にボタンをクリックして潜水艦の召喚を試みます", + "do_not_use": "使用しない", + "boss_only": "BOSS戦のみ", + "every_combat": "毎戦" }, "DistanceToBoss": { - "name": "Submarine.DistanceToBoss.name", - "help": "Submarine.DistanceToBoss.help", - "to_boss_position": "to_boss_position", - "1_grid_to_boss": "1_grid_to_boss", - "2_grid_to_boss": "2_grid_to_boss", - "use_open_ocean_support": "use_open_ocean_support" + "name": "BOSS戦前に潜水艦をBOSS付近に移動", + "help": "\"潜水艦出撃設定\"が\"BOSS戦のみ\"の場合のみ有効\n\"BOSSまでXマス\"を選択する場合、潜水艦の狩猟範囲がBOSSまで届くことを確認してください。距離はマンハッタン距離で計算されます。\"遠洋支援を使用\"を選択する場合はU522/ダ・ヴィンチなどの遠洋支援スキルを持つ艦娘が必要です", + "to_boss_position": "BOSSの位置へ", + "1_grid_to_boss": "BOSSまで1マス", + "2_grid_to_boss": "BOSSまで2マス", + "use_open_ocean_support": "遠洋支援を使用" } }, "Emotion": { diff --git a/module/config/i18n/zh-CN.json b/module/config/i18n/zh-CN.json index 91d56f304..da38e0db6 100644 --- a/module/config/i18n/zh-CN.json +++ b/module/config/i18n/zh-CN.json @@ -1045,24 +1045,28 @@ "name": "推荐编队", "help": "困难模式下,如果使用潜艇编队但未配置,会点击推荐自动编队" }, - "Mode": { - "name": "潜艇出击方案", - "help": "仅在自律寻敌关闭的情况下生效,提醒: '狩猎及BOSS战'为'仅狩猎'与'仅BOSS战'的混合,它会在道中进行狩猎打击,并在BOSS战尝试召唤潜艇。", - "do_not_use": "不使用", - "hunt_only": "仅狩猎", - "boss_only": "仅BOSS战", - "hunt_and_boss": "狩猎及BOSS战", - "every_combat": "每战出击" - }, "AutoSearchMode": { "name": "潜艇自律方案", - "help": "仅在自律寻敌下生效", + "help": "周回模式潜艇职能设置", "sub_standby": "待机", "sub_auto_call": "自动召唤潜艇" }, + "HuntMode": { + "name": "设置狩猎模式", + "help": "仅在关卡不使用自律时生效,在关卡内调整潜艇狩猎设置", + "do_not_use": "待机", + "hunt": "狩猎" + }, + "CallMode": { + "name": "潜艇出击方案", + "help": "在战斗内通过点击按钮以尝试召唤潜艇", + "do_not_use": "不使用", + "boss_only": "仅BOSS战", + "every_combat": "每场战斗" + }, "DistanceToBoss": { "name": "BOSS战前将潜艇移动到BOSS附近", - "help": "仅在\"潜艇出击方案\"为\"仅BOSS战\"及\"狩猎及BOSS战\",时生效\n选择\"距离BOSS X格\"需要保证潜艇狩猎范围能覆盖到BOSS,距离使用曼哈顿距离计算,选择\"使用远洋支援\"需要潜艇队伍里有U522/达芬奇", + "help": "仅在\"潜艇出击方案\"为\"仅BOSS战\"时生效\n选择\"距离BOSS X格\"需要保证潜艇狩猎范围能覆盖到BOSS,距离使用曼哈顿距离计算;选择\"使用远洋支援\"需要潜艇队伍里有具备远洋支援技能的舰娘,如U522、达芬奇等", "to_boss_position": "至 BOSS 所在位置", "1_grid_to_boss": "距离 BOSS 1 格", "2_grid_to_boss": "距离 BOSS 2 格", diff --git a/module/config/i18n/zh-TW.json b/module/config/i18n/zh-TW.json index a365ad527..990f71260 100644 --- a/module/config/i18n/zh-TW.json +++ b/module/config/i18n/zh-TW.json @@ -1045,24 +1045,28 @@ "name": "推薦編隊", "help": "困難模式下,如果使用潛艦編隊但未配置,會點擊推薦自動編隊" }, - "Mode": { - "name": "潛艇出擊方案", - "help": "僅在自律尋敵關閉的情況下生效,提醒: '狩獵及BOSS戰'為'僅狩獵'與'僅BOSS戰'的混合,它會在道中進行狩獵打擊,並在BOSS戰嘗試召喚潛艇。", - "do_not_use": "不使用", - "hunt_only": "僅狩獵", - "boss_only": "僅BOSS", - "hunt_and_boss": "狩獵及BOSS戰", - "every_combat": "每戰出擊" - }, "AutoSearchMode": { "name": "潛艇自律尋敵方案", "help": "僅在自律尋敵下生效", "sub_standby": "待機", "sub_auto_call": "自動出擊" }, + "HuntMode": { + "name": "設定狩獵模式", + "help": "僅在關卡不使用自律時生效,在關卡內調整潛艇狩獵設定", + "do_not_use": "待機", + "hunt": "狩獵" + }, + "CallMode": { + "name": "潛艇出擊方案", + "help": "在戰鬥內透過點擊按鈕以嘗試召喚潛艇", + "do_not_use": "不使用", + "boss_only": "僅BOSS戰", + "every_combat": "每場戰鬥" + }, "DistanceToBoss": { "name": "BOSS戰前將潛艇移動到BOSS附近", - "help": "僅在\"潛艇出擊方案\"為\"僅BOSS戰\"及\"狩獵及BOSS戰\"時生效\n選擇\"距離BOSS X格\"需要保證潛艇狩獵範圍能覆蓋到BOSS,距離使用曼哈頓距離計算,選擇\"使用遠洋支援\"需要潛艇隊伍裡有U522或是達芬奇", + "help": "僅在\"潛艇出擊方案\"為\"僅BOSS戰\"時生效\n選擇\"距離BOSS X格\"需要保證潛艇狩獵範圍能覆蓋到BOSS,距離使用曼哈頓距離計算,選擇\"使用遠洋支援\"需要潛艇隊伍裡有U522或是達芬奇", "to_boss_position": "至 BOSS 所在位置", "1_grid_to_boss": "距離 BOSS 1 格", "2_grid_to_boss": "距離 BOSS 2 格", diff --git a/module/config/redirect_utils/utils.py b/module/config/redirect_utils/utils.py index 33a4f6f6e..a7eb53074 100644 --- a/module/config/redirect_utils/utils.py +++ b/module/config/redirect_utils/utils.py @@ -130,3 +130,17 @@ def coalition_to_little_academy(value): return 'hard' else: return value + + +def submarine_mode_redirect(value): + """ + Submarine.Mode -> (Submarine.HuntMode, Submarine.CallMode) + """ + mapping = { + 'do_not_use': ('do_not_use', 'do_not_use'), + 'hunt_only': ('hunt', 'do_not_use'), + 'boss_only': ('do_not_use', 'boss_only'), + 'hunt_and_boss': ('hunt', 'boss_only'), + 'every_combat': ('do_not_use', 'every_combat'), + } + return mapping.get(value, ('do_not_use', 'do_not_use')) diff --git a/module/handler/fast_forward.py b/module/handler/fast_forward.py index 3598f7fbb..3c5777eae 100644 --- a/module/handler/fast_forward.py +++ b/module/handler/fast_forward.py @@ -306,7 +306,7 @@ class FastForwardHandler(AutoSearchHandler): @property def is_call_submarine_at_boss(self): - return self.config.SUBMARINE and self.config.Submarine_Mode in ['boss_only', 'hunt_and_boss'] + return self.config.SUBMARINE and self.config.Submarine_CallMode == 'boss_only' def handle_auto_submarine_call_disable(self): """ diff --git a/module/handler/strategy.py b/module/handler/strategy.py index e4f1c37ee..7b406f0bd 100644 --- a/module/handler/strategy.py +++ b/module/handler/strategy.py @@ -113,7 +113,7 @@ class StrategyHandler(InfoHandler): self.strategy_set_execute( formation=expected_formation, sub_view=False, - sub_hunt=bool(self.config.Submarine_Fleet) and self.config.Submarine_Mode in ['hunt_only', 'hunt_and_boss'] + sub_hunt=bool(self.config.Submarine_Fleet) and self.config.Submarine_HuntMode == 'hunt' ) self.strategy_close() self.__setattr__(f'fleet_{index}_formation_fixed', True) diff --git a/module/map/fleet.py b/module/map/fleet.py index 249f61e20..d83d8ce81 100644 --- a/module/map/fleet.py +++ b/module/map/fleet.py @@ -287,7 +287,7 @@ class Fleet(Camera, AmbushHandler): arrived = False # Wait to confirm fleet arrived. It does't appear immediately if fleet in combat. extra = 0 - if self.config.Submarine_Mode in ['hunt_only', 'hunt_and_boss']: + if self.config.Submarine_HuntMode == 'hunt': extra += 4.5 if self.config.MAP_HAS_LAND_BASED and grid.is_mechanism_trigger: extra += grid.mechanism_wait @@ -317,7 +317,7 @@ class Fleet(Camera, AmbushHandler): self.combat( expected_end=self._expected_end(expected), fleet_index=self.fleet_show_index, - submarine_mode=self._submarine_mode(expected) + is_boss='boss' in expected, ) self.hp_get() self.lv_get(after_battle=True) @@ -941,15 +941,6 @@ class Fleet(Camera, AmbushHandler): # Out of the spawn_data, nothing will spawn return 'no_searching' - def _submarine_mode(self, expected): - if self.is_call_submarine_at_boss: - if 'boss' in expected: - return 'every_combat' - else: - return 'do_not_use' - else: - return None - def fleet_at(self, grid, fleet=None): """ Args: diff --git a/module/os/map.py b/module/os/map.py index 013beaf91..76665ba73 100644 --- a/module/os/map.py +++ b/module/os/map.py @@ -54,7 +54,7 @@ class OSMap(OSFleet, Map, GlobeCamera, StorageHandler, StrategicSearchHandler): kwargs[key] = 0 self.config.override( Submarine_Fleet=1, - Submarine_Mode='every_combat', + Submarine_CallMode='every_combat', STORY_ALLOW_SKIP=False, **kwargs ) diff --git a/module/os_combat/combat.py b/module/os_combat/combat.py index 349518e15..4dad57634 100644 --- a/module/os_combat/combat.py +++ b/module/os_combat/combat.py @@ -255,7 +255,7 @@ class Combat(Combat_, MapEventHandler): self.device.click_record_clear() submarine_mode = 'do_not_use' if self.config.Submarine_Fleet: - submarine_mode = self.config.Submarine_Mode + submarine_mode = self.config.Submarine_CallMode success = True while 1: diff --git a/module/raid/raid.py b/module/raid/raid.py index 401c3ccac..9fa840355 100644 --- a/module/raid/raid.py +++ b/module/raid/raid.py @@ -380,7 +380,7 @@ class Raid(MapOperation, RaidCombat, CampaignEvent): if mode == 'ex': backup = self.config.temporary( Submarine_Fleet=1, - Submarine_Mode='every_combat' + Submarine_CallMode='every_combat' ) self.emotion.check_reduce(1)