diff --git a/assets/cn/combat_ui/PAUSE_ShadowPuppetry.png b/assets/cn/combat_ui/PAUSE_ShadowPuppetry.png new file mode 100644 index 000000000..a4e4b9efb Binary files /dev/null and b/assets/cn/combat_ui/PAUSE_ShadowPuppetry.png differ diff --git a/assets/jp/ui_white/POPUP_CONFIRM_WHITE_BATTLEPASS.png b/assets/jp/ui_white/POPUP_CONFIRM_WHITE_BATTLEPASS.png new file mode 100644 index 000000000..2e770d6af Binary files /dev/null and b/assets/jp/ui_white/POPUP_CONFIRM_WHITE_BATTLEPASS.png differ diff --git a/config/template.json b/config/template.json index 556910763..ea8551749 100644 --- a/config/template.json +++ b/config/template.json @@ -465,56 +465,6 @@ "Storage": {} } }, - "Coalition": { - "Scheduler": { - "Enable": false, - "NextRun": "2020-01-01 00:00:00", - "Command": "Coalition", - "SuccessInterval": 30, - "FailureInterval": 30, - "ServerUpdate": "00:00" - }, - "Campaign": { - "Name": "dynamic", - "Event": "campaign_main", - "Mode": "normal", - "UseClearMode": true, - "UseFleetLock": true, - "UseAutoSearch": false, - "Use2xBook": false, - "AmbushEvade": true - }, - "Coalition": { - "Mode": "area1-normal", - "Fleet": "single" - }, - "StopCondition": { - "OilLimit": 1000, - "RunCount": 0, - "MapAchievement": "non_stop", - "StageIncrease": false, - "GetNewShip": false, - "ReachLevel": 0 - }, - "Emotion": { - "Mode": "calculate", - "Fleet1Value": 119, - "Fleet1Record": "2020-01-01 00:00:00", - "Fleet1Control": "prevent_yellow_face", - "Fleet1Recover": "not_in_dormitory", - "Fleet1Oath": false, - "Fleet1Onsen": false, - "Fleet2Value": 119, - "Fleet2Record": "2020-01-01 00:00:00", - "Fleet2Control": "prevent_yellow_face", - "Fleet2Recover": "not_in_dormitory", - "Fleet2Oath": false, - "Fleet2Onsen": false - }, - "Storage": { - "Storage": {} - } - }, "Event": { "Scheduler": { "Enable": false, @@ -756,6 +706,56 @@ "Storage": {} } }, + "Coalition": { + "Scheduler": { + "Enable": false, + "NextRun": "2020-01-01 00:00:00", + "Command": "Coalition", + "SuccessInterval": 30, + "FailureInterval": 30, + "ServerUpdate": "00:00" + }, + "Campaign": { + "Name": "dynamic", + "Event": "campaign_main", + "Mode": "normal", + "UseClearMode": true, + "UseFleetLock": true, + "UseAutoSearch": false, + "Use2xBook": false, + "AmbushEvade": true + }, + "Coalition": { + "Mode": "area1-normal", + "Fleet": "single" + }, + "StopCondition": { + "OilLimit": 1000, + "RunCount": 0, + "MapAchievement": "non_stop", + "StageIncrease": false, + "GetNewShip": false, + "ReachLevel": 0 + }, + "Emotion": { + "Mode": "calculate", + "Fleet1Value": 119, + "Fleet1Record": "2020-01-01 00:00:00", + "Fleet1Control": "prevent_yellow_face", + "Fleet1Recover": "not_in_dormitory", + "Fleet1Oath": false, + "Fleet1Onsen": false, + "Fleet2Value": 119, + "Fleet2Record": "2020-01-01 00:00:00", + "Fleet2Control": "prevent_yellow_face", + "Fleet2Recover": "not_in_dormitory", + "Fleet2Oath": false, + "Fleet2Onsen": false + }, + "Storage": { + "Storage": {} + } + }, "MaritimeEscort": { "Scheduler": { "Enable": false, diff --git a/dev_tools/utils.py b/dev_tools/utils.py index ce6e8f6d1..e85e9682a 100644 --- a/dev_tools/utils.py +++ b/dev_tools/utils.py @@ -45,7 +45,7 @@ class LuaLoader: def filepath(self, path): return os.path.join(self.folder, self.server, path) - def _load_file(self, file): + def _load_file(self, file, keyword=None): """ Args: file (str): @@ -57,56 +57,21 @@ class LuaLoader: text = f.read() result = {} - matched = re.findall('function \(\)(.*?)end[()]', text, re.S) - if matched: - # Most files are in this format - """ - pg = pg or {} - slot0 = pg - slot0.chapter_template = {} - - (function () - ... - end)() - """ - for func in matched: - add = slpp.decode('{' + func + '}') - result.update(add) - elif text.startswith('pg'): - # Old format - """ - pg = pg or {} - pg.item_data_statistics = { - ... - } - """ - # or - """ - pg = pg or {} - - rawset(pg, "item_data_statistics", rawget(pg, "item_data_statistics") or { - ... - } - """ - text = '{' + text.split('{', 2)[2] - result = slpp.decode(text) - else: - # Another format, just bare data - """ - _G.pg.expedition_data_template[...] = { - ... - } - _G.pg.expedition_data_template[...] = { - ... - } - ... - """ + if text.startswith('_G'): text = '{' + text + '}' result = slpp.decode(text) - + else: + if keyword: + print(f'Finding keyword: {keyword}') + pattern = rf"^{re.escape(keyword)}.*?\{{\s*\n(.*?)^\}}" + else: + pattern = r"\{\s*\n(.*?)^\}" + m = re.search(pattern, text, re.S | re.M) + if m: + result = slpp.decode('{' + m.group(1) + '}') return result - def load(self, path): + def load(self, path, keyword=None): """ Load a lua file to python dictionary, handling the differences @@ -123,7 +88,7 @@ class LuaLoader: for file in tqdm(os.listdir(self.filepath(path))): result.update(self._load_file(f'./{path}/{file}')) else: - result = self._load_file(path) + result = self._load_file(path, keyword=keyword) print(f'{len(result.keys())} items loaded') return result diff --git a/module/combat/combat.py b/module/combat/combat.py index 54ba73969..4277395b6 100644 --- a/module/combat/combat.py +++ b/module/combat/combat.py @@ -119,6 +119,8 @@ class Combat(Level, HPBalancer, Retirement, SubmarineCall, CombatAuto, CombatMan return PAUSE_Seaside if PAUSE_Ninja.match_template_color(self.device.image, offset=(10, 10)): return PAUSE_Ninja + if PAUSE_ShadowPuppetry.match_luma(self.device.image, offset=(10, 10)): + return PAUSE_ShadowPuppetry return False def handle_combat_quit(self, offset=(20, 20), interval=3): diff --git a/module/combat_ui/assets.py b/module/combat_ui/assets.py index 0f33b2ed7..109bc4519 100644 --- a/module/combat_ui/assets.py +++ b/module/combat_ui/assets.py @@ -17,6 +17,7 @@ PAUSE_Ninja = Button(area={'cn': (1230, 37, 1246, 53), 'en': (1230, 37, 1246, 53 PAUSE_Nurse = Button(area={'cn': (1236, 33, 1251, 50), 'en': (1236, 33, 1251, 50), 'jp': (1236, 33, 1251, 50), 'tw': (1236, 33, 1251, 50)}, color={'cn': (200, 206, 209), 'en': (200, 206, 209), 'jp': (200, 206, 209), 'tw': (200, 206, 209)}, button={'cn': (1236, 33, 1251, 50), 'en': (1236, 33, 1251, 50), 'jp': (1236, 33, 1251, 50), 'tw': (1236, 33, 1251, 50)}, file={'cn': './assets/cn/combat_ui/PAUSE_Nurse.png', 'en': './assets/cn/combat_ui/PAUSE_Nurse.png', 'jp': './assets/cn/combat_ui/PAUSE_Nurse.png', 'tw': './assets/cn/combat_ui/PAUSE_Nurse.png'}) PAUSE_Pharaoh = Button(area={'cn': (1229, 55, 1259, 62), 'en': (1229, 55, 1259, 62), 'jp': (1229, 55, 1259, 62), 'tw': (1229, 55, 1259, 62)}, color={'cn': (164, 119, 78), 'en': (164, 119, 78), 'jp': (164, 119, 78), 'tw': (164, 119, 78)}, button={'cn': (1229, 55, 1259, 62), 'en': (1229, 55, 1259, 62), 'jp': (1229, 55, 1259, 62), 'tw': (1229, 55, 1259, 62)}, file={'cn': './assets/cn/combat_ui/PAUSE_Pharaoh.png', 'en': './assets/cn/combat_ui/PAUSE_Pharaoh.png', 'jp': './assets/cn/combat_ui/PAUSE_Pharaoh.png', 'tw': './assets/cn/combat_ui/PAUSE_Pharaoh.png'}) PAUSE_Seaside = Button(area={'cn': (1214, 31, 1239, 59), 'en': (1214, 31, 1239, 59), 'jp': (1214, 31, 1239, 59), 'tw': (1214, 31, 1239, 59)}, color={'cn': (172, 196, 212), 'en': (172, 196, 212), 'jp': (172, 196, 212), 'tw': (172, 196, 212)}, button={'cn': (1214, 31, 1239, 59), 'en': (1214, 31, 1239, 59), 'jp': (1214, 31, 1239, 59), 'tw': (1214, 31, 1239, 59)}, file={'cn': './assets/cn/combat_ui/PAUSE_Seaside.png', 'en': './assets/cn/combat_ui/PAUSE_Seaside.png', 'jp': './assets/cn/combat_ui/PAUSE_Seaside.png', 'tw': './assets/cn/combat_ui/PAUSE_Seaside.png'}) +PAUSE_ShadowPuppetry = Button(area={'cn': (1216, 37, 1234, 55), 'en': (1216, 37, 1234, 55), 'jp': (1216, 37, 1234, 55), 'tw': (1216, 37, 1234, 55)}, color={'cn': (139, 112, 72), 'en': (139, 112, 72), 'jp': (139, 112, 72), 'tw': (139, 112, 72)}, button={'cn': (1216, 37, 1234, 55), 'en': (1216, 37, 1234, 55), 'jp': (1216, 37, 1234, 55), 'tw': (1216, 37, 1234, 55)}, file={'cn': './assets/cn/combat_ui/PAUSE_ShadowPuppetry.png', 'en': './assets/cn/combat_ui/PAUSE_ShadowPuppetry.png', 'jp': './assets/cn/combat_ui/PAUSE_ShadowPuppetry.png', 'tw': './assets/cn/combat_ui/PAUSE_ShadowPuppetry.png'}) PAUSE_Star = Button(area={'cn': (1234, 36, 1250, 57), 'en': (1234, 36, 1250, 57), 'jp': (1234, 36, 1250, 57), 'tw': (1234, 36, 1250, 57)}, color={'cn': (169, 179, 179), 'en': (169, 179, 179), 'jp': (169, 179, 179), 'tw': (169, 179, 179)}, button={'cn': (1234, 36, 1250, 57), 'en': (1234, 36, 1250, 57), 'jp': (1234, 36, 1250, 57), 'tw': (1234, 36, 1250, 57)}, file={'cn': './assets/cn/combat_ui/PAUSE_Star.png', 'en': './assets/cn/combat_ui/PAUSE_Star.png', 'jp': './assets/cn/combat_ui/PAUSE_Star.png', 'tw': './assets/cn/combat_ui/PAUSE_Star.png'}) QUIT = Button(area={'cn': (420, 490, 593, 548), 'en': (473, 508, 567, 532), 'jp': (433, 490, 606, 547), 'tw': (433, 490, 606, 547)}, color={'cn': (199, 122, 114), 'en': (216, 168, 164), 'jp': (196, 120, 113), 'tw': (200, 126, 118)}, button={'cn': (420, 490, 593, 548), 'en': (473, 508, 567, 532), 'jp': (433, 490, 606, 547), 'tw': (433, 490, 606, 547)}, file={'cn': './assets/cn/combat_ui/QUIT.png', 'en': './assets/en/combat_ui/QUIT.png', 'jp': './assets/jp/combat_ui/QUIT.png', 'tw': './assets/tw/combat_ui/QUIT.png'}) QUIT_Christmas = Button(area={'cn': (400, 506, 477, 525), 'en': (410, 507, 469, 524), 'jp': (400, 506, 477, 525), 'tw': (400, 506, 477, 525)}, color={'cn': (195, 139, 166), 'en': (207, 166, 185), 'jp': (195, 139, 166), 'tw': (195, 139, 166)}, button={'cn': (400, 506, 477, 525), 'en': (410, 507, 469, 524), 'jp': (400, 506, 477, 525), 'tw': (400, 506, 477, 525)}, file={'cn': './assets/cn/combat_ui/QUIT_Christmas.png', 'en': './assets/en/combat_ui/QUIT_Christmas.png', 'jp': './assets/cn/combat_ui/QUIT_Christmas.png', 'tw': './assets/cn/combat_ui/QUIT_Christmas.png'}) diff --git a/module/config/argument/args.json b/module/config/argument/args.json index feebdfe96..e54748878 100644 --- a/module/config/argument/args.json +++ b/module/config/argument/args.json @@ -2290,270 +2290,6 @@ } } }, - "Coalition": { - "Scheduler": { - "Enable": { - "type": "checkbox", - "value": false, - "option": [ - true, - false - ] - }, - "NextRun": { - "type": "datetime", - "value": "2020-01-01 00:00:00", - "validate": "datetime" - }, - "Command": { - "type": "input", - "value": "Coalition", - "display": "hide" - }, - "SuccessInterval": { - "type": "input", - "value": 30, - "display": "hide" - }, - "FailureInterval": { - "type": "input", - "value": 30, - "display": "hide" - }, - "ServerUpdate": { - "type": "input", - "value": "00:00", - "display": "hide" - } - }, - "Campaign": { - "Name": { - "type": "input", - "value": "dynamic", - "display": "hide" - }, - "Event": { - "type": "state", - "value": "campaign_main", - "option": [ - "coalition_20251120" - ], - "option_cn": [ - "coalition_20251120" - ], - "option_en": [ - "coalition_20251120" - ], - "option_jp": [ - "coalition_20251120" - ], - "option_tw": [ - "coalition_20251120" - ], - "option_bold": [ - "coalition_20251120" - ] - }, - "Mode": { - "type": "select", - "value": "normal", - "option": [ - "normal", - "hard" - ], - "display": "hide" - }, - "UseClearMode": { - "type": "checkbox", - "value": true, - "display": "hide" - }, - "UseFleetLock": { - "type": "checkbox", - "value": true, - "display": "hide" - }, - "UseAutoSearch": { - "type": "checkbox", - "value": false, - "display": "hide" - }, - "Use2xBook": { - "type": "checkbox", - "value": false, - "display": "hide" - }, - "AmbushEvade": { - "type": "checkbox", - "value": true, - "display": "hide" - } - }, - "Coalition": { - "Mode": { - "type": "select", - "value": "area1-normal", - "option": [ - "area1-normal", - "area1-hard", - "area2-normal", - "area2-hard", - "area3-normal", - "area3-hard", - "area4-normal", - "area4-hard", - "area5-normal", - "area5-hard", - "area6-normal", - "area6-hard" - ] - }, - "Fleet": { - "type": "select", - "value": "single", - "option": [ - "single", - "multi" - ] - } - }, - "StopCondition": { - "OilLimit": { - "type": "input", - "value": 1000 - }, - "RunCount": { - "type": "input", - "value": 0 - }, - "MapAchievement": { - "type": "select", - "value": "non_stop", - "option": [ - "non_stop", - "non_stop_clear_all", - "100_percent_clear", - "map_3_stars", - "threat_safe", - "threat_safe_without_3_stars" - ], - "display": "hide" - }, - "StageIncrease": { - "type": "checkbox", - "value": false, - "display": "hide" - }, - "GetNewShip": { - "type": "checkbox", - "value": false, - "display": "hide" - }, - "ReachLevel": { - "type": "input", - "value": 0, - "display": "hide" - } - }, - "Emotion": { - "Mode": { - "type": "select", - "value": "calculate", - "option": [ - "calculate", - "ignore", - "calculate_ignore" - ] - }, - "Fleet1Value": { - "type": "input", - "value": 119 - }, - "Fleet1Record": { - "type": "datetime", - "value": "2020-01-01 00:00:00", - "validate": "datetime", - "display": "disabled" - }, - "Fleet1Control": { - "type": "select", - "value": "prevent_yellow_face", - "option": [ - "keep_exp_bonus", - "prevent_green_face", - "prevent_yellow_face", - "prevent_red_face" - ] - }, - "Fleet1Recover": { - "type": "select", - "value": "not_in_dormitory", - "option": [ - "not_in_dormitory", - "dormitory_floor_1", - "dormitory_floor_2" - ] - }, - "Fleet1Oath": { - "type": "checkbox", - "value": false - }, - "Fleet1Onsen": { - "type": "checkbox", - "value": false - }, - "Fleet2Value": { - "type": "input", - "value": 119, - "display": "hide" - }, - "Fleet2Record": { - "type": "datetime", - "value": "2020-01-01 00:00:00", - "validate": "datetime", - "display": "hide" - }, - "Fleet2Control": { - "type": "select", - "value": "prevent_yellow_face", - "option": [ - "keep_exp_bonus", - "prevent_green_face", - "prevent_yellow_face", - "prevent_red_face" - ], - "display": "hide" - }, - "Fleet2Recover": { - "type": "select", - "value": "not_in_dormitory", - "option": [ - "not_in_dormitory", - "dormitory_floor_1", - "dormitory_floor_2" - ], - "display": "hide" - }, - "Fleet2Oath": { - "type": "checkbox", - "value": false, - "display": "hide" - }, - "Fleet2Onsen": { - "type": "checkbox", - "value": false, - "display": "hide" - } - }, - "Storage": { - "Storage": { - "type": "storage", - "value": {}, - "valuetype": "ignore", - "display": "disabled" - } - } - }, "Event": { "Scheduler": { "Enable": { @@ -3798,6 +3534,270 @@ } } }, + "Coalition": { + "Scheduler": { + "Enable": { + "type": "checkbox", + "value": false, + "option": [ + true, + false + ] + }, + "NextRun": { + "type": "datetime", + "value": "2020-01-01 00:00:00", + "validate": "datetime" + }, + "Command": { + "type": "input", + "value": "Coalition", + "display": "hide" + }, + "SuccessInterval": { + "type": "input", + "value": 30, + "display": "hide" + }, + "FailureInterval": { + "type": "input", + "value": 30, + "display": "hide" + }, + "ServerUpdate": { + "type": "input", + "value": "00:00", + "display": "hide" + } + }, + "Campaign": { + "Name": { + "type": "input", + "value": "dynamic", + "display": "hide" + }, + "Event": { + "type": "state", + "value": "campaign_main", + "option": [ + "coalition_20251120" + ], + "option_cn": [ + "coalition_20251120" + ], + "option_en": [ + "coalition_20251120" + ], + "option_jp": [ + "coalition_20251120" + ], + "option_tw": [ + "coalition_20251120" + ], + "option_bold": [ + "coalition_20251120" + ] + }, + "Mode": { + "type": "select", + "value": "normal", + "option": [ + "normal", + "hard" + ], + "display": "hide" + }, + "UseClearMode": { + "type": "checkbox", + "value": true, + "display": "hide" + }, + "UseFleetLock": { + "type": "checkbox", + "value": true, + "display": "hide" + }, + "UseAutoSearch": { + "type": "checkbox", + "value": false, + "display": "hide" + }, + "Use2xBook": { + "type": "checkbox", + "value": false, + "display": "hide" + }, + "AmbushEvade": { + "type": "checkbox", + "value": true, + "display": "hide" + } + }, + "Coalition": { + "Mode": { + "type": "select", + "value": "area1-normal", + "option": [ + "area1-normal", + "area1-hard", + "area2-normal", + "area2-hard", + "area3-normal", + "area3-hard", + "area4-normal", + "area4-hard", + "area5-normal", + "area5-hard", + "area6-normal", + "area6-hard" + ] + }, + "Fleet": { + "type": "select", + "value": "single", + "option": [ + "single", + "multi" + ] + } + }, + "StopCondition": { + "OilLimit": { + "type": "input", + "value": 1000 + }, + "RunCount": { + "type": "input", + "value": 0 + }, + "MapAchievement": { + "type": "select", + "value": "non_stop", + "option": [ + "non_stop", + "non_stop_clear_all", + "100_percent_clear", + "map_3_stars", + "threat_safe", + "threat_safe_without_3_stars" + ], + "display": "hide" + }, + "StageIncrease": { + "type": "checkbox", + "value": false, + "display": "hide" + }, + "GetNewShip": { + "type": "checkbox", + "value": false, + "display": "hide" + }, + "ReachLevel": { + "type": "input", + "value": 0, + "display": "hide" + } + }, + "Emotion": { + "Mode": { + "type": "select", + "value": "calculate", + "option": [ + "calculate", + "ignore", + "calculate_ignore" + ] + }, + "Fleet1Value": { + "type": "input", + "value": 119 + }, + "Fleet1Record": { + "type": "datetime", + "value": "2020-01-01 00:00:00", + "validate": "datetime", + "display": "disabled" + }, + "Fleet1Control": { + "type": "select", + "value": "prevent_yellow_face", + "option": [ + "keep_exp_bonus", + "prevent_green_face", + "prevent_yellow_face", + "prevent_red_face" + ] + }, + "Fleet1Recover": { + "type": "select", + "value": "not_in_dormitory", + "option": [ + "not_in_dormitory", + "dormitory_floor_1", + "dormitory_floor_2" + ] + }, + "Fleet1Oath": { + "type": "checkbox", + "value": false + }, + "Fleet1Onsen": { + "type": "checkbox", + "value": false + }, + "Fleet2Value": { + "type": "input", + "value": 119, + "display": "hide" + }, + "Fleet2Record": { + "type": "datetime", + "value": "2020-01-01 00:00:00", + "validate": "datetime", + "display": "hide" + }, + "Fleet2Control": { + "type": "select", + "value": "prevent_yellow_face", + "option": [ + "keep_exp_bonus", + "prevent_green_face", + "prevent_yellow_face", + "prevent_red_face" + ], + "display": "hide" + }, + "Fleet2Recover": { + "type": "select", + "value": "not_in_dormitory", + "option": [ + "not_in_dormitory", + "dormitory_floor_1", + "dormitory_floor_2" + ], + "display": "hide" + }, + "Fleet2Oath": { + "type": "checkbox", + "value": false, + "display": "hide" + }, + "Fleet2Onsen": { + "type": "checkbox", + "value": false, + "display": "hide" + } + }, + "Storage": { + "Storage": { + "type": "storage", + "value": {}, + "valuetype": "ignore", + "display": "disabled" + } + } + }, "MaritimeEscort": { "Scheduler": { "Enable": { diff --git a/module/config/argument/menu.json b/module/config/argument/menu.json index 582b0d7e5..b248becd4 100644 --- a/module/config/argument/menu.json +++ b/module/config/argument/menu.json @@ -23,11 +23,11 @@ "page": "setting", "tasks": [ "EventGeneral", - "Coalition", "Event", "Event2", "Raid", "Hospital", + "Coalition", "MaritimeEscort", "WarArchives" ] diff --git a/module/config/argument/override.yaml b/module/config/argument/override.yaml index c09054718..f06384908 100644 --- a/module/config/argument/override.yaml +++ b/module/config/argument/override.yaml @@ -198,19 +198,6 @@ Hospital: Fleet2Recover: not_in_dormitory Fleet2Oath: false Fleet2Onsen: false -HospitalEvent: - StopCondition: - MapAchievement: non_stop - StageIncrease: false - GetNewShip: false - ReachLevel: 0 - Emotion: - Fleet2Value: 119 - Fleet2Record: 2020-01-01 00:00:00 - Fleet2Control: prevent_yellow_face - Fleet2Recover: not_in_dormitory - Fleet2Oath: false - Fleet2Onsen: false RaidDaily: Scheduler: SuccessInterval: 30 diff --git a/module/config/argument/task.yaml b/module/config/argument/task.yaml index 8243b47f4..dd7ae5522 100644 --- a/module/config/argument/task.yaml +++ b/module/config/argument/task.yaml @@ -73,12 +73,6 @@ Event: EventGeneral: - EventGeneral - TaskBalancer - Coalition: - - Scheduler - - Campaign - - Coalition - - StopCondition - - Emotion Event: - Scheduler - Campaign @@ -108,7 +102,12 @@ Event: - Hospital - StopCondition - Emotion - + Coalition: + - Scheduler + - Campaign + - Coalition + - StopCondition + - Emotion MaritimeEscort: - Scheduler - MaritimeEscort @@ -228,7 +227,6 @@ Reward: - Awaken Island: - Scheduler - - IslandTransport - Island1 - Island2 - Island3 diff --git a/module/config/i18n/en-US.json b/module/config/i18n/en-US.json index b99cecd82..e66786dbc 100644 --- a/module/config/i18n/en-US.json +++ b/module/config/i18n/en-US.json @@ -66,10 +66,6 @@ "name": "Event General", "help": "" }, - "Coalition": { - "name": "DATE A LANE", - "help": "" - }, "Event": { "name": "Event", "help": "" @@ -86,6 +82,10 @@ "name": "Valley Hospital Story", "help": "" }, + "Coalition": { + "name": "DATE A LANE", + "help": "" + }, "MaritimeEscort": { "name": "Maritime Escort", "help": "" diff --git a/module/config/i18n/ja-JP.json b/module/config/i18n/ja-JP.json index 9ddba5064..ffe5ab229 100644 --- a/module/config/i18n/ja-JP.json +++ b/module/config/i18n/ja-JP.json @@ -66,10 +66,6 @@ "name": "イベント共通設定", "help": "" }, - "Coalition": { - "name": "ネオンシティの探索者", - "help": "" - }, "Event": { "name": "イベント海域", "help": "" @@ -86,6 +82,10 @@ "name": "病院探訪ストーリー", "help": "" }, + "Coalition": { + "name": "ネオンシティの探索者", + "help": "" + }, "MaritimeEscort": { "name": "Maritime Escort", "help": "" diff --git a/module/config/i18n/zh-CN.json b/module/config/i18n/zh-CN.json index 1fee0041c..00ead2994 100644 --- a/module/config/i18n/zh-CN.json +++ b/module/config/i18n/zh-CN.json @@ -66,10 +66,6 @@ "name": "活动通用设置", "help": "" }, - "Coalition": { - "name": "DATE A LANE", - "help": "" - }, "Event": { "name": "活动图", "help": "" @@ -86,6 +82,10 @@ "name": "深谷来信", "help": "" }, + "Coalition": { + "name": "DATE A LANE", + "help": "" + }, "MaritimeEscort": { "name": "商船护航", "help": "" diff --git a/module/config/i18n/zh-TW.json b/module/config/i18n/zh-TW.json index 08ea3f56f..cc843f615 100644 --- a/module/config/i18n/zh-TW.json +++ b/module/config/i18n/zh-TW.json @@ -66,10 +66,6 @@ "name": "活動通用", "help": "" }, - "Coalition": { - "name": "極地風暴", - "help": "" - }, "Event": { "name": "活動圖", "help": "" @@ -86,6 +82,10 @@ "name": "深谷来信", "help": "" }, + "Coalition": { + "name": "極地風暴", + "help": "" + }, "MaritimeEscort": { "name": "商船護航", "help": "" diff --git a/module/exercise/hp_daemon.py b/module/exercise/hp_daemon.py index eff6288d1..7dbe30bd9 100644 --- a/module/exercise/hp_daemon.py +++ b/module/exercise/hp_daemon.py @@ -74,6 +74,7 @@ class HpDaemon(ModuleBase): PAUSE_Seaside, PAUSE_Star, PAUSE_Ninja, + PAUSE_ShadowPuppetry ]: self.attacker_hp = self._calculate_hp(image, area=ATTACKER_HP_AREA_New.area, reverse=True) self.defender_hp = self._calculate_hp(image, area=DEFENDER_HP_AREA_New.area, reverse=True) diff --git a/module/freebies/battle_pass.py b/module/freebies/battle_pass.py index 75dadff99..fc8035eae 100644 --- a/module/freebies/battle_pass.py +++ b/module/freebies/battle_pass.py @@ -83,7 +83,7 @@ class BattlePass(Combat, UI): if self.handle_battle_pass_popup(): confirm_timer.reset() continue - if self.config.SERVER == 'cn': + if self.config.SERVER in ['cn', 'jp']: if self.appear_then_click(POPUP_CONFIRM_WHITE_BATTLEPASS, offset=(20, 20), interval=3): confirm_timer.reset() continue diff --git a/module/map/map_fleet_preparation.py b/module/map/map_fleet_preparation.py index 8bb7c313e..b54fca182 100644 --- a/module/map/map_fleet_preparation.py +++ b/module/map/map_fleet_preparation.py @@ -354,6 +354,8 @@ class FleetPreparation(InfoHandler): pass else: submarine.clear() + else: + self.config.SUBMARINE = 0 return False # Submarine. diff --git a/module/os/fleet.py b/module/os/fleet.py index 38bc8ad4d..491652c42 100644 --- a/module/os/fleet.py +++ b/module/os/fleet.py @@ -323,7 +323,7 @@ class OSFleet(OSCamera, Combat, Fleet, OSAsh): # Record story history to clear click record clicked_story = False clicked_story_count = 0 - + stuck_timer = Timer(20, count=5).start() confirm_timer.reset() while 1: if skip_first_screenshot: @@ -335,6 +335,7 @@ class OSFleet(OSCamera, Combat, Fleet, OSAsh): event = self.handle_map_event(drop=drop) if event: confirm_timer.reset() + stuck_timer.reset() result.add('event') if event == 'story_skip': clicked_story = True @@ -363,6 +364,7 @@ class OSFleet(OSCamera, Combat, Fleet, OSAsh): continue if self.handle_retirement(): confirm_timer.reset() + stuck_timer.reset() continue if self.handle_walk_out_of_step(): if walk_out_of_step: @@ -371,27 +373,33 @@ class OSFleet(OSCamera, Combat, Fleet, OSAsh): continue if self.handle_popup_confirm('WALK_UNTIL_STABLE'): confirm_timer.reset() + stuck_timer.reset() continue # Accident click if self.is_in_globe(): self.os_globe_goto_map() confirm_timer.reset() + stuck_timer.reset() continue if self.is_in_storage(): self.storage_quit() confirm_timer.reset() + stuck_timer.reset() continue if self.is_in_os_mission(): self.os_mission_quit() confirm_timer.reset() + stuck_timer.reset() continue if self.handle_os_game_tips(): confirm_timer.reset() + stuck_timer.reset() continue if self.is_in_map_order(): self.order_quit() confirm_timer.reset() + stuck_timer.reset() continue # Combat @@ -400,6 +408,7 @@ class OSFleet(OSCamera, Combat, Fleet, OSAsh): # self.ui_back(check_button=self.is_in_map) self.combat(expected_end=self.is_in_map, fleet_index=self.fleet_show_index, save_get_items=drop) confirm_timer.reset() + stuck_timer.reset() result.add('event') continue @@ -408,18 +417,21 @@ class OSFleet(OSCamera, Combat, Fleet, OSAsh): self.interval_clear(PORT_SUPPLY_CHECK) self.handle_akashi_supply_buy(CLICK_SAFE_AREA) confirm_timer.reset() + stuck_timer.reset() result.add('akashi') continue # A game bug that AUTO_SEARCH_REWARD from the last cleared zone popups if self.appear_then_click(AUTO_SEARCH_REWARD, offset=(50, 50), interval=3): confirm_timer.reset() + stuck_timer.reset() continue # Enemy searching if not enemy_searching_appear and self.enemy_searching_appear(): enemy_searching_appear = True confirm_timer.reset() + stuck_timer.reset() continue else: if enemy_searching_appear: @@ -428,6 +440,7 @@ class OSFleet(OSCamera, Combat, Fleet, OSAsh): logger.info('Enemy searching appeared.') enemy_searching_appear = False confirm_timer.reset() + stuck_timer.reset() result.add('search') if self.is_in_map(): self.enemy_searching_color_initial() @@ -444,16 +457,34 @@ class OSFleet(OSCamera, Combat, Fleet, OSAsh): if confirm_timer.reached(): break else: + if stuck_timer.reached(): + logger.warning(f"homo_loca stuck at current view, try reset.") + if self.fleet_reset_view(): + stuck_timer.reset() confirm_timer.reset() record = current else: confirm_timer.reset() + stuck_timer.reset() result = '_'.join(result) logger.info(f'Walk stabled, result: {result}') self.device.screenshot_interval_set() return result + def fleet_reset_view(self): + """ + Returns: + bool: If reset + """ + current_fleet = self.fleet_selector.get() + if not current_fleet: + logger.warning('Failed to get OpSi fleet') + return False + self.fleet_selector.open() + self.fleet_selector.click(current_fleet) + return True + def port_goto(self, allow_port_arrive=True): """ A simple and poor implement to goto port. Searching port on radar. @@ -629,6 +660,12 @@ class OSFleet(OSCamera, Combat, Fleet, OSAsh): self.predict() self.predict_radar() + fleets = self.view.select(is_current_fleet=True) + if fleets.count == 0: + logger.warning('Current fleet not found on local view, reset camera view to current fleet.') + if self.fleet_reset_view(): + self.wait_until_camera_stable() + continue # Calculate destination grids = self.radar.select(is_question=True) if grids: diff --git a/module/ui_white/assets.py b/module/ui_white/assets.py index 5f0a38895..4b151af11 100644 --- a/module/ui_white/assets.py +++ b/module/ui_white/assets.py @@ -26,7 +26,7 @@ MAIN_TAB_SWITCH_WHITE = Button(area={'cn': (966, 548, 999, 582), 'en': (966, 548 MISSION_NOTICE_WHITE = Button(area={'cn': (923, 657, 947, 671), 'en': (923, 657, 947, 671), 'jp': (923, 657, 947, 671), 'tw': (923, 657, 947, 671)}, color={'cn': (227, 168, 159), 'en': (227, 168, 159), 'jp': (227, 168, 159), 'tw': (227, 168, 159)}, button={'cn': (923, 657, 947, 671), 'en': (923, 657, 947, 671), 'jp': (923, 657, 947, 671), 'tw': (923, 657, 947, 671)}, file={'cn': './assets/cn/ui_white/MISSION_NOTICE_WHITE.png', 'en': './assets/en/ui_white/MISSION_NOTICE_WHITE.png', 'jp': './assets/jp/ui_white/MISSION_NOTICE_WHITE.png', 'tw': './assets/tw/ui_white/MISSION_NOTICE_WHITE.png'}) POPUP_CANCEL_WHITE = Button(area={'cn': (487, 491, 531, 513), 'en': (471, 492, 547, 513), 'jp': (481, 490, 534, 516), 'tw': (487, 491, 531, 513)}, color={'cn': (214, 214, 214), 'en': (205, 206, 205), 'jp': (202, 203, 202), 'tw': (214, 214, 214)}, button={'cn': (487, 491, 531, 513), 'en': (471, 492, 547, 513), 'jp': (481, 490, 534, 516), 'tw': (487, 491, 531, 513)}, file={'cn': './assets/cn/ui_white/POPUP_CANCEL_WHITE.png', 'en': './assets/en/ui_white/POPUP_CANCEL_WHITE.png', 'jp': './assets/jp/ui_white/POPUP_CANCEL_WHITE.png', 'tw': './assets/cn/ui_white/POPUP_CANCEL_WHITE.png'}) POPUP_CONFIRM_WHITE = Button(area={'cn': (746, 494, 791, 515), 'en': (727, 495, 810, 515), 'jp': (743, 491, 796, 518), 'tw': (744, 491, 794, 518)}, color={'cn': (133, 216, 255), 'en': (107, 207, 255), 'jp': (109, 207, 255), 'tw': (111, 207, 249)}, button={'cn': (746, 494, 791, 515), 'en': (727, 495, 810, 515), 'jp': (743, 491, 796, 518), 'tw': (744, 491, 794, 518)}, file={'cn': './assets/cn/ui_white/POPUP_CONFIRM_WHITE.png', 'en': './assets/en/ui_white/POPUP_CONFIRM_WHITE.png', 'jp': './assets/jp/ui_white/POPUP_CONFIRM_WHITE.png', 'tw': './assets/tw/ui_white/POPUP_CONFIRM_WHITE.png'}) -POPUP_CONFIRM_WHITE_BATTLEPASS = Button(area={'cn': (744, 490, 795, 513), 'en': (744, 490, 795, 513), 'jp': (744, 490, 795, 513), 'tw': (744, 490, 795, 513)}, color={'cn': (119, 211, 255), 'en': (119, 211, 255), 'jp': (119, 211, 255), 'tw': (119, 211, 255)}, button={'cn': (744, 490, 795, 513), 'en': (744, 490, 795, 513), 'jp': (744, 490, 795, 513), 'tw': (744, 490, 795, 513)}, file={'cn': './assets/cn/ui_white/POPUP_CONFIRM_WHITE_BATTLEPASS.png', 'en': './assets/cn/ui_white/POPUP_CONFIRM_WHITE_BATTLEPASS.png', 'jp': './assets/cn/ui_white/POPUP_CONFIRM_WHITE_BATTLEPASS.png', 'tw': './assets/cn/ui_white/POPUP_CONFIRM_WHITE_BATTLEPASS.png'}) +POPUP_CONFIRM_WHITE_BATTLEPASS = Button(area={'cn': (744, 490, 795, 513), 'en': (744, 490, 795, 513), 'jp': (739, 488, 800, 515), 'tw': (744, 490, 795, 513)}, color={'cn': (119, 211, 255), 'en': (119, 211, 255), 'jp': (103, 206, 255), 'tw': (119, 211, 255)}, button={'cn': (744, 490, 795, 513), 'en': (744, 490, 795, 513), 'jp': (739, 488, 800, 515), 'tw': (744, 490, 795, 513)}, file={'cn': './assets/cn/ui_white/POPUP_CONFIRM_WHITE_BATTLEPASS.png', 'en': './assets/cn/ui_white/POPUP_CONFIRM_WHITE_BATTLEPASS.png', 'jp': './assets/jp/ui_white/POPUP_CONFIRM_WHITE_BATTLEPASS.png', 'tw': './assets/cn/ui_white/POPUP_CONFIRM_WHITE_BATTLEPASS.png'}) POPUP_SINGLE_WHITE = Button(area={'cn': (623, 493, 668, 515), 'en': (623, 493, 668, 515), 'jp': (623, 493, 668, 515), 'tw': (623, 493, 668, 515)}, color={'cn': (131, 215, 255), 'en': (131, 215, 255), 'jp': (131, 215, 255), 'tw': (131, 215, 255)}, button={'cn': (623, 493, 668, 515), 'en': (623, 493, 668, 515), 'jp': (623, 493, 668, 515), 'tw': (623, 493, 668, 515)}, file={'cn': './assets/cn/ui_white/POPUP_SINGLE_WHITE.png', 'en': './assets/cn/ui_white/POPUP_SINGLE_WHITE.png', 'jp': './assets/cn/ui_white/POPUP_SINGLE_WHITE.png', 'tw': './assets/cn/ui_white/POPUP_SINGLE_WHITE.png'}) REWARD_1_WHITE = Button(area={'cn': (437, 278, 496, 306), 'en': (411, 283, 523, 300), 'jp': (442, 279, 491, 305), 'tw': (441, 280, 490, 306)}, color={'cn': (255, 193, 97), 'en': (255, 212, 150), 'jp': (255, 195, 101), 'tw': (255, 199, 111)}, button={'cn': (437, 278, 496, 306), 'en': (411, 283, 523, 300), 'jp': (442, 279, 491, 305), 'tw': (441, 280, 490, 306)}, file={'cn': './assets/cn/ui_white/REWARD_1_WHITE.png', 'en': './assets/en/ui_white/REWARD_1_WHITE.png', 'jp': './assets/jp/ui_white/REWARD_1_WHITE.png', 'tw': './assets/tw/ui_white/REWARD_1_WHITE.png'}) REWARD_2_WHITE = Button(area={'cn': (436, 419, 497, 448), 'en': (411, 425, 523, 442), 'jp': (442, 421, 492, 446), 'tw': (439, 422, 490, 448)}, color={'cn': (255, 192, 94), 'en': (255, 212, 146), 'jp': (255, 196, 103), 'tw': (255, 198, 109)}, button={'cn': (436, 419, 497, 448), 'en': (411, 425, 523, 442), 'jp': (442, 421, 492, 446), 'tw': (439, 422, 490, 448)}, file={'cn': './assets/cn/ui_white/REWARD_2_WHITE.png', 'en': './assets/en/ui_white/REWARD_2_WHITE.png', 'jp': './assets/jp/ui_white/REWARD_2_WHITE.png', 'tw': './assets/tw/ui_white/REWARD_2_WHITE.png'})