diff --git a/assets/cn/coalition/FASHION_COALITION_CHECK.png b/assets/cn/coalition/FASHION_COALITION_CHECK.png new file mode 100644 index 000000000..af8bfe06c Binary files /dev/null and b/assets/cn/coalition/FASHION_COALITION_CHECK.png differ diff --git a/assets/cn/coalition/FASHION_EASY.png b/assets/cn/coalition/FASHION_EASY.png new file mode 100644 index 000000000..b45295efe Binary files /dev/null and b/assets/cn/coalition/FASHION_EASY.png differ diff --git a/assets/cn/coalition/FASHION_EX.png b/assets/cn/coalition/FASHION_EX.png new file mode 100644 index 000000000..3c576e3fa Binary files /dev/null and b/assets/cn/coalition/FASHION_EX.png differ diff --git a/assets/cn/coalition/FASHION_HARD.png b/assets/cn/coalition/FASHION_HARD.png new file mode 100644 index 000000000..b528845cf Binary files /dev/null and b/assets/cn/coalition/FASHION_HARD.png differ diff --git a/assets/cn/coalition/FASHION_MODE_BATTLE.png b/assets/cn/coalition/FASHION_MODE_BATTLE.png new file mode 100644 index 000000000..4aff412af Binary files /dev/null and b/assets/cn/coalition/FASHION_MODE_BATTLE.png differ diff --git a/assets/cn/coalition/FASHION_MODE_STORY.png b/assets/cn/coalition/FASHION_MODE_STORY.png new file mode 100644 index 000000000..842c07399 Binary files /dev/null and b/assets/cn/coalition/FASHION_MODE_STORY.png differ diff --git a/assets/cn/coalition/FASHION_NORMAL.png b/assets/cn/coalition/FASHION_NORMAL.png new file mode 100644 index 000000000..040ae5468 Binary files /dev/null and b/assets/cn/coalition/FASHION_NORMAL.png differ diff --git a/assets/cn/coalition/FASHION_PT_OCR.png b/assets/cn/coalition/FASHION_PT_OCR.png new file mode 100644 index 000000000..4f4af9c7f Binary files /dev/null and b/assets/cn/coalition/FASHION_PT_OCR.png differ diff --git a/assets/cn/coalition/FASHION_SP.png b/assets/cn/coalition/FASHION_SP.png new file mode 100644 index 000000000..edb2fd098 Binary files /dev/null and b/assets/cn/coalition/FASHION_SP.png differ diff --git a/assets/cn/coalition/FASHION_SWITCH_MULTI.png b/assets/cn/coalition/FASHION_SWITCH_MULTI.png new file mode 100644 index 000000000..13ee7d723 Binary files /dev/null and b/assets/cn/coalition/FASHION_SWITCH_MULTI.png differ diff --git a/assets/cn/coalition/FASHION_SWITCH_SINGLE.png b/assets/cn/coalition/FASHION_SWITCH_SINGLE.png new file mode 100644 index 000000000..00725bc08 Binary files /dev/null and b/assets/cn/coalition/FASHION_SWITCH_SINGLE.png differ diff --git a/assets/cn/combat/QUIT_RECONFIRM.png b/assets/cn/combat/QUIT_RECONFIRM.png new file mode 100644 index 000000000..e74dc5560 Binary files /dev/null and b/assets/cn/combat/QUIT_RECONFIRM.png differ diff --git a/assets/cn/exercise/QUIT_RECONFIRM.png b/assets/cn/exercise/QUIT_RECONFIRM.png deleted file mode 100644 index 8033f795d..000000000 Binary files a/assets/cn/exercise/QUIT_RECONFIRM.png and /dev/null differ diff --git a/assets/en/combat/QUIT_RECONFIRM.png b/assets/en/combat/QUIT_RECONFIRM.png new file mode 100644 index 000000000..e5e5837be Binary files /dev/null and b/assets/en/combat/QUIT_RECONFIRM.png differ diff --git a/assets/en/exercise/QUIT_RECONFIRM.png b/assets/en/exercise/QUIT_RECONFIRM.png deleted file mode 100644 index fc9f9fb33..000000000 Binary files a/assets/en/exercise/QUIT_RECONFIRM.png and /dev/null differ diff --git a/assets/jp/combat/QUIT_RECONFIRM.png b/assets/jp/combat/QUIT_RECONFIRM.png new file mode 100644 index 000000000..c65eb33ea Binary files /dev/null and b/assets/jp/combat/QUIT_RECONFIRM.png differ diff --git a/assets/jp/exercise/QUIT_RECONFIRM.png b/assets/jp/exercise/QUIT_RECONFIRM.png deleted file mode 100644 index 8930d4cd2..000000000 Binary files a/assets/jp/exercise/QUIT_RECONFIRM.png and /dev/null differ diff --git a/assets/jp/tactical/REWARD_2.BUTTON.png b/assets/jp/tactical/REWARD_2.BUTTON.png index e7be03617..96bd39988 100644 Binary files a/assets/jp/tactical/REWARD_2.BUTTON.png and b/assets/jp/tactical/REWARD_2.BUTTON.png differ diff --git a/assets/tw/combat/QUIT_RECONFIRM.png b/assets/tw/combat/QUIT_RECONFIRM.png new file mode 100644 index 000000000..aeff69340 Binary files /dev/null and b/assets/tw/combat/QUIT_RECONFIRM.png differ diff --git a/assets/tw/exercise/QUIT_RECONFIRM.BUTTON.png b/assets/tw/exercise/QUIT_RECONFIRM.BUTTON.png deleted file mode 100644 index 31a0d1197..000000000 Binary files a/assets/tw/exercise/QUIT_RECONFIRM.BUTTON.png and /dev/null differ diff --git a/assets/tw/exercise/QUIT_RECONFIRM.png b/assets/tw/exercise/QUIT_RECONFIRM.png deleted file mode 100644 index fa9b29a86..000000000 Binary files a/assets/tw/exercise/QUIT_RECONFIRM.png and /dev/null differ diff --git a/campaign/Readme.md b/campaign/Readme.md index f02639588..858981fca 100644 --- a/campaign/Readme.md +++ b/campaign/Readme.md @@ -275,4 +275,6 @@ To add a new event, add a new row in here, and run `python -m module.config.conf | 20251211 | event 20251023 cn | Tempesta and Islas de Libertád | - | - | - | 颶風與自由群島 | | 20251218 | event 20251218 cn | A Note Through the Firmament | 响彻于天穹之音 | A Note Through the Firmament | 天穹に響く音謡 | - | | 20251231 | event 20251218 cn | A Note Through the Firmament | - | - | - | 響徹於天穹之音 | -| 20260115 | event 20231221 cn | Light-Chasing Sea of Stars | 复刻星海逐光 | Light-Chasing Sea of Stars Rerun | 光追う星の海(復刻) | - | +| 20260115 | event 20231221 cn | Light-Chasing Sea of Stars Rerun | 复刻星海逐光 | Light-Chasing Sea of Stars Rerun | 光追う星の海(復刻) | - | +| 20260122 | coalition 20260122 | Light & Shadow Fashion Shoot! | 光影风尚-拍摄进行时 | Light & Shadow Fashion Shoot! | 特集写真-撮影進行中 | - | +| 20260122 | event 20220526 cn | Pledge of the Radiant Court | - | - | - | 泠誓光庭 | diff --git a/config/template.json b/config/template.json index bb39b4262..790289d96 100644 --- a/config/template.json +++ b/config/template.json @@ -469,6 +469,57 @@ "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, + "ClearAfterSinking": false + }, + "Coalition": { + "Mode": "hard", + "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, @@ -713,57 +764,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, - "ClearAfterSinking": false - }, - "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, @@ -860,6 +860,57 @@ "Storage": {} } }, + "CoalitionSp": { + "Scheduler": { + "Enable": false, + "NextRun": "2020-01-01 00:00:00", + "Command": "CoalitionSp", + "SuccessInterval": 30, + "FailureInterval": 30, + "ServerUpdate": "00:00" + }, + "Campaign": { + "Name": "sp", + "Event": "campaign_main", + "Mode": "normal", + "UseClearMode": true, + "UseFleetLock": true, + "UseAutoSearch": false, + "Use2xBook": false, + "AmbushEvade": true, + "ClearAfterSinking": false + }, + "Coalition": { + "Mode": "sp", + "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": {} + } + }, "EventA": { "Scheduler": { "Enable": false, @@ -1311,57 +1362,6 @@ "Storage": {} } }, - "CoalitionSp": { - "Scheduler": { - "Enable": false, - "NextRun": "2020-01-01 00:00:00", - "Command": "CoalitionSp", - "SuccessInterval": 30, - "FailureInterval": 30, - "ServerUpdate": "00:00" - }, - "Campaign": { - "Name": "sp", - "Event": "campaign_main", - "Mode": "normal", - "UseClearMode": true, - "UseFleetLock": true, - "UseAutoSearch": false, - "Use2xBook": false, - "AmbushEvade": true, - "ClearAfterSinking": false - }, - "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": {} - } - }, "Commission": { "Scheduler": { "Enable": false, diff --git a/module/coalition/assets.py b/module/coalition/assets.py index 0358fad6a..9213f69ba 100644 --- a/module/coalition/assets.py +++ b/module/coalition/assets.py @@ -36,6 +36,17 @@ DAL_SWITCH_MULTI = Button(area={'cn': (1060, 473, 1204, 500), 'en': (1061, 474, DAL_SWITCH_SINGLE = Button(area={'cn': (910, 473, 1055, 500), 'en': (915, 475, 1051, 499), 'jp': (917, 474, 1035, 499), 'tw': (945, 478, 1013, 495)}, color={'cn': (223, 223, 223), 'en': (193, 193, 193), 'jp': (215, 215, 215), 'tw': (168, 168, 168)}, button={'cn': (910, 473, 1055, 500), 'en': (915, 475, 1051, 499), 'jp': (917, 474, 1035, 499), 'tw': (945, 478, 1013, 495)}, file={'cn': './assets/cn/coalition/DAL_SWITCH_SINGLE.png', 'en': './assets/en/coalition/DAL_SWITCH_SINGLE.png', 'jp': './assets/jp/coalition/DAL_SWITCH_SINGLE.png', 'tw': './assets/tw/coalition/DAL_SWITCH_SINGLE.png'}) EMPTY_FLAGSHIP = Button(area={'cn': (247, 237, 277, 267), 'en': (247, 237, 277, 267), 'jp': (247, 237, 277, 267), 'tw': (247, 237, 277, 267)}, color={'cn': (76, 64, 56), 'en': (76, 64, 56), 'jp': (76, 64, 56), 'tw': (76, 64, 56)}, button={'cn': (247, 237, 277, 267), 'en': (247, 237, 277, 267), 'jp': (247, 237, 277, 267), 'tw': (247, 237, 277, 267)}, file={'cn': './assets/cn/coalition/EMPTY_FLAGSHIP.png', 'en': './assets/cn/coalition/EMPTY_FLAGSHIP.png', 'jp': './assets/cn/coalition/EMPTY_FLAGSHIP.png', 'tw': './assets/cn/coalition/EMPTY_FLAGSHIP.png'}) EMPTY_VANGUARD = Button(area={'cn': (515, 237, 545, 267), 'en': (515, 237, 545, 267), 'jp': (515, 237, 545, 267), 'tw': (515, 237, 545, 267)}, color={'cn': (52, 52, 53), 'en': (52, 52, 53), 'jp': (52, 52, 53), 'tw': (52, 52, 53)}, button={'cn': (515, 237, 545, 267), 'en': (515, 237, 545, 267), 'jp': (515, 237, 545, 267), 'tw': (515, 237, 545, 267)}, file={'cn': './assets/cn/coalition/EMPTY_VANGUARD.png', 'en': './assets/cn/coalition/EMPTY_VANGUARD.png', 'jp': './assets/cn/coalition/EMPTY_VANGUARD.png', 'tw': './assets/cn/coalition/EMPTY_VANGUARD.png'}) +FASHION_COALITION_CHECK = Button(area={'cn': (102, 19, 177, 51), 'en': (102, 19, 177, 51), 'jp': (102, 19, 177, 51), 'tw': (102, 19, 177, 51)}, color={'cn': (109, 104, 89), 'en': (109, 104, 89), 'jp': (109, 104, 89), 'tw': (109, 104, 89)}, button={'cn': (102, 19, 177, 51), 'en': (102, 19, 177, 51), 'jp': (102, 19, 177, 51), 'tw': (102, 19, 177, 51)}, file={'cn': './assets/cn/coalition/FASHION_COALITION_CHECK.png', 'en': './assets/cn/coalition/FASHION_COALITION_CHECK.png', 'jp': './assets/cn/coalition/FASHION_COALITION_CHECK.png', 'tw': './assets/cn/coalition/FASHION_COALITION_CHECK.png'}) +FASHION_EASY = Button(area={'cn': (136, 223, 199, 263), 'en': (136, 223, 199, 263), 'jp': (136, 223, 199, 263), 'tw': (136, 223, 199, 263)}, color={'cn': (225, 199, 197), 'en': (225, 199, 197), 'jp': (225, 199, 197), 'tw': (225, 199, 197)}, button={'cn': (136, 223, 199, 263), 'en': (136, 223, 199, 263), 'jp': (136, 223, 199, 263), 'tw': (136, 223, 199, 263)}, file={'cn': './assets/cn/coalition/FASHION_EASY.png', 'en': './assets/cn/coalition/FASHION_EASY.png', 'jp': './assets/cn/coalition/FASHION_EASY.png', 'tw': './assets/cn/coalition/FASHION_EASY.png'}) +FASHION_EX = Button(area={'cn': (844, 246, 923, 301), 'en': (844, 246, 923, 301), 'jp': (844, 246, 923, 301), 'tw': (844, 246, 923, 301)}, color={'cn': (140, 115, 114), 'en': (140, 115, 114), 'jp': (140, 115, 114), 'tw': (140, 115, 114)}, button={'cn': (844, 246, 923, 301), 'en': (844, 246, 923, 301), 'jp': (844, 246, 923, 301), 'tw': (844, 246, 923, 301)}, file={'cn': './assets/cn/coalition/FASHION_EX.png', 'en': './assets/cn/coalition/FASHION_EX.png', 'jp': './assets/cn/coalition/FASHION_EX.png', 'tw': './assets/cn/coalition/FASHION_EX.png'}) +FASHION_HARD = Button(area={'cn': (485, 167, 554, 215), 'en': (485, 167, 554, 215), 'jp': (485, 167, 554, 215), 'tw': (485, 167, 554, 215)}, color={'cn': (152, 136, 129), 'en': (152, 136, 129), 'jp': (152, 136, 129), 'tw': (152, 136, 129)}, button={'cn': (485, 167, 554, 215), 'en': (485, 167, 554, 215), 'jp': (485, 167, 554, 215), 'tw': (485, 167, 554, 215)}, file={'cn': './assets/cn/coalition/FASHION_HARD.png', 'en': './assets/cn/coalition/FASHION_HARD.png', 'jp': './assets/cn/coalition/FASHION_HARD.png', 'tw': './assets/cn/coalition/FASHION_HARD.png'}) +FASHION_MODE_BATTLE = Button(area={'cn': (152, 635, 213, 669), 'en': (152, 635, 213, 669), 'jp': (152, 635, 213, 669), 'tw': (152, 635, 213, 669)}, color={'cn': (140, 133, 117), 'en': (140, 133, 117), 'jp': (140, 133, 117), 'tw': (140, 133, 117)}, button={'cn': (152, 635, 213, 669), 'en': (152, 635, 213, 669), 'jp': (152, 635, 213, 669), 'tw': (152, 635, 213, 669)}, file={'cn': './assets/cn/coalition/FASHION_MODE_BATTLE.png', 'en': './assets/cn/coalition/FASHION_MODE_BATTLE.png', 'jp': './assets/cn/coalition/FASHION_MODE_BATTLE.png', 'tw': './assets/cn/coalition/FASHION_MODE_BATTLE.png'}) +FASHION_MODE_STORY = Button(area={'cn': (154, 629, 220, 666), 'en': (154, 629, 220, 666), 'jp': (154, 629, 220, 666), 'tw': (154, 629, 220, 666)}, color={'cn': (141, 134, 116), 'en': (141, 134, 116), 'jp': (141, 134, 116), 'tw': (141, 134, 116)}, button={'cn': (154, 629, 220, 666), 'en': (154, 629, 220, 666), 'jp': (154, 629, 220, 666), 'tw': (154, 629, 220, 666)}, file={'cn': './assets/cn/coalition/FASHION_MODE_STORY.png', 'en': './assets/cn/coalition/FASHION_MODE_STORY.png', 'jp': './assets/cn/coalition/FASHION_MODE_STORY.png', 'tw': './assets/cn/coalition/FASHION_MODE_STORY.png'}) +FASHION_NORMAL = Button(area={'cn': (322, 295, 392, 334), 'en': (322, 295, 392, 334), 'jp': (322, 295, 392, 334), 'tw': (322, 295, 392, 334)}, color={'cn': (219, 196, 198), 'en': (219, 196, 198), 'jp': (219, 196, 198), 'tw': (219, 196, 198)}, button={'cn': (322, 295, 392, 334), 'en': (322, 295, 392, 334), 'jp': (322, 295, 392, 334), 'tw': (322, 295, 392, 334)}, file={'cn': './assets/cn/coalition/FASHION_NORMAL.png', 'en': './assets/cn/coalition/FASHION_NORMAL.png', 'jp': './assets/cn/coalition/FASHION_NORMAL.png', 'tw': './assets/cn/coalition/FASHION_NORMAL.png'}) +FASHION_PT_OCR = Button(area={'cn': (881, 658, 937, 674), 'en': (881, 658, 937, 674), 'jp': (881, 658, 937, 674), 'tw': (881, 658, 937, 674)}, color={'cn': (136, 127, 122), 'en': (136, 127, 122), 'jp': (136, 127, 122), 'tw': (136, 127, 122)}, button={'cn': (881, 658, 937, 674), 'en': (881, 658, 937, 674), 'jp': (881, 658, 937, 674), 'tw': (881, 658, 937, 674)}, file={'cn': './assets/cn/coalition/FASHION_PT_OCR.png', 'en': './assets/cn/coalition/FASHION_PT_OCR.png', 'jp': './assets/cn/coalition/FASHION_PT_OCR.png', 'tw': './assets/cn/coalition/FASHION_PT_OCR.png'}) +FASHION_SP = Button(area={'cn': (704, 194, 762, 242), 'en': (704, 194, 762, 242), 'jp': (704, 194, 762, 242), 'tw': (704, 194, 762, 242)}, color={'cn': (146, 133, 135), 'en': (146, 133, 135), 'jp': (146, 133, 135), 'tw': (146, 133, 135)}, button={'cn': (704, 194, 762, 242), 'en': (704, 194, 762, 242), 'jp': (704, 194, 762, 242), 'tw': (704, 194, 762, 242)}, file={'cn': './assets/cn/coalition/FASHION_SP.png', 'en': './assets/cn/coalition/FASHION_SP.png', 'jp': './assets/cn/coalition/FASHION_SP.png', 'tw': './assets/cn/coalition/FASHION_SP.png'}) +FASHION_SWITCH_MULTI = Button(area={'cn': (1075, 457, 1206, 485), 'en': (1075, 457, 1206, 485), 'jp': (1075, 457, 1206, 485), 'tw': (1075, 457, 1206, 485)}, color={'cn': (233, 183, 63), 'en': (233, 183, 63), 'jp': (233, 183, 63), 'tw': (233, 183, 63)}, button={'cn': (1075, 457, 1206, 485), 'en': (1075, 457, 1206, 485), 'jp': (1075, 457, 1206, 485), 'tw': (1075, 457, 1206, 485)}, file={'cn': './assets/cn/coalition/FASHION_SWITCH_MULTI.png', 'en': './assets/cn/coalition/FASHION_SWITCH_MULTI.png', 'jp': './assets/cn/coalition/FASHION_SWITCH_MULTI.png', 'tw': './assets/cn/coalition/FASHION_SWITCH_MULTI.png'}) +FASHION_SWITCH_SINGLE = Button(area={'cn': (929, 457, 1059, 485), 'en': (929, 457, 1059, 485), 'jp': (929, 457, 1059, 485), 'tw': (929, 457, 1059, 485)}, color={'cn': (230, 181, 62), 'en': (230, 181, 62), 'jp': (230, 181, 62), 'tw': (230, 181, 62)}, button={'cn': (929, 457, 1059, 485), 'en': (929, 457, 1059, 485), 'jp': (929, 457, 1059, 485), 'tw': (929, 457, 1059, 485)}, file={'cn': './assets/cn/coalition/FASHION_SWITCH_SINGLE.png', 'en': './assets/cn/coalition/FASHION_SWITCH_SINGLE.png', 'jp': './assets/cn/coalition/FASHION_SWITCH_SINGLE.png', 'tw': './assets/cn/coalition/FASHION_SWITCH_SINGLE.png'}) FLEET_NOT_PREPARED = Button(area={'cn': (1008, 310, 1110, 334), 'en': (1008, 310, 1110, 334), 'jp': (1008, 310, 1110, 334), 'tw': (1008, 310, 1110, 334)}, color={'cn': (106, 106, 112), 'en': (106, 106, 112), 'jp': (106, 106, 112), 'tw': (108, 107, 112)}, button={'cn': (1008, 310, 1110, 334), 'en': (1008, 310, 1110, 334), 'jp': (1008, 310, 1110, 334), 'tw': (1008, 310, 1110, 334)}, file={'cn': './assets/cn/coalition/FLEET_NOT_PREPARED.png', 'en': './assets/cn/coalition/FLEET_NOT_PREPARED.png', 'jp': './assets/cn/coalition/FLEET_NOT_PREPARED.png', 'tw': './assets/tw/coalition/FLEET_NOT_PREPARED.png'}) FROSTFALL_COALITION_CHECK = Button(area={'cn': (118, 14, 227, 39), 'en': (118, 16, 221, 36), 'jp': (118, 14, 227, 39), 'tw': (118, 14, 227, 39)}, color={'cn': (145, 161, 200), 'en': (116, 130, 168), 'jp': (150, 166, 204), 'tw': (152, 168, 206)}, button={'cn': (118, 14, 227, 39), 'en': (118, 16, 221, 36), 'jp': (118, 14, 227, 39), 'tw': (118, 14, 227, 39)}, file={'cn': './assets/cn/coalition/FROSTFALL_COALITION_CHECK.png', 'en': './assets/en/coalition/FROSTFALL_COALITION_CHECK.png', 'jp': './assets/jp/coalition/FROSTFALL_COALITION_CHECK.png', 'tw': './assets/tw/coalition/FROSTFALL_COALITION_CHECK.png'}) FROSTFALL_EX = Button(area={'cn': (622, 372, 649, 384), 'en': (622, 372, 649, 384), 'jp': (622, 372, 649, 384), 'tw': (622, 372, 649, 384)}, color={'cn': (198, 152, 252), 'en': (198, 152, 252), 'jp': (198, 152, 252), 'tw': (182, 127, 252)}, button={'cn': (622, 372, 649, 384), 'en': (622, 372, 649, 384), 'jp': (622, 372, 649, 384), 'tw': (622, 372, 649, 384)}, file={'cn': './assets/cn/coalition/FROSTFALL_EX.png', 'en': './assets/en/coalition/FROSTFALL_EX.png', 'jp': './assets/jp/coalition/FROSTFALL_EX.png', 'tw': './assets/tw/coalition/FROSTFALL_EX.png'}) diff --git a/module/coalition/coalition.py b/module/coalition/coalition.py index 0addc5024..8fffc77b0 100644 --- a/module/coalition/coalition.py +++ b/module/coalition/coalition.py @@ -9,6 +9,7 @@ from module.log_res.log_res import LogRes from module.logger import logger from module.ocr.ocr import Digit from module.ui.assets import BACK_ARROW +from module.ui.page import page_campaign_menu class AcademyPtOcr(Digit): @@ -25,6 +26,7 @@ class AcademyPtOcr(Digit): pass return super().after_process(result) + class DALPtOcr(Digit): def __init__(self, *args, **kwargs): super().__init__(*args, **kwargs) @@ -58,7 +60,9 @@ class Coalition(CoalitionCombat, CampaignEvent): # use generic ocr model ocr = Digit(NEONCITY_PT_OCR, name='OCR_PT', lang='cnocr', letter=(208, 208, 208), threshold=128) elif event == 'coalition_20251120': - ocr = DALPtOcr(DAL_PT_OCR, name='OCR_PT' ,letter=(255, 213, 69), threshold=128) + ocr = DALPtOcr(DAL_PT_OCR, name='OCR_PT', letter=(255, 213, 69), threshold=128) + elif event == 'coalition_20260122': + ocr = Digit(FASHION_PT_OCR, name='OCR_PT', letter=(41, 40, 40), threshold=128) else: logger.error(f'ocr object is not defined in event {event}') raise ScriptError @@ -92,6 +96,15 @@ class Coalition(CoalitionCombat, CampaignEvent): return True else: return False + @property + def _coalition_has_oil_icon(self): + """ + Game devs are too asshole to drop oil display for UI design + https://github.com/LmeSzinc/AzurLaneAutoScript/issues/5214 + """ + if self.config.Campaign_Event == 'coalition_20260122': + return False + return True def triggered_stop_condition(self, oil_check=False, pt_check=False): """ @@ -105,7 +118,7 @@ class Coalition(CoalitionCombat, CampaignEvent): self.config.Scheduler_Enable = False return True # Oil limit - if oil_check: + if oil_check and self._coalition_has_oil_icon: if self.check_oil(): logger.hr('Triggered stop condition: Oil limit') self.config.task_delay(minute=(120, 240)) @@ -195,10 +208,10 @@ class Coalition(CoalitionCombat, CampaignEvent): logger.info(f'Count: {self.run_count}') # UI switches - # if self.config.SERVER in ['tw']: - # self.ui_goto(page_campaign_menu) - # if self.triggered_stop_condition(oil_check=True): - # break + if not self._coalition_has_oil_icon: + self.ui_goto(page_campaign_menu) + if self.triggered_stop_condition(oil_check=True): + break self.device.stuck_record_clear() self.device.click_record_clear() self.ui_goto_coalition() @@ -228,3 +241,9 @@ class Coalition(CoalitionCombat, CampaignEvent): # Scheduler if self.config.task_switched(): self.config.task_stop() + + +if __name__ == '__main__': + self = Coalition('alas5', task='Coalition') + self.device.screenshot() + self.get_event_pt() diff --git a/module/coalition/ui.py b/module/coalition/ui.py index d612e5a62..1107fa645 100644 --- a/module/coalition/ui.py +++ b/module/coalition/ui.py @@ -52,6 +52,10 @@ class CoalitionUI(Combat): elif event == 'coalition_20251120': logger.info('Coalition event coalition_20251120 has no mode switch') return + elif event == 'coalition_20260122': + mode_switch = Switch('CoalitionMode', offset=(20, 20)) + mode_switch.add_state('story', FASHION_MODE_STORY) + mode_switch.add_state('battle', FASHION_MODE_BATTLE) else: logger.error(f'MODE_SWITCH is not defined in event {event}') raise ScriptError @@ -85,6 +89,9 @@ class CoalitionUI(Combat): elif event == 'coalition_20251120': fleet_switch.add_state('single', DAL_SWITCH_SINGLE) fleet_switch.add_state('multi', DAL_SWITCH_MULTI) + elif event == 'coalition_20260122': + fleet_switch.add_state('single', FASHION_SWITCH_SINGLE) + fleet_switch.add_state('multi', FASHION_SWITCH_MULTI) else: logger.error(f'FLEET_SWITCH is not defined in event {event}') raise ScriptError @@ -107,24 +114,25 @@ class CoalitionUI(Combat): Button: Entrance button """ dic = { + # FROSTFALL ('coalition_20230323', 'tc1'): FROSTFALL_TC1, ('coalition_20230323', 'tc2'): FROSTFALL_TC2, ('coalition_20230323', 'tc3'): FROSTFALL_TC3, ('coalition_20230323', 'sp'): FROSTFALL_SP, ('coalition_20230323', 'ex'): FROSTFALL_EX, - + # ACADEMY ('coalition_20240627', 'easy'): ACADEMY_EASY, ('coalition_20240627', 'normal'): ACADEMY_NORMAL, ('coalition_20240627', 'hard'): ACADEMY_HARD, ('coalition_20240627', 'sp'): ACADEMY_SP, ('coalition_20240627', 'ex'): ACADEMY_EX, - + # NEONCITY ('coalition_20250626', 'easy'): NEONCITY_EASY, ('coalition_20250626', 'normal'): NEONCITY_NORMAL, ('coalition_20250626', 'hard'): NEONCITY_HARD, ('coalition_20250626', 'sp'): NEONCITY_SP, ('coalition_20250626', 'ex'): NEONCITY_EX, - + # DAL ('coalition_20251120', 'area1-normal'): DAL_AREA1, ('coalition_20251120', 'area2-normal'): DAL_AREA2, ('coalition_20251120', 'area3-normal'): DAL_AREA3, @@ -137,6 +145,12 @@ class CoalitionUI(Combat): ('coalition_20251120', 'area4-hard'): DAL_AREA4, ('coalition_20251120', 'area5-hard'): DAL_AREA5, ('coalition_20251120', 'area6-hard'): DAL_AREA6, + # FASHION + ('coalition_20260122', 'easy'): FASHION_EASY, + ('coalition_20260122', 'normal'): FASHION_NORMAL, + ('coalition_20260122', 'hard'): FASHION_HARD, + ('coalition_20260122', 'sp'): FASHION_SP, + ('coalition_20260122', 'ex'): FASHION_EX, } stage = stage.lower() try: @@ -149,12 +163,14 @@ class CoalitionUI(Combat): def coalition_20251120_get_entrance_difficulty(event, stage): """ Args: + event (str): Event name. stage (str): Stage name. Returns: Button: Entrance difficulty button """ dic = { + # DAL ('coalition_20251120', 'area1-normal'): DAL_NORMAL, ('coalition_20251120', 'area2-normal'): DAL_NORMAL, ('coalition_20251120', 'area3-normal'): DAL_NORMAL, @@ -186,24 +202,25 @@ class CoalitionUI(Combat): int: Number of battles """ dic = { + # FROSTFALL ('coalition_20230323', 'tc1'): 1, ('coalition_20230323', 'tc2'): 2, ('coalition_20230323', 'tc3'): 3, ('coalition_20230323', 'sp'): 1, ('coalition_20230323', 'ex'): 1, - + # ACADEMY ('coalition_20240627', 'easy'): 1, ('coalition_20240627', 'normal'): 2, ('coalition_20240627', 'hard'): 3, ('coalition_20240627', 'sp'): 4, ('coalition_20240627', 'ex'): 5, - + # NEONCITY ('coalition_20250626', 'easy'): 1, ('coalition_20250626', 'normal'): 2, ('coalition_20250626', 'hard'): 3, ('coalition_20250626', 'sp'): 4, ('coalition_20250626', 'ex'): 5, - + # DAL ('coalition_20251120', 'area1-normal'): 2, ('coalition_20251120', 'area2-normal'): 3, ('coalition_20251120', 'area3-normal'): 3, @@ -216,6 +233,12 @@ class CoalitionUI(Combat): ('coalition_20251120', 'area4-hard'): 3, ('coalition_20251120', 'area5-hard'): 3, ('coalition_20251120', 'area6-hard'): 4, + # FASHION + ('coalition_20260122', 'easy'): 1, + ('coalition_20260122', 'normal'): 2, + ('coalition_20260122', 'hard'): 3, + ('coalition_20260122', 'sp'): 4, + ('coalition_20260122', 'ex'): 5, } stage = stage.lower() try: @@ -241,6 +264,9 @@ class CoalitionUI(Combat): return NEONCITY_FLEET_PREPARATION elif event == 'coalition_20251120': return DAL_FLEET_PREPARATION + elif event == 'coalition_20260122': + # FASHION reuses NEONCITY, just (-12, -12) shifted + return NEONCITY_FLEET_PREPARATION else: logger.error(f'FLEET_PREPARATION is not defined in event {event}') raise ScriptError @@ -261,10 +287,12 @@ class CoalitionUI(Combat): # No fleet switch in TC1 if stage in ['tc1', 'sp']: return False - if event == 'coalition_20240627': - if stage in ['easy', 'sp', 'ex']: - return False - if event == 'coalition_20250626': + if event in [ + 'coalition_20240627', + 'coalition_20250626', + 'coalition_20260122', + ]: + # easy is single fleet, SP and EX must must multiple fleets if stage in ['easy', 'sp', 'ex']: return False @@ -297,13 +325,12 @@ class CoalitionUI(Combat): logger.info(f'{DAL_DIFFICULTY_EXIT} -> {DAL_DIFFICULTY_EXIT}') continue - def enter_map(self, event, stage, mode, skip_first_screenshot=True): + def enter_map(self, event, stage, mode): """ Args: event (str): Event name such as 'coalition_20230323' stage (str): Stage name such as 'TC3' mode (str): 'single' or 'multi' - skip_first_screenshot: Pages: in: in_coalition @@ -321,12 +348,8 @@ class CoalitionUI(Combat): campaign_click = 0 campaign_difficulty_click = 0 fleet_click = 0 - while 1: - if skip_first_screenshot: - skip_first_screenshot = False - else: - self.device.screenshot() + for _ in self.loop(): # Check errors if campaign_click > 5: logger.critical(f"Failed to enter {button}, too many click on {button}") diff --git a/module/combat/assets.py b/module/combat/assets.py index 76ff87e60..b73eeee65 100644 --- a/module/combat/assets.py +++ b/module/combat/assets.py @@ -41,6 +41,7 @@ MOVE_DOWN = Button(area={'cn': (148, 647, 155, 669), 'en': (148, 647, 155, 669), MOVE_LEFT_DOWN = Button(area={'cn': (67, 668, 112, 707), 'en': (67, 668, 112, 707), 'jp': (67, 668, 112, 707), 'tw': (67, 668, 112, 707)}, color={'cn': (65, 80, 100), 'en': (65, 80, 100), 'jp': (65, 80, 100), 'tw': (65, 80, 100)}, button={'cn': (67, 668, 112, 707), 'en': (67, 668, 112, 707), 'jp': (67, 668, 112, 707), 'tw': (67, 668, 112, 707)}, file={'cn': './assets/cn/combat/MOVE_LEFT_DOWN.png', 'en': './assets/en/combat/MOVE_LEFT_DOWN.png', 'jp': './assets/jp/combat/MOVE_LEFT_DOWN.png', 'tw': './assets/tw/combat/MOVE_LEFT_DOWN.png'}) NEW_SHIP = Button(area={'cn': (206, 87, 213, 93), 'en': (206, 87, 213, 93), 'jp': (206, 87, 213, 93), 'tw': (206, 87, 213, 93)}, color={'cn': (235, 171, 60), 'en': (235, 171, 60), 'jp': (235, 171, 60), 'tw': (235, 171, 60)}, button={'cn': (206, 87, 213, 93), 'en': (206, 87, 213, 93), 'jp': (206, 87, 213, 93), 'tw': (206, 87, 213, 93)}, file={'cn': './assets/cn/combat/NEW_SHIP.png', 'en': './assets/en/combat/NEW_SHIP.png', 'jp': './assets/jp/combat/NEW_SHIP.png', 'tw': './assets/tw/combat/NEW_SHIP.png'}) OPTS_INFO_D = Button(area={'cn': (601, 151, 704, 178), 'en': (565, 143, 692, 179), 'jp': (512, 154, 605, 176), 'tw': (602, 152, 702, 177)}, color={'cn': (158, 110, 113), 'en': (171, 116, 110), 'jp': (201, 187, 191), 'tw': (164, 130, 137)}, button={'cn': (583, 605, 677, 628), 'en': (590, 587, 627, 647), 'jp': (574, 596, 685, 635), 'tw': (583, 604, 676, 627)}, file={'cn': './assets/cn/combat/OPTS_INFO_D.png', 'en': './assets/en/combat/OPTS_INFO_D.png', 'jp': './assets/jp/combat/OPTS_INFO_D.png', 'tw': './assets/tw/combat/OPTS_INFO_D.png'}) +QUIT_RECONFIRM = Button(area={'cn': (749, 501, 828, 540), 'en': (761, 495, 818, 523), 'jp': (746, 490, 830, 530), 'tw': (754, 491, 825, 522)}, color={'cn': (207, 140, 133), 'en': (208, 147, 141), 'jp': (203, 138, 132), 'tw': (211, 158, 152)}, button={'cn': (749, 501, 828, 540), 'en': (761, 495, 818, 523), 'jp': (746, 490, 830, 530), 'tw': (754, 491, 825, 522)}, file={'cn': './assets/cn/combat/QUIT_RECONFIRM.png', 'en': './assets/en/combat/QUIT_RECONFIRM.png', 'jp': './assets/jp/combat/QUIT_RECONFIRM.png', 'tw': './assets/tw/combat/QUIT_RECONFIRM.png'}) READY_AIR_RAID = Button(area={'cn': (887, 618, 907, 628), 'en': (887, 618, 907, 628), 'jp': (887, 618, 907, 628), 'tw': (887, 618, 907, 628)}, color={'cn': (255, 255, 255), 'en': (255, 255, 255), 'jp': (255, 255, 255), 'tw': (255, 255, 255)}, button={'cn': (887, 618, 907, 628), 'en': (887, 618, 907, 628), 'jp': (887, 618, 907, 628), 'tw': (887, 618, 907, 628)}, file={'cn': './assets/cn/combat/READY_AIR_RAID.png', 'en': './assets/en/combat/READY_AIR_RAID.png', 'jp': './assets/jp/combat/READY_AIR_RAID.png', 'tw': './assets/tw/combat/READY_AIR_RAID.png'}) READY_TORPEDO = Button(area={'cn': (1038, 611, 1046, 619), 'en': (1038, 611, 1046, 619), 'jp': (1038, 611, 1046, 619), 'tw': (1038, 611, 1046, 619)}, color={'cn': (255, 255, 255), 'en': (255, 255, 255), 'jp': (255, 255, 255), 'tw': (255, 255, 255)}, button={'cn': (1038, 611, 1046, 619), 'en': (1038, 611, 1046, 619), 'jp': (1038, 611, 1046, 619), 'tw': (1038, 611, 1046, 619)}, file={'cn': './assets/cn/combat/READY_TORPEDO.png', 'en': './assets/en/combat/READY_TORPEDO.png', 'jp': './assets/jp/combat/READY_TORPEDO.png', 'tw': './assets/tw/combat/READY_TORPEDO.png'}) SUBMARINE_AVAILABLE_CHECK_1 = Button(area={'cn': (707, 660, 712, 665), 'en': (707, 660, 712, 665), 'jp': (707, 660, 712, 665), 'tw': (707, 660, 712, 665)}, color={'cn': (255, 255, 255), 'en': (255, 255, 255), 'jp': (255, 255, 255), 'tw': (255, 255, 255)}, button={'cn': (707, 660, 712, 665), 'en': (707, 660, 712, 665), 'jp': (707, 660, 712, 665), 'tw': (707, 660, 712, 665)}, file={'cn': './assets/cn/combat/SUBMARINE_AVAILABLE_CHECK_1.png', 'en': './assets/en/combat/SUBMARINE_AVAILABLE_CHECK_1.png', 'jp': './assets/jp/combat/SUBMARINE_AVAILABLE_CHECK_1.png', 'tw': './assets/tw/combat/SUBMARINE_AVAILABLE_CHECK_1.png'}) diff --git a/module/combat/combat.py b/module/combat/combat.py index d7f91057b..f2c1feb7f 100644 --- a/module/combat/combat.py +++ b/module/combat/combat.py @@ -177,6 +177,15 @@ class Combat(Level, HPBalancer, Retirement, SubmarineCall, CombatAuto, CombatMan return True return False + def handle_combat_quit_reconfirm(self, interval=2): + # QUIT_RECONFIRM interval should shorter than QUIT, + # so multiple retries can be made during the interval of QUIT + if self.appear_then_click(QUIT_RECONFIRM, offset=(20, 20), interval=interval): + # reset QUIT timer to avoid duplicate QUIT clicks canceling QUIT_RECONFIRM + self.interval_reset(QUIT) + return True + return False + def ensure_combat_oil_loaded(self): self.wait_until_stable(COMBAT_OIL_LOADING) diff --git a/module/config/argument/args.json b/module/config/argument/args.json index 47091a50e..1663268cd 100644 --- a/module/config/argument/args.json +++ b/module/config/argument/args.json @@ -1937,8 +1937,8 @@ "type": "select", "value": "campaign_main", "option": [ - "event_20231221_cn", - "event_20251218_cn" + "event_20220526_cn", + "event_20231221_cn" ], "display": "hide", "option_cn": [ @@ -1951,11 +1951,11 @@ "event_20231221_cn" ], "option_tw": [ - "event_20251218_cn" + "event_20220526_cn" ], "option_bold": [ - "event_20231221_cn", - "event_20251218_cn" + "event_20220526_cn", + "event_20231221_cn" ] }, "Mode": { @@ -2307,6 +2307,268 @@ } } }, + "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", + "coalition_20260122" + ], + "option_cn": [ + "coalition_20260122" + ], + "option_en": [ + "coalition_20260122" + ], + "option_jp": [ + "coalition_20260122" + ], + "option_tw": [ + "coalition_20251120" + ], + "option_bold": [ + "coalition_20251120", + "coalition_20260122" + ] + }, + "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" + }, + "ClearAfterSinking": { + "type": "checkbox", + "value": false, + "display": "hide" + } + }, + "Coalition": { + "Mode": { + "type": "select", + "value": "hard", + "option": [ + "easy", + "normal", + "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": { @@ -2352,8 +2614,8 @@ "type": "state", "value": "campaign_main", "option": [ - "event_20231221_cn", - "event_20251218_cn" + "event_20220526_cn", + "event_20231221_cn" ], "option_cn": [ "event_20231221_cn" @@ -2365,11 +2627,11 @@ "event_20231221_cn" ], "option_tw": [ - "event_20251218_cn" + "event_20220526_cn" ], "option_bold": [ - "event_20231221_cn", - "event_20251218_cn" + "event_20220526_cn", + "event_20231221_cn" ] }, "Mode": { @@ -2760,8 +3022,8 @@ "type": "state", "value": "campaign_main", "option": [ - "event_20231221_cn", - "event_20251218_cn" + "event_20220526_cn", + "event_20231221_cn" ], "option_cn": [ "event_20231221_cn" @@ -2773,11 +3035,11 @@ "event_20231221_cn" ], "option_tw": [ - "event_20251218_cn" + "event_20220526_cn" ], "option_bold": [ - "event_20231221_cn", - "event_20251218_cn" + "event_20220526_cn", + "event_20231221_cn" ] }, "Mode": { @@ -3564,275 +3826,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" - }, - "ClearAfterSinking": { - "type": "checkbox", - "value": false, - "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": { @@ -4503,6 +4496,270 @@ } } }, + "CoalitionSp": { + "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": "CoalitionSp", + "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": "sp", + "display": "hide" + }, + "Event": { + "type": "state", + "value": "campaign_main", + "option": [ + "coalition_20251120", + "coalition_20260122" + ], + "option_cn": [ + "coalition_20260122" + ], + "option_en": [ + "coalition_20260122" + ], + "option_jp": [ + "coalition_20260122" + ], + "option_tw": [ + "coalition_20251120" + ], + "option_bold": [ + "coalition_20251120", + "coalition_20260122" + ] + }, + "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" + }, + "ClearAfterSinking": { + "type": "checkbox", + "value": false, + "display": "hide" + } + }, + "Coalition": { + "Mode": { + "type": "select", + "value": "sp", + "option": [ + "easy", + "normal", + "hard", + "sp" + ], + "display": "hide" + }, + "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" + } + } + }, "EventA": { "Scheduler": { "Enable": { @@ -4559,8 +4816,8 @@ "type": "state", "value": "campaign_main", "option": [ - "event_20231221_cn", - "event_20251218_cn" + "event_20220526_cn", + "event_20231221_cn" ], "option_cn": [ "event_20231221_cn" @@ -4572,11 +4829,11 @@ "event_20231221_cn" ], "option_tw": [ - "event_20251218_cn" + "event_20220526_cn" ], "option_bold": [ - "event_20231221_cn", - "event_20251218_cn" + "event_20220526_cn", + "event_20231221_cn" ] }, "Mode": { @@ -4985,8 +5242,8 @@ "type": "state", "value": "campaign_main", "option": [ - "event_20231221_cn", - "event_20251218_cn" + "event_20220526_cn", + "event_20231221_cn" ], "option_cn": [ "event_20231221_cn" @@ -4998,11 +5255,11 @@ "event_20231221_cn" ], "option_tw": [ - "event_20251218_cn" + "event_20220526_cn" ], "option_bold": [ - "event_20231221_cn", - "event_20251218_cn" + "event_20220526_cn", + "event_20231221_cn" ] }, "Mode": { @@ -5411,8 +5668,8 @@ "type": "state", "value": "campaign_main", "option": [ - "event_20231221_cn", - "event_20251218_cn" + "event_20220526_cn", + "event_20231221_cn" ], "option_cn": [ "event_20231221_cn" @@ -5424,11 +5681,11 @@ "event_20231221_cn" ], "option_tw": [ - "event_20251218_cn" + "event_20220526_cn" ], "option_bold": [ - "event_20231221_cn", - "event_20251218_cn" + "event_20220526_cn", + "event_20231221_cn" ] }, "Mode": { @@ -5837,8 +6094,8 @@ "type": "state", "value": "campaign_main", "option": [ - "event_20231221_cn", - "event_20251218_cn" + "event_20220526_cn", + "event_20231221_cn" ], "option_cn": [ "event_20231221_cn" @@ -5850,11 +6107,11 @@ "event_20231221_cn" ], "option_tw": [ - "event_20251218_cn" + "event_20220526_cn" ], "option_bold": [ - "event_20231221_cn", - "event_20251218_cn" + "event_20220526_cn", + "event_20231221_cn" ] }, "Mode": { @@ -6253,8 +6510,8 @@ "type": "state", "value": "campaign_main", "option": [ - "event_20231221_cn", - "event_20251218_cn" + "event_20220526_cn", + "event_20231221_cn" ], "option_cn": [ "event_20231221_cn" @@ -6266,11 +6523,11 @@ "event_20231221_cn" ], "option_tw": [ - "event_20251218_cn" + "event_20220526_cn" ], "option_bold": [ - "event_20231221_cn", - "event_20251218_cn" + "event_20220526_cn", + "event_20231221_cn" ] }, "Mode": { @@ -6872,275 +7129,6 @@ } } }, - "CoalitionSp": { - "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": "CoalitionSp", - "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": "sp", - "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" - }, - "ClearAfterSinking": { - "type": "checkbox", - "value": false, - "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" - } - } - }, "Commission": { "Scheduler": { "Enable": { diff --git a/module/config/argument/argument.yaml b/module/config/argument/argument.yaml index ee592a0a6..4aed7aad8 100644 --- a/module/config/argument/argument.yaml +++ b/module/config/argument/argument.yaml @@ -340,8 +340,8 @@ MaritimeEscort: Enable: true Coalition: Mode: - 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 ] + value: hard + option: [ easy, normal, hard, sp ] Fleet: value: single option: [ single, multi ] diff --git a/module/config/argument/menu.json b/module/config/argument/menu.json index b248becd4..e066ae833 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" ] @@ -36,13 +36,13 @@ "menu": "collapse", "page": "setting", "tasks": [ + "CoalitionSp", "EventA", "EventB", "EventC", "EventD", "EventSp", - "RaidDaily", - "CoalitionSp" + "RaidDaily" ] }, "Reward": { diff --git a/module/config/argument/override.yaml b/module/config/argument/override.yaml index 589efe946..c86a198b9 100644 --- a/module/config/argument/override.yaml +++ b/module/config/argument/override.yaml @@ -257,9 +257,9 @@ Coalition: Use2xBook: false AmbushEvade: true ClearAfterSinking: false -# Coalition: -# Mode: -# option: [ easy, normal, hard, ex ] + Coalition: + Mode: + option: [ easy, normal, hard ] StopCondition: MapAchievement: non_stop StageIncrease: false diff --git a/module/config/argument/task.yaml b/module/config/argument/task.yaml index f2c89708f..e9c08ea94 100644 --- a/module/config/argument/task.yaml +++ b/module/config/argument/task.yaml @@ -73,6 +73,12 @@ Event: EventGeneral: - EventGeneral - TaskBalancer + Coalition: + - Scheduler + - Campaign + - Coalition + - StopCondition + - Emotion Event: - Scheduler - Campaign @@ -102,12 +108,6 @@ Event: - Hospital - StopCondition - Emotion - Coalition: - - Scheduler - - Campaign - - Coalition - - StopCondition - - Emotion MaritimeEscort: - Scheduler - MaritimeEscort @@ -129,6 +129,12 @@ EventDaily: menu: 'collapse' page: 'setting' tasks: + CoalitionSp: + - Scheduler + - Campaign + - Coalition + - StopCondition + - Emotion EventA: - Scheduler - EventDaily @@ -184,12 +190,6 @@ EventDaily: - Campaign - StopCondition - Emotion - CoalitionSp: - - Scheduler - - Campaign - - Coalition - - StopCondition - - Emotion # ==================== Reward ==================== diff --git a/module/config/config_generated.py b/module/config/config_generated.py index cf6537518..7568c2ccf 100644 --- a/module/config/config_generated.py +++ b/module/config/config_generated.py @@ -199,7 +199,7 @@ class GeneratedConfig: MaritimeEscort_Enable = True # Group `Coalition` - Coalition_Mode = 'area1-normal' # area1-normal, area1-hard, area2-normal, area2-hard, area3-normal, area3-hard, area4-normal, area4-hard, area5-normal, area5-hard, area6-normal, area6-hard + Coalition_Mode = 'hard' # easy, normal, hard, sp Coalition_Fleet = 'single' # single, multi # Group `Commission` diff --git a/module/config/i18n/en-US.json b/module/config/i18n/en-US.json index 5c3878337..887a1ed88 100644 --- a/module/config/i18n/en-US.json +++ b/module/config/i18n/en-US.json @@ -66,6 +66,10 @@ "name": "Event General", "help": "" }, + "Coalition": { + "name": "Light & Shadow Fashion Shoot", + "help": "" + }, "Event": { "name": "Event", "help": "" @@ -82,10 +86,6 @@ "name": "Valley Hospital Story", "help": "" }, - "Coalition": { - "name": "DATE A LANE", - "help": "" - }, "MaritimeEscort": { "name": "Maritime Escort", "help": "" @@ -94,6 +94,10 @@ "name": "War Archives", "help": "Due to the lack of maintenance of war archives, continuous clear may not work normally, if Alas runs abnormally, Please manually finish clearing and use auto search" }, + "CoalitionSp": { + "name": "Light & Shadow Fashion Shoot SP", + "help": "" + }, "EventA": { "name": "Event Daily A", "help": "" @@ -118,10 +122,6 @@ "name": "Raid Daily", "help": "" }, - "CoalitionSp": { - "name": "Neon City Investigator SP", - "help": "" - }, "Commission": { "name": "Commission", "help": "" @@ -702,6 +702,7 @@ "coalition_20240627": "Welcome to Little Academy", "coalition_20250626": "The Neon City Investigator", "coalition_20251120": "DATE A LANE", + "coalition_20260122": "Light & Shadow Fashion Shoot!", "event_20200227_cn": "Northern Overture", "event_20200312_cn": "The Solomon Ranger Rerun", "event_20200326_cn": "Microlayer Medley", @@ -1414,18 +1415,10 @@ "Mode": { "name": "Mode", "help": "SP needs to use event daily SP to run", - "area1-normal": "area1-normal", - "area1-hard": "area1-hard", - "area2-normal": "area2-normal", - "area2-hard": "area2-hard", - "area3-normal": "area3-normal", - "area3-hard": "area3-hard", - "area4-normal": "area4-normal", - "area4-hard": "area4-hard", - "area5-normal": "area5-normal", - "area5-hard": "area5-hard", - "area6-normal": "area6-normal", - "area6-hard": "area6-hard" + "easy": "Easy", + "normal": "Normal", + "hard": "Hard", + "sp": "SP" }, "Fleet": { "name": "Fleet", diff --git a/module/config/i18n/ja-JP.json b/module/config/i18n/ja-JP.json index 41a588db4..cf43f6bba 100644 --- a/module/config/i18n/ja-JP.json +++ b/module/config/i18n/ja-JP.json @@ -66,6 +66,10 @@ "name": "イベント共通設定", "help": "" }, + "Coalition": { + "name": "特集写真-撮影進行中", + "help": "" + }, "Event": { "name": "イベント海域", "help": "" @@ -82,10 +86,6 @@ "name": "病院探訪ストーリー", "help": "" }, - "Coalition": { - "name": "ネオンシティの探索者", - "help": "" - }, "MaritimeEscort": { "name": "Maritime Escort", "help": "" @@ -94,6 +94,10 @@ "name": "作戦履歴", "help": "" }, + "CoalitionSp": { + "name": "特集写真-撮影進行中SP", + "help": "" + }, "EventA": { "name": "毎日イベント海域A", "help": "" @@ -118,10 +122,6 @@ "name": "Raid Daily", "help": "" }, - "CoalitionSp": { - "name": "ネオンシティの探索者SP", - "help": "" - }, "Commission": { "name": "委託", "help": "" @@ -702,6 +702,7 @@ "coalition_20240627": "リトル学園へようこそ", "coalition_20250626": "ネオンシティの探索者", "coalition_20251120": "DATE A LANE", + "coalition_20260122": "特集写真-撮影進行中", "event_20200227_cn": "凍絶の北海", "event_20200312_cn": "南洋に靡く硝煙(復刻)", "event_20200326_cn": "闇靄払う銀翼", @@ -1414,18 +1415,10 @@ "Mode": { "name": "Coalition.Mode.name", "help": "Coalition.Mode.help", - "area1-normal": "area1-normal", - "area1-hard": "area1-hard", - "area2-normal": "area2-normal", - "area2-hard": "area2-hard", - "area3-normal": "area3-normal", - "area3-hard": "area3-hard", - "area4-normal": "area4-normal", - "area4-hard": "area4-hard", - "area5-normal": "area5-normal", - "area5-hard": "area5-hard", - "area6-normal": "area6-normal", - "area6-hard": "area6-hard" + "easy": "easy", + "normal": "normal", + "hard": "hard", + "sp": "sp" }, "Fleet": { "name": "Coalition.Fleet.name", diff --git a/module/config/i18n/zh-CN.json b/module/config/i18n/zh-CN.json index 68c0aaa78..fc111d874 100644 --- a/module/config/i18n/zh-CN.json +++ b/module/config/i18n/zh-CN.json @@ -66,6 +66,10 @@ "name": "活动通用设置", "help": "" }, + "Coalition": { + "name": "光影风尚-拍摄进行时", + "help": "" + }, "Event": { "name": "活动图", "help": "" @@ -82,10 +86,6 @@ "name": "深谷来信", "help": "" }, - "Coalition": { - "name": "DATE A LANE", - "help": "" - }, "MaritimeEscort": { "name": "商船护航", "help": "" @@ -94,6 +94,10 @@ "name": "作战档案", "help": "由于作战档案缺少维护,开荒功能不一定能正常使用,如果发现Alas运行异常,请手动完成开荒后使用自律寻敌功能" }, + "CoalitionSp": { + "name": "光影风尚-拍摄进行时SP", + "help": "" + }, "EventA": { "name": "活动每日A图", "help": "" @@ -118,10 +122,6 @@ "name": "共斗活动每日", "help": "" }, - "CoalitionSp": { - "name": "迷彩都市的寻踪者SP", - "help": "" - }, "Commission": { "name": "委托", "help": "" @@ -702,6 +702,7 @@ "coalition_20240627": "欢迎来到童心学院", "coalition_20250626": "迷彩都市的寻踪者", "coalition_20251120": "DATE A LANE", + "coalition_20260122": "光影风尚-拍摄进行时", "event_20200227_cn": "北境序曲", "event_20200312_cn": "复刻斯图尔特的硝烟", "event_20200326_cn": "微层混合", @@ -1414,18 +1415,10 @@ "Mode": { "name": "难度", "help": "SP图需要使用活动每日SP运行", - "area1-normal": "AREA-1 普通", - "area1-hard": "AREA-1 困难", - "area2-normal": "AREA-2 普通", - "area2-hard": "AREA-2 困难", - "area3-normal": "AREA-3 普通", - "area3-hard": "AREA-3 困难", - "area4-normal": "AREA-4 普通", - "area4-hard": "AREA-4 困难", - "area5-normal": "AREA-5 普通", - "area5-hard": "AREA-5 困难", - "area6-normal": "AREA-6 普通", - "area6-hard": "AREA-6 困难" + "easy": "简单", + "normal": "普通", + "hard": "困难", + "sp": "SP" }, "Fleet": { "name": "出击队伍", diff --git a/module/config/i18n/zh-TW.json b/module/config/i18n/zh-TW.json index 214b99067..de4cb5a44 100644 --- a/module/config/i18n/zh-TW.json +++ b/module/config/i18n/zh-TW.json @@ -66,6 +66,10 @@ "name": "活動通用", "help": "" }, + "Coalition": { + "name": "光影風尚-拍攝進行時", + "help": "" + }, "Event": { "name": "活動圖", "help": "" @@ -82,10 +86,6 @@ "name": "深谷来信", "help": "" }, - "Coalition": { - "name": "極地風暴", - "help": "" - }, "MaritimeEscort": { "name": "商船護航", "help": "" @@ -94,6 +94,10 @@ "name": "作戰檔案", "help": "由於作戰檔案缺少維護,開荒功能不一定能正常使用,如果發現Alas運行異常,請手動完成開荒後使用自律尋敵功能" }, + "CoalitionSp": { + "name": "光影風尚-拍攝進行時SP", + "help": "" + }, "EventA": { "name": "活動每日A圖", "help": "" @@ -118,10 +122,6 @@ "name": "共鬥活動每日", "help": "" }, - "CoalitionSp": { - "name": "極地風暴每日SP", - "help": "" - }, "Commission": { "name": "委託", "help": "" @@ -702,6 +702,7 @@ "coalition_20240627": "歡迎來到童心學院", "coalition_20250626": "迷彩都市的尋蹤者", "coalition_20251120": "DATE A LANE", + "coalition_20260122": "Light & Shadow Fashion Shoot!", "event_20200227_cn": "Northern Overture", "event_20200312_cn": "斯圖爾特的硝煙", "event_20200326_cn": "Microlayer Medley", @@ -1414,18 +1415,10 @@ "Mode": { "name": "難度", "help": "SP圖需要使用活動每日SP運行", - "area1-normal": "area1-normal", - "area1-hard": "area1-hard", - "area2-normal": "area2-normal", - "area2-hard": "area2-hard", - "area3-normal": "area3-normal", - "area3-hard": "area3-hard", - "area4-normal": "area4-normal", - "area4-hard": "area4-hard", - "area5-normal": "area5-normal", - "area5-hard": "area5-hard", - "area6-normal": "area6-normal", - "area6-hard": "area6-hard" + "easy": "簡單", + "normal": "普通", + "hard": "困難", + "sp": "SP" }, "Fleet": { "name": "出擊隊伍", diff --git a/module/exercise/assets.py b/module/exercise/assets.py index 052fecfd0..fcb325b41 100644 --- a/module/exercise/assets.py +++ b/module/exercise/assets.py @@ -21,4 +21,3 @@ OPPONENT_1 = Button(area={'cn': (104, 77, 316, 381), 'en': (102, 76, 318, 381), OPPONENT_2 = Button(area={'cn': (348, 77, 560, 381), 'en': (348, 77, 562, 381), 'jp': (348, 77, 560, 381), 'tw': (348, 77, 560, 381)}, color={'cn': (105, 123, 149), 'en': (105, 122, 150), 'jp': (105, 123, 149), 'tw': (105, 123, 149)}, button={'cn': (348, 77, 560, 381), 'en': (348, 77, 562, 381), 'jp': (348, 77, 560, 381), 'tw': (348, 77, 560, 381)}, file={'cn': './assets/cn/exercise/OPPONENT_2.png', 'en': './assets/en/exercise/OPPONENT_2.png', 'jp': './assets/jp/exercise/OPPONENT_2.png', 'tw': './assets/tw/exercise/OPPONENT_2.png'}) OPPONENT_3 = Button(area={'cn': (592, 77, 804, 381), 'en': (592, 77, 806, 381), 'jp': (592, 77, 804, 381), 'tw': (592, 77, 804, 381)}, color={'cn': (106, 131, 158), 'en': (105, 129, 156), 'jp': (106, 131, 158), 'tw': (106, 131, 158)}, button={'cn': (592, 77, 804, 381), 'en': (592, 77, 806, 381), 'jp': (592, 77, 804, 381), 'tw': (592, 77, 804, 381)}, file={'cn': './assets/cn/exercise/OPPONENT_3.png', 'en': './assets/en/exercise/OPPONENT_3.png', 'jp': './assets/jp/exercise/OPPONENT_3.png', 'tw': './assets/tw/exercise/OPPONENT_3.png'}) OPPONENT_4 = Button(area={'cn': (836, 77, 1048, 381), 'en': (836, 77, 1050, 381), 'jp': (836, 77, 1048, 381), 'tw': (836, 77, 1048, 381)}, color={'cn': (103, 118, 141), 'en': (112, 127, 152), 'jp': (103, 118, 141), 'tw': (103, 118, 141)}, button={'cn': (836, 77, 1048, 381), 'en': (836, 77, 1050, 381), 'jp': (836, 77, 1048, 381), 'tw': (836, 77, 1048, 381)}, file={'cn': './assets/cn/exercise/OPPONENT_4.png', 'en': './assets/en/exercise/OPPONENT_4.png', 'jp': './assets/jp/exercise/OPPONENT_4.png', 'tw': './assets/tw/exercise/OPPONENT_4.png'}) -QUIT_RECONFIRM = Button(area={'cn': (703, 492, 877, 550), 'en': (731, 488, 846, 533), 'jp': (703, 482, 877, 539), 'tw': (754, 491, 825, 522)}, color={'cn': (195, 111, 102), 'en': (195, 112, 105), 'jp': (193, 112, 104), 'tw': (211, 158, 152)}, button={'cn': (703, 492, 877, 550), 'en': (731, 488, 846, 533), 'jp': (703, 482, 877, 539), 'tw': (703, 502, 876, 559)}, file={'cn': './assets/cn/exercise/QUIT_RECONFIRM.png', 'en': './assets/en/exercise/QUIT_RECONFIRM.png', 'jp': './assets/jp/exercise/QUIT_RECONFIRM.png', 'tw': './assets/tw/exercise/QUIT_RECONFIRM.png'}) diff --git a/module/exercise/combat.py b/module/exercise/combat.py index b5df3798b..bdfbed9fa 100644 --- a/module/exercise/combat.py +++ b/module/exercise/combat.py @@ -1,5 +1,4 @@ from module.combat.combat import * -from module.combat.combat import QUIT from module.exercise.assets import * from module.exercise.equipment import ExerciseEquipment from module.exercise.hp_daemon import HpDaemon @@ -108,8 +107,7 @@ class ExerciseCombat(HpDaemon, OpponentChoose, ExerciseEquipment, Combat): success = False end = True continue - if self.appear_then_click(QUIT_RECONFIRM, offset=(20, 20), interval=5): - self.interval_reset(QUIT) + if self.handle_combat_quit_reconfirm(): pause_interval.reset() continue if not end: diff --git a/module/os/fleet.py b/module/os/fleet.py index 491652c42..035d9eac1 100644 --- a/module/os/fleet.py +++ b/module/os/fleet.py @@ -9,7 +9,6 @@ from module.base.timer import Timer from module.base.utils import point_limit from module.config.utils import dict_to_kv from module.exception import MapWalkError -from module.exercise.assets import QUIT_RECONFIRM from module.handler.assets import MAINTENANCE_ANNOUNCE from module.logger import logger from module.map.fleet import Fleet @@ -273,12 +272,7 @@ class OSFleet(OSCamera, Combat, Fleet, OSAsh): logger.hr('Wait until camera stable') record = None confirm_timer = Timer(0.6, count=2).start() - while 1: - if skip_first_screenshot: - skip_first_screenshot = False - else: - self.device.screenshot() - + for _ in self.loop(skip_first=skip_first_screenshot): self.update_os() current = self.view.backend.homo_loca logger.attr('homo_loca', current) @@ -325,12 +319,7 @@ class OSFleet(OSCamera, Combat, Fleet, OSAsh): clicked_story_count = 0 stuck_timer = Timer(20, count=5).start() confirm_timer.reset() - while 1: - if skip_first_screenshot: - skip_first_screenshot = False - else: - self.device.screenshot() - + for _ in self.loop(skip_first=skip_first_screenshot): # Map event event = self.handle_map_event(drop=drop) if event: @@ -762,7 +751,7 @@ class OSFleet(OSCamera, Combat, Fleet, OSAsh): button = Button(area=area, color=(), button=area, name='BOSS_LEAVE') return button - def boss_leave(self, skip_first_screenshot=True): + def boss_leave(self): """ Pages: in: is_in_map(), or combat_appear() @@ -774,12 +763,7 @@ class OSFleet(OSCamera, Combat, Fleet, OSAsh): click_timer = Timer(3) pause_interval = Timer(0.5, count=1) - while 1: - if skip_first_screenshot: - skip_first_screenshot = False - else: - self.device.screenshot() - + for _ in self.loop(): # End if self.is_in_map(): self.predict_radar() @@ -804,7 +788,7 @@ class OSFleet(OSCamera, Combat, Fleet, OSAsh): self.interval_reset(MAINTENANCE_ANNOUNCE) pause_interval.reset() continue - if self.appear_then_click(QUIT_RECONFIRM, offset=True, interval=5): + if self.handle_combat_quit_reconfirm(): self.interval_reset(MAINTENANCE_ANNOUNCE) pause_interval.reset() continue diff --git a/module/os/globe_operation.py b/module/os/globe_operation.py index 22aa5e259..7c1bfc00f 100644 --- a/module/os/globe_operation.py +++ b/module/os/globe_operation.py @@ -89,14 +89,9 @@ class GlobeOperation(ActionPointHandler): return False - def ensure_no_zone_pinned(self, skip_first_screenshot=True): + def ensure_no_zone_pinned(self): confirm_timer = Timer(1, count=2).start() - while 1: - if skip_first_screenshot: - skip_first_screenshot = False - else: - self.device.screenshot() - + for _ in self.loop(): if self.handle_zone_pinned(): confirm_timer.reset() else: @@ -189,12 +184,14 @@ class GlobeOperation(ActionPointHandler): in: is_in_zone_select out: is_zone_pinned """ - - def appear(): - return self.appear(button, offset=self._zone_select_offset, threshold=self._zone_select_similarity) - - self.ui_click(button, appear_button=appear, check_button=self.is_zone_pinned, - skip_first_screenshot=True) + logger.info(f'Zone select: {button}') + for _ in self.loop(): + # End + if self.is_zone_pinned(): + break + if self.appear_then_click( + button, offset=self._zone_select_offset, threshold=self._zone_select_similarity, interval=5): + continue def zone_type_select(self, types=('SAFE', 'DANGEROUS')): """ @@ -282,23 +279,17 @@ class GlobeOperation(ActionPointHandler): return self.ui_click(GLOBE_GOTO_MAP, check_button=self.is_in_map, offset=(20, 20), retry_wait=3, skip_first_screenshot=skip_first_screenshot) - def os_map_goto_globe(self, unpin=True, skip_first_screenshot=True): + def os_map_goto_globe(self, unpin=True): """ Args: unpin (bool): - skip_first_screenshot (bool): Pages: in: is_in_map out: is_in_globe """ click_count = 0 - while 1: - if skip_first_screenshot: - skip_first_screenshot = False - else: - self.device.screenshot() - + for _ in self.loop(): # End if self.is_in_globe(): break @@ -335,15 +326,9 @@ class GlobeOperation(ActionPointHandler): if self.handle_popup_confirm('GOTO_GLOBE'): continue - skip_first_screenshot = True confirm_timer = Timer(1, count=2).start() unpinned = 0 - while 1: - if skip_first_screenshot: - skip_first_screenshot = False - else: - self.device.screenshot() - + for _ in self.loop(): if unpin: if self.handle_zone_pinned(): unpinned += 1 @@ -355,11 +340,10 @@ class GlobeOperation(ActionPointHandler): if self.is_zone_pinned(): break - def globe_enter(self, zone, skip_first_screenshot=True): + def globe_enter(self, zone): """ Args: zone (Zone): Zone to enter. - skip_first_screenshot (bool): Raises: OSExploreError: If zone locked. @@ -371,11 +355,7 @@ class GlobeOperation(ActionPointHandler): click_timer = Timer(10) click_count = 0 pinned = None - while 1: - if skip_first_screenshot: - skip_first_screenshot = False - else: - self.device.screenshot() + for _ in self.loop(): if pinned is None: pinned = self.get_zone_pinned_name() diff --git a/module/os/map.py b/module/os/map.py index f89e9e798..c838300a3 100644 --- a/module/os/map.py +++ b/module/os/map.py @@ -6,7 +6,6 @@ import inflection from module.base.timer import Timer from module.config.utils import get_os_reset_remain from module.exception import CampaignEnd, GameTooManyClickError, MapWalkError, RequestHumanTakeover, ScriptError -from module.exercise.assets import QUIT_RECONFIRM from module.handler.login import LoginHandler, MAINTENANCE_ANNOUNCE from module.logger import logger from module.map.map import Map @@ -637,13 +636,12 @@ class OSMap(OSFleet, Map, GlobeCamera, StorageHandler, StrategicSearchHandler): logger.attr('CL1 time cost', f'{cost}s/round') self._auto_search_round_timer = time.time() - def os_auto_search_daemon(self, drop=None, strategic=False, interrupt=None, skip_first_screenshot=True): + def os_auto_search_daemon(self, drop=None, strategic=False, interrupt=None): """ Args: drop (DropRecord): strategic (bool): True if running in strategic search interrupt (callable): - skip_first_screenshot: Returns: int: Number of finished battle @@ -678,12 +676,7 @@ class OSMap(OSFleet, Map, GlobeCamera, StorageHandler, StrategicSearchHandler): finished_combat = 0 died_timer = Timer(1.5, count=3) self.hp_reset() - while 1: - if skip_first_screenshot: - skip_first_screenshot = False - else: - self.device.screenshot() - + for _ in self.loop(): # End if not unlock_checked and unlock_check_timer.reached(): logger.critical('Unable to use auto search in current zone') @@ -744,7 +737,7 @@ class OSMap(OSFleet, Map, GlobeCamera, StorageHandler, StrategicSearchHandler): return finished_combat - def interrupt_auto_search(self, goto_main=True, skip_first_screenshot=True): + def interrupt_auto_search(self, goto_main=True): """ Args: goto_main (bool): If go to the page_main @@ -761,12 +754,8 @@ class OSMap(OSFleet, Map, GlobeCamera, StorageHandler, StrategicSearchHandler): pause_interval = Timer(0.5, count=1) in_main_timer = Timer(3, count=6) in_map_timer = Timer(1, count=6) - while 1: - if skip_first_screenshot: - skip_first_screenshot = False - else: - self.device.screenshot() + for _ in self.loop(): # End if self.is_in_main(): logger.info('Auto search interrupted') @@ -797,7 +786,7 @@ class OSMap(OSFleet, Map, GlobeCamera, StorageHandler, StrategicSearchHandler): in_main_timer.reset() in_map_timer.reset() continue - if self.appear_then_click(QUIT_RECONFIRM, offset=True, interval=5): + if self.handle_combat_quit_reconfirm(): self.interval_reset(MAINTENANCE_ANNOUNCE) pause_interval.reset() in_main_timer.reset() @@ -845,7 +834,7 @@ class OSMap(OSFleet, Map, GlobeCamera, StorageHandler, StrategicSearchHandler): backup = self.config.temporary(Campaign_UseAutoSearch=True) try: if strategic: - self.strategic_search_start(skip_first_screenshot=True) + self.strategic_search_start() combat = self.os_auto_search_daemon(drop=drop, strategic=strategic, interrupt=interrupt) finished_combat += combat except CampaignEnd: diff --git a/module/os/map_fleet_selector.py b/module/os/map_fleet_selector.py index 3d0b439e5..727d2e8fe 100644 --- a/module/os/map_fleet_selector.py +++ b/module/os/map_fleet_selector.py @@ -93,18 +93,13 @@ class FleetSelector: index = numbers - index return Button(area=(), color=(), button=area, name='%s_INDEX_%s' % (str(self._bar), str(index))) - def open(self, skip_first_screenshot=True): + def open(self): """ Activate dropdown menu for fleet selection. """ main = self.main click_timer = Timer(3, count=6) - while 1: - if skip_first_screenshot: - skip_first_screenshot = False - else: - main.device.screenshot() - + for _ in main.loop(): if main.handle_map_event(): click_timer.reset() continue @@ -118,18 +113,13 @@ class FleetSelector: main.device.click(self._choose) click_timer.reset() - def close(self, skip_first_screenshot=True): + def close(self): """ Deactivate dropdown menu for fleet selection. """ main = self.main click_timer = Timer(3, count=6) - while 1: - if skip_first_screenshot: - skip_first_screenshot = False - else: - main.device.screenshot() - + for _ in main.loop(): # End if not self.bar_opened(): break @@ -139,23 +129,17 @@ class FleetSelector: main.device.click(self._choose) click_timer.reset() - def click(self, index, skip_first_screenshot=True): + def click(self, index): """ Choose a fleet on dropdown menu, and dropdown deactivated. Args: index (int): Fleet index, 1-6. - skip_first_screenshot (bool): """ main = self.main button = self.get_button(index) click_timer = Timer(3, count=6) - while 1: - if skip_first_screenshot: - skip_first_screenshot = False - else: - main.device.screenshot() - + for _ in main.loop(): if main.handle_map_event(): click_timer.reset() continue @@ -173,25 +157,19 @@ class FleetSelector: main.device.click(button) click_timer.reset() - def ensure_to_be(self, index, skip_first_screenshot=True): + def ensure_to_be(self, index): """ Set to a specific fleet. Args: index (int): Fleet index, 1-4. - skip_first_screenshot (bool): Returns: bool: If fleet switched. """ confirm_timer = Timer(1.5, count=5).start() main = self.main - while 1: - if skip_first_screenshot: - skip_first_screenshot = False - else: - main.device.screenshot() - + for _ in main.loop(): if confirm_timer.reached(): break diff --git a/module/os/map_operation.py b/module/os/map_operation.py index c783afbb6..64104acd6 100644 --- a/module/os/map_operation.py +++ b/module/os/map_operation.py @@ -168,7 +168,7 @@ class OSMapOperation(MapOrderHandler, MissionHandler, PortHandler, StorageHandle self.config.HOMO_EDGE_COLOR_RANGE = (0, 33) self.config.MAP_ENSURE_EDGE_INSIGHT_CORNER = '' - def zone_init(self, fallback_init=True, skip_first_screenshot=True): + def zone_init(self, fallback_init=True): """ Wrap get_current_zone(), set self.zone to the current zone. This method must be called after entering a new zone. @@ -176,7 +176,6 @@ class OSMapOperation(MapOrderHandler, MissionHandler, PortHandler, StorageHandle Args: fallback_init (bool): Whether to get zone from globe map when unable to parse zone name. - skip_first_screenshot (bool): Returns: Zone: Current zone. @@ -188,12 +187,7 @@ class OSMapOperation(MapOrderHandler, MissionHandler, PortHandler, StorageHandle self.wait_os_map_buttons() logger.info('Get zone name') timeout = Timer(1.5, count=5).start() - while 1: - if skip_first_screenshot: - skip_first_screenshot = False - else: - self.device.screenshot() - + for _ in self.loop(): # Handle popups if self.handle_map_event(): timeout.reset() @@ -246,13 +240,10 @@ class OSMapOperation(MapOrderHandler, MissionHandler, PortHandler, StorageHandle """ return self.appear(MAP_EXIT, offset=(20, 20)) - def map_exit(self, skip_first_screenshot=True): + def map_exit(self): """ Exit from an obscure zone, abyssal zone, or stronghold. - Args: - skip_first_screenshot: - Pages: in: is_in_map out: is_in_map, zone that you came from @@ -260,12 +251,7 @@ class OSMapOperation(MapOrderHandler, MissionHandler, PortHandler, StorageHandle logger.hr('Map exit') confirm_timer = Timer(1, count=2) changed = False - while 1: - if skip_first_screenshot: - skip_first_screenshot = False - else: - self.device.screenshot() - + for _ in self.loop(): # End if changed and self.is_in_map(): if confirm_timer.reached(): diff --git a/module/os/operation_siren.py b/module/os/operation_siren.py index 077245e49..fbfcc2ed3 100644 --- a/module/os/operation_siren.py +++ b/module/os/operation_siren.py @@ -35,7 +35,7 @@ class OperationSiren( if __name__ == '__main__': - self = OperationSiren('month_test', task='OpsiMonthBoss') + self = OperationSiren('alas', task='OpsiMonthBoss') self.config = self.config.merge(OSConfig()) diff --git a/module/os_handler/action_point.py b/module/os_handler/action_point.py index 194831e03..1e4451c70 100644 --- a/module/os_handler/action_point.py +++ b/module/os_handler/action_point.py @@ -109,14 +109,10 @@ class ActionPointHandler(UI, MapEventHandler): def is_current_ap_visible(self): return self.match_template_color(CURRENT_AP_CHECK, offset=(40, 5), threshold=15) - def action_point_use(self, skip_first_screenshot=True): + def action_point_use(self): prev = self._action_point_current self.interval_clear(ACTION_POINT_USE) - while 1: - if skip_first_screenshot: - skip_first_screenshot = False - else: - self.device.screenshot() + for _ in self.loop(): if self.appear_then_click(ACTION_POINT_USE, offset=(20, 20), interval=3): self.device.sleep(0.3) @@ -149,14 +145,9 @@ class ActionPointHandler(UI, MapEventHandler): self._action_point_box = box self._action_point_total = total - def action_point_safe_get(self, skip_first_screenshot=True): + def action_point_safe_get(self): timeout = Timer(3, count=6).start() - while 1: - if skip_first_screenshot: - skip_first_screenshot = False - else: - self.device.screenshot() - + for _ in self.loop(): # End if self.is_current_ap_visible(): break @@ -249,52 +240,34 @@ class ActionPointHandler(UI, MapEventHandler): logger.warning('Unable to find an active action point box button') return 1 - def action_point_set_button(self, index, skip_first_screenshot=True): + def action_point_set_button(self, index): """ Args: index (int): 0 to 3. 0 for oil, 1 for 20 ap box, 2 for 50 ap box, 3 for 100 ap box. - skip_first_screenshot (bool): Returns: bool: If success. """ - for _ in range(3): - if skip_first_screenshot: - skip_first_screenshot = False - else: - self.device.screenshot() - + for _ in self.loop(timeout=2): if self.action_point_get_active_button() == index: return True else: self.device.click(ACTION_POINT_GRID[index, 0]) self.device.sleep(0.3) + else: + logger.warning('FSet action point button timeout') + return False - logger.warning('Failed to set action point button after 3 trial') - return False - - def action_point_get_buy_remain(self, skip_first_screenshot=True): + def action_point_get_buy_remain(self): """ - Args: - skip_first_screenshot: - Returns: int: Remaining number of purchases of action points Pages: in: ACTION_POINT_USE """ - timeout = Timer(1, count=2).start() current = 0 - while 1: - if skip_first_screenshot: - skip_first_screenshot = False - else: - self.device.screenshot() - - if timeout.reached(): - logger.warning('Get action points buy remain timeout') - break + for _ in self.loop(timeout=1): current, _, total = OCR_ACTION_POINT_BUY_REMAIN.ocr(self.device.image) @@ -303,6 +276,8 @@ class ActionPointHandler(UI, MapEventHandler): continue break + else: + logger.warning('Get action points buy remain timeout') return current @@ -337,18 +312,13 @@ class ActionPointHandler(UI, MapEventHandler): logger.info('Not enough oil to buy') return False - def action_point_quit(self, skip_first_screenshot=True): + def action_point_quit(self): """ Pages: in: ACTION_POINT_USE out: page_os """ - while 1: - if skip_first_screenshot: - skip_first_screenshot = False - else: - self.device.screenshot() - + for _ in self.loop(): # End # sometimes you have action point popup without black-blurred background # ACTION_POINT_CANCEL and OS_CHECK both appears @@ -457,18 +427,13 @@ class ActionPointHandler(UI, MapEventHandler): logger.warning('Failed to get action points after 12 trial') return False - def action_point_enter(self, skip_first_screenshot=True): + def action_point_enter(self): """ Pages: in: OS_CHECK out: ACTION_POINT_USE """ - while 1: - if skip_first_screenshot: - skip_first_screenshot = False - else: - self.device.screenshot() - + for _ in self.loop(): if self.appear(ACTION_POINT_USE, offset=(20, 20)): break @@ -503,10 +468,10 @@ class ActionPointHandler(UI, MapEventHandler): if not self.handle_action_point(zone, pinned, cost, keep_current_ap, check_rest_ap): return False - while 1: + # wait until AP popup closed + for _ in self.loop(): if self.appear(IN_MAP, offset=(200, 5)): break - self.device.screenshot() return True @@ -528,9 +493,8 @@ class ActionPointHandler(UI, MapEventHandler): logger.info(f'Not having {amount} action points') self.action_point_quit() - while 1: + for _ in self.loop(): if self.appear(IN_MAP, offset=(200, 5)): break - self.device.screenshot() return enough diff --git a/module/os_handler/enemy_searching.py b/module/os_handler/enemy_searching.py index 2394a0cd1..e8e07363d 100644 --- a/module/os_handler/enemy_searching.py +++ b/module/os_handler/enemy_searching.py @@ -1,6 +1,4 @@ -from module.base.timer import Timer -from module.handler.enemy_searching import \ - EnemySearchingHandler as EnemySearchingHandler_ +from module.handler.enemy_searching import EnemySearchingHandler as EnemySearchingHandler_ from module.logger import logger from module.os.assets import MAP_GOTO_GLOBE_FOG from module.os_handler.assets import AUTO_SEARCH_REWARD, IN_MAP, ORDER_ENTER @@ -15,25 +13,16 @@ class EnemySearchingHandler(EnemySearchingHandler_): return False - def wait_os_map_buttons(self, skip_first_screenshot=True): + def wait_os_map_buttons(self): """ When entering a os map, radar and buttons slide out from the right. Wait until they slide to the final position. """ - timeout = Timer(1, count=2).start() - while 1: - if skip_first_screenshot: - skip_first_screenshot = False - else: - self.device.screenshot() - - # End - if timeout.reached(): - logger.warning('wait_os_map_buttons timeout, assume waited') - break + for _ in self.loop(timeout=1): if self.appear(ORDER_ENTER, offset=(20, 20)): break - # 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): continue + else: + logger.warning('wait_os_map_buttons timeout, assume waited') diff --git a/module/os_handler/map_event.py b/module/os_handler/map_event.py index dfc2c9332..51bf64f13 100644 --- a/module/os_handler/map_event.py +++ b/module/os_handler/map_event.py @@ -104,46 +104,6 @@ class MapEventHandler(EnemySearchingHandler): else: return False - def handle_siren_platform(self): - """ - Handle siren platform notice after entering map - - Returns: - bool: If handled - """ - if not self.handle_story_skip(): - return False - - logger.info('Handle siren platform') - timeout = Timer(self.MAP_ENEMY_SEARCHING_TIMEOUT_SECOND).start() - appeared = False - while 1: - self.device.screenshot() - if self.is_in_map(): - timeout.start() - else: - timeout.reset() - - if self.handle_story_skip(): - timeout.reset() - continue - - # End - if self.enemy_searching_appear(): - appeared = True - else: - if appeared: - self.handle_enemy_flashing() - self.device.sleep(1) - logger.info('Enemy searching appeared.') - break - self.enemy_searching_color_initial() - if timeout.reached(): - logger.info('Enemy searching timeout.') - break - - return True - def handle_map_event(self, drop=None): """ Args: @@ -185,39 +145,27 @@ class MapEventHandler(EnemySearchingHandler): self._os_in_map_confirm_timer.reset() return False - def ensure_no_map_event(self, skip_first_screenshot=True): + def ensure_no_map_event(self): self._os_in_map_confirm_timer.reset() - while 1: - if skip_first_screenshot: - skip_first_screenshot = False - else: - self.device.screenshot() - + for _ in self.loop(): if self.handle_map_event(): continue - # End if self.handle_os_in_map(): break - def os_auto_search_quit(self, drop=None, skip_first_screenshot=True): + def os_auto_search_quit(self, drop=None): """ Args: drop (DropImage): - skip_first_screenshot (bool): Returns: bool: True if current map cleared """ confirm_timer = Timer(1.2, count=3).start() cleared = False - while 1: - if skip_first_screenshot: - skip_first_screenshot = False - else: - self.device.screenshot() - + for _ in self.loop(): if self.appear(AUTO_SEARCH_REWARD, offset=(50, 50), interval=2): if self.ensure_no_info_bar(): cleared = True diff --git a/module/os_handler/map_order.py b/module/os_handler/map_order.py index 1faca23a7..df16b9a5a 100644 --- a/module/os_handler/map_order.py +++ b/module/os_handler/map_order.py @@ -15,19 +15,14 @@ class MapOrderHandler(MapOperation, ActionPointHandler, MapEventHandler, ZoneMan def is_in_map_order(self): return self.appear(ORDER_CHECK, offset=(20, 20)) - def order_enter(self, skip_first_screenshot=True): + def order_enter(self): """ Pages: in: is_in_map out: is_in_map_order """ logger.info('Order enter') - while 1: - if skip_first_screenshot: - skip_first_screenshot = False - else: - self.device.screenshot() - + for _ in self.loop(): # End if self.is_in_map_order(): break @@ -52,11 +47,10 @@ class MapOrderHandler(MapOperation, ActionPointHandler, MapEventHandler, ZoneMan self.ui_click(ORDER_CHECK, appear_button=self.is_in_map_order, check_button=self.is_in_map, skip_first_screenshot=True) - def order_execute(self, button, skip_first_screenshot=True): + def order_execute(self, button): """ Args: button (Button): A button in navigational order page. - skip_first_screenshot (bool): Returns: bool: If success @@ -69,15 +63,10 @@ class MapOrderHandler(MapOperation, ActionPointHandler, MapEventHandler, ZoneMan self.order_enter() missing_timer = Timer(1, count=3).start() - confirm_timer = Timer(1.2, count=4) + confirm_timer = Timer(1.2, count=4).start() assume_zone = self.name_to_zone(11) - while 1: - if skip_first_screenshot: - skip_first_screenshot = False - else: - self.device.screenshot() - + for _ in self.loop(): # End if self.is_in_map(): if confirm_timer.reached(): @@ -109,13 +98,9 @@ class MapOrderHandler(MapOperation, ActionPointHandler, MapEventHandler, ZoneMan missing_timer.reset() continue - def wait_until_order_finished(self, skip_first_screenshot=True): - while 1: - if skip_first_screenshot: - skip_first_screenshot = False - else: - self.device.screenshot() - + def wait_until_order_finished(self): + for _ in self.loop(): + # End if self.is_in_map() and self.appear(ORDER_ENTER, offset=(20, 20)): break diff --git a/module/os_handler/mission.py b/module/os_handler/mission.py index faedae3f1..d1d45016d 100644 --- a/module/os_handler/mission.py +++ b/module/os_handler/mission.py @@ -2,7 +2,7 @@ from datetime import timedelta from module.base.timer import Timer from module.base.utils import * -from module.config.utils import get_os_next_reset, DEFAULT_TIME +from module.config.utils import DEFAULT_TIME, get_os_next_reset from module.logger import logger from module.map_detection.utils import fit_points from module.os.assets import GLOBE_GOTO_MAP @@ -42,7 +42,7 @@ class MissionHandler(GlobeOperation, ZoneManager): def is_in_os_mission(self): return self.appear(MISSION_CHECK, offset=(20, 20)) - def os_mission_enter(self, skip_siren_mission=False, skip_first_screenshot=True): + def os_mission_enter(self, skip_siren_mission=False): """ Enter mission list and claim mission reward. @@ -60,12 +60,7 @@ class MissionHandler(GlobeOperation, ZoneManager): logger.info('OS mission enter') checkout_offset = (-20, -20, 20, 20) confirm_timer = Timer(2, count=6).start() - while 1: - if skip_first_screenshot: - skip_first_screenshot = False - else: - self.device.screenshot() - + for _ in self.loop(): # End if self.is_in_os_mission() \ and not self.appear(MISSION_FINISH, offset=checkout_offset) \ @@ -112,14 +107,9 @@ class MissionHandler(GlobeOperation, ZoneManager): continue return checkout_offset - def os_mission_quit(self, skip_first_screenshot=True): + def os_mission_quit(self): logger.info('OS mission quit') - while 1: - if skip_first_screenshot: - skip_first_screenshot = False - else: - self.device.screenshot() - + for _ in self.loop(): # End # sometimes you have os mission popup without black-blurred background # MISSION_QUIT and is_in_map appears @@ -164,13 +154,7 @@ class MissionHandler(GlobeOperation, ZoneManager): return False logger.info('Checkout os mission') - skip_first_screenshot = True - while 1: - if skip_first_screenshot: - skip_first_screenshot = False - else: - self.device.screenshot() - + for _ in self.loop(): # End if self.is_zone_pinned(): if self.get_zone_pinned_name() == 'ARCHIVE': @@ -216,13 +200,7 @@ class MissionHandler(GlobeOperation, ZoneManager): # MISSION_OVERVIEW_CHECK success = True - while 1: - if skip_first_screenshot: - skip_first_screenshot = False - else: - self.device.screenshot() - - # End + for _ in self.loop(): if self.handle_manjuu(): continue if self.info_bar_count(): diff --git a/module/os_handler/os_status.py b/module/os_handler/os_status.py index b4768658c..a9f493165 100644 --- a/module/os_handler/os_status.py +++ b/module/os_handler/os_status.py @@ -68,14 +68,10 @@ class OSStatus(UI): tasks = SelectedGrids(self.config.pending_task + self.config.waiting_task).filter(func).sort('next_run') return tasks.first_or_none() - def get_yellow_coins(self, skip_first_screenshot=True) -> int: + def get_yellow_coins(self) -> int: timeout = Timer(2, count=3).start() - while True: - if skip_first_screenshot: - skip_first_screenshot = False - else: - self.device.screenshot() - + for _ in self.loop(): + # End yellow_coins = OCR_SHOP_YELLOW_COINS.ocr(self.device.image) if timeout.reached(): logger.warning('Get yellow coins timeout') diff --git a/module/os_handler/port.py b/module/os_handler/port.py index ff5448ac8..76c013888 100644 --- a/module/os_handler/port.py +++ b/module/os_handler/port.py @@ -54,14 +54,8 @@ class PortHandler(OSShop): skip_first_screenshot=True) confirm_timer = Timer(1.5, count=3).start() - skip_first_screenshot = True success = True - while 1: - if skip_first_screenshot: - skip_first_screenshot = False - else: - self.device.screenshot() - + for _ in self.loop(): if self.appear_then_click(PORT_MISSION_ACCEPT, offset=(20, 20), interval=0.2): confirm_timer.reset() continue @@ -110,14 +104,8 @@ class PortHandler(OSShop): self.ui_click(PORT_GOTO_DOCK, appear_button=PORT_CHECK, check_button=PORT_DOCK_CHECK, skip_first_screenshot=True) - skip_first_screenshot = True repaired = False - while 1: - if skip_first_screenshot: - skip_first_screenshot = False - else: - self.device.screenshot() - + for _ in self.loop(): # End if self.info_bar_count(): break diff --git a/module/os_handler/storage.py b/module/os_handler/storage.py index 6cc464942..16caa5314 100644 --- a/module/os_handler/storage.py +++ b/module/os_handler/storage.py @@ -17,19 +17,14 @@ class StorageHandler(GlobeOperation, ZoneManager): def is_in_storage(self): return self.appear(STORAGE_CHECK, offset=(20, 20)) - def storage_enter(self, skip_first_screenshot=True): + def storage_enter(self): """ Pages: in: is_in_map, STORAGE_ENTER out: STORAGE_CHECK """ logger.info('Storage enter') - while 1: - if skip_first_screenshot: - skip_first_screenshot = False - else: - self.device.screenshot() - + for _ in self.loop(): # End if self.is_in_storage(): break @@ -53,11 +48,10 @@ class StorageHandler(GlobeOperation, ZoneManager): logger.info('Storage quit') self.ui_back(STORAGE_ENTER, offset=(200, 5), skip_first_screenshot=True) - def _storage_item_use(self, button, skip_first_screenshot=True): + def _storage_item_use(self, button): """ Args: button (Button): Item - skip_first_screenshot (bool): Pages: in: STORAGE_CHECK @@ -72,12 +66,7 @@ class StorageHandler(GlobeOperation, ZoneManager): self.interval_clear(GET_ADAPTABILITY) self.interval_clear(GET_MISSION) - while 1: - if skip_first_screenshot: - skip_first_screenshot = False - else: - self.device.screenshot() - + for _ in self.loop(): # Accidentally clicked on an item, having popups for its info if self.appear(GET_MISSION, offset=True, interval=2): logger.info(f'_storage_item_use item info -> {GET_MISSION}') @@ -119,22 +108,14 @@ class StorageHandler(GlobeOperation, ZoneManager): if success and self.appear(STORAGE_CHECK, offset=(20, 20)): break - def storage_logger_use_all(self, skip_first_screenshot=True): + def storage_logger_use_all(self): """ - Args: - skip_first_screenshot: - Pages: in: STORAGE_CHECK out: STORAGE_CHECK, scroll to bottom """ logger.hr('Storage logger use all') - while 1: - if skip_first_screenshot: - skip_first_screenshot = False - else: - self.device.screenshot() - + for _ in self.loop(): if SCROLL_STORAGE.appear(main=self): SCROLL_STORAGE.set_bottom(main=self, skip_first_screenshot=True) @@ -157,11 +138,8 @@ class StorageHandler(GlobeOperation, ZoneManager): if quit: self.storage_quit() - def storage_sample_use_all(self, skip_first_screenshot=True): + def storage_sample_use_all(self): """ - Args: - skip_first_screenshot: - Pages: in: STORAGE_CHECK out: STORAGE_CHECK, scroll to bottom @@ -171,12 +149,7 @@ class StorageHandler(GlobeOperation, ZoneManager): TEMPLATE_STORAGE_QUALITY_OFFENSE, TEMPLATE_STORAGE_QUALITY_SURVIVAL, TEMPLATE_STORAGE_QUALITY_COMBAT ] for sample_type in sample_types: - while 1: - if skip_first_screenshot: - skip_first_screenshot = False - else: - self.device.screenshot() - + for _ in self.loop(): image = rgb2gray(self.device.image) items = sample_type.match_multi(image, similarity=0.75) logger.attr('Storage_sample', len(items)) @@ -287,12 +260,11 @@ class StorageHandler(GlobeOperation, ZoneManager): """ self.ui_click(STORAGE_REPAIR_CANCEL, STORAGE_CHECK, retry_wait=2, skip_first_screenshot=True) - def _storage_coordinate_checkout(self, button, types=('OBSCURE',), skip_first_screenshot=True): + def _storage_coordinate_checkout(self, button, types=('OBSCURE',)): """ Args: button (Button): Item types (tuple[str]): - skip_first_screenshot (bool): Pages: in: STORAGE_CHECK @@ -303,12 +275,7 @@ class StorageHandler(GlobeOperation, ZoneManager): STORAGE_COORDINATE_CHECKOUT ]) self.popup_interval_clear() - while 1: - if skip_first_screenshot: - skip_first_screenshot = False - else: - self.device.screenshot() - + for _ in self.loop(): if self.appear(STORAGE_CHECK, offset=(30, 30), interval=5): self.device.click(button) continue @@ -346,12 +313,11 @@ class StorageHandler(GlobeOperation, ZoneManager): else: raise ScriptError(f'Unknown storage item: {item}') - def storage_checkout_item(self, item, skip_obscure_hazard_2=False, skip_first_screenshot=True): + def storage_checkout_item(self, item, skip_obscure_hazard_2=False): """ Args: item (str): 'OBSCURE', 'ABYSSAL' or 'REPAIR_PACK'. skip_obscure_hazard_2: if skip hazard 2 obscure - skip_first_screenshot: Returns: bool: If checkout @@ -366,17 +332,12 @@ class StorageHandler(GlobeOperation, ZoneManager): if SCROLL_STORAGE.appear(main=self): if item == 'REPAIR_PACK': # repair packs always at the bottom page - SCROLL_STORAGE.set_bottom(main=self, skip_first_screenshot=skip_first_screenshot) + SCROLL_STORAGE.set_bottom(main=self) else: - SCROLL_STORAGE.set_top(main=self, skip_first_screenshot=skip_first_screenshot) + SCROLL_STORAGE.set_top(main=self) confirm_timer = Timer(0.6, count=2).start() - while 1: - if skip_first_screenshot: - skip_first_screenshot = False - else: - self.device.screenshot() - + for _ in self.loop(): image = rgb2gray(self.device.image) items = self._storage_item_to_template(item).match_multi(image, similarity=0.75) logger.attr(f'Storage_{item}', len(items)) diff --git a/module/os_handler/strategic.py b/module/os_handler/strategic.py index d60552992..380e12a4c 100644 --- a/module/os_handler/strategic.py +++ b/module/os_handler/strategic.py @@ -1,4 +1,3 @@ -from module.base.timer import Timer from module.base.utils import get_color from module.logger import logger from module.os_handler.assets import * @@ -9,15 +8,11 @@ STRATEGIC_SEARCH_SCROLL = Scroll(STRATEGIC_SEARCH_SCROLL_AREA, color=(247, 211, class StrategicSearchHandler(MapEventHandler): - def strategy_search_enter(self, skip_first_screenshot=False): + def strategy_search_enter(self): logger.info('Strategic search enter') self.interval_clear(STRATEGIC_SEARCH_MAP_OPTION_OFF) - while 1: - if skip_first_screenshot: - skip_first_screenshot = False - else: - self.device.screenshot() - + for _ in self.loop(): + # End if self.appear(STRATEGIC_SEARCH_POPUP_CHECK, offset=(20, 20)): return True @@ -29,39 +24,28 @@ class StrategicSearchHandler(MapEventHandler): self.device.click(STRATEGIC_SEARCH_MAP_OPTION_OFF) continue - def strategic_search_set_tab(self, skip_first_screenshot=False): + def strategic_search_set_tab(self): logger.info('Strategic search set tab') - while 1: - if skip_first_screenshot: - skip_first_screenshot = False - else: - self.device.screenshot() - + for _ in self.loop(): if get_color(self.device.image, STRATEGIC_SEARCH_TAB_SECURED.area)[2] <= 150: self.device.click(STRATEGIC_SEARCH_TAB_SECURED) continue if get_color(self.device.image, STRATEGIC_SEARCH_TAB_SECURED.area)[2] > 150: break - def _strategy_search_scroll_appear(self, skip_first_screenshot=True): + def _strategy_search_scroll_appear(self): """ Returns: bool: If it still exists """ - timeout = Timer(2, count=4).start() - while 1: - if skip_first_screenshot: - skip_first_screenshot = False - else: - self.device.screenshot() - + for _ in self.loop(timeout=2): if STRATEGIC_SEARCH_SCROLL.appear(main=self): return True else: logger.warning('STRATEGIC_SEARCH_SCROLL disappeared') - if timeout.reached(): - logger.warning('STRATEGIC_SEARCH_SCROLL disappeared confirm') - return False + else: + logger.warning('STRATEGIC_SEARCH_SCROLL disappeared confirm') + return False def _strategy_option_selected(self, button): """ @@ -69,21 +53,18 @@ class StrategicSearchHandler(MapEventHandler): """ return self.image_color_count(button.button, color=(156, 255, 82), count=30) - def strategic_search_set_option(self, skip_first_screenshot=True): + def strategic_search_set_option(self): """ - Args: - skip_first_screenshot: - Returns: If success. False if strategic settings closed for unknown reason. """ logger.info('Strategic search set option') - while 1: - if skip_first_screenshot: - skip_first_screenshot = False - else: - self.device.screenshot() - + for _ in self.loop(): + if self._strategy_option_selected(STRATEGIC_SEARCH_ZONEMODE_REPEAT) \ + and self._strategy_option_selected(STRATEGIC_SEARCH_MERCHANT_STOP): + logger.attr('zone_mode', 'repeat') + logger.attr('encounter_merchant', 'stop') + break if self._strategy_option_selected(STRATEGIC_SEARCH_ZONEMODE_RANDOM): logger.attr('zone_mode', 'random') self.device.click(STRATEGIC_SEARCH_ZONEMODE_REPEAT) @@ -92,36 +73,24 @@ class StrategicSearchHandler(MapEventHandler): logger.attr('encounter_merchant', 'continue') self.device.click(STRATEGIC_SEARCH_MERCHANT_STOP) continue - if self._strategy_option_selected(STRATEGIC_SEARCH_ZONEMODE_REPEAT) \ - and self._strategy_option_selected(STRATEGIC_SEARCH_MERCHANT_STOP): - logger.attr('zone_mode', 'repeat') - logger.attr('encounter_merchant', 'stop') - skip_first_screenshot = True - break STRATEGIC_SEARCH_SCROLL.drag_threshold = 0.1 STRATEGIC_SEARCH_SCROLL.set(0.5, main=self) if not self._strategy_search_scroll_appear(): return False - while 1: - if skip_first_screenshot: - skip_first_screenshot = False - else: - self.device.screenshot() - + for _ in self.loop(): self.appear(STRATEGIC_SEARCH_DEVICE_CHECK, offset=(20, 200), similarity=0.7) STRATEGIC_SEARCH_DEVICE_STOP.load_offset(STRATEGIC_SEARCH_DEVICE_CHECK) STRATEGIC_SEARCH_DEVICE_CONTINUE.load_offset(STRATEGIC_SEARCH_DEVICE_CHECK) + if self._strategy_option_selected(STRATEGIC_SEARCH_DEVICE_STOP): + logger.attr('encounter_device', 'stop') + break if self._strategy_option_selected(STRATEGIC_SEARCH_DEVICE_CONTINUE): logger.attr('encounter_device', 'continue') self.device.click(STRATEGIC_SEARCH_DEVICE_STOP) continue - if self._strategy_option_selected(STRATEGIC_SEARCH_DEVICE_STOP): - logger.attr('encounter_device', 'stop') - skip_first_screenshot = True - break STRATEGIC_SEARCH_SCROLL.drag_threshold = 0.05 STRATEGIC_SEARCH_SCROLL.edge_add = (0.5, 0.8) @@ -129,42 +98,31 @@ class StrategicSearchHandler(MapEventHandler): if not self._strategy_search_scroll_appear(): return False - while 1: - if skip_first_screenshot: - skip_first_screenshot = False - else: - self.device.screenshot() - + for _ in self.loop(): self.appear(STRATEGIC_SEARCH_SUBMIT_CHECK, offset=(20, 20), similarity=0.7) STRATEGIC_SEARCH_SUBMIT_OFF.load_offset(STRATEGIC_SEARCH_SUBMIT_CHECK) STRATEGIC_SEARCH_SUBMIT_ON.load_offset(STRATEGIC_SEARCH_SUBMIT_CHECK) + if self._strategy_option_selected(STRATEGIC_SEARCH_SUBMIT_ON): + logger.attr('auto_submit', 'on') + break if self._strategy_option_selected(STRATEGIC_SEARCH_SUBMIT_OFF): logger.attr('auto_submit', 'off') self.device.click(STRATEGIC_SEARCH_SUBMIT_ON) continue - if self._strategy_option_selected(STRATEGIC_SEARCH_SUBMIT_ON): - logger.attr('auto_submit', 'on') - break return True - def strategic_search_confirm(self, skip_first_screenshot=False): + def strategic_search_confirm(self): logger.info('Strategic search confirm') - while 1: - if skip_first_screenshot: - skip_first_screenshot = False - else: - self.device.screenshot() - + for _ in self.loop(): if self.appear(STRATEGIC_SEARCH_POPUP_CHECK, offset=(20, 20)) \ and self.handle_popup_confirm(offset=(30, 30), name='STRATEGIC_SEARCH'): continue - if self.is_in_map(): return True - def strategic_search_start(self, skip_first_screenshot=False): + def strategic_search_start(self): """ Returns: If success. @@ -175,12 +133,12 @@ class StrategicSearchHandler(MapEventHandler): """ logger.hr('Strategic search start') for _ in range(3): - self.strategy_search_enter(skip_first_screenshot=skip_first_screenshot) - self.strategic_search_set_tab(skip_first_screenshot=True) - success = self.strategic_search_set_option(skip_first_screenshot=True) + self.strategy_search_enter() + self.strategic_search_set_tab() + success = self.strategic_search_set_option() if not success: continue - self.strategic_search_confirm(skip_first_screenshot=True) + self.strategic_search_confirm() return True logger.warning('Failed to start strategic search') diff --git a/module/tactical/assets.py b/module/tactical/assets.py index 9792fdf09..0c9fb8b81 100644 --- a/module/tactical/assets.py +++ b/module/tactical/assets.py @@ -8,7 +8,7 @@ ADD_NEW_STUDENT = Button(area={'cn': (417, 375, 438, 398), 'en': (417, 375, 438, BOOK_EMPTY_POPUP = Button(area={'cn': (880, 180, 908, 209), 'en': (880, 180, 908, 209), 'jp': (880, 180, 908, 209), 'tw': (880, 180, 908, 209)}, color={'cn': (211, 109, 105), 'en': (211, 109, 105), 'jp': (211, 109, 105), 'tw': (211, 109, 105)}, button={'cn': (880, 180, 908, 209), 'en': (880, 180, 908, 209), 'jp': (880, 180, 908, 209), 'tw': (880, 180, 908, 209)}, file={'cn': './assets/cn/tactical/BOOK_EMPTY_POPUP.png', 'en': './assets/en/tactical/BOOK_EMPTY_POPUP.png', 'jp': './assets/jp/tactical/BOOK_EMPTY_POPUP.png', 'tw': './assets/tw/tactical/BOOK_EMPTY_POPUP.png'}) OCR_SKILL_EXP = Button(area={'cn': (771, 191, 951, 209), 'en': (771, 191, 951, 209), 'jp': (728, 189, 950, 211), 'tw': (771, 191, 951, 209)}, color={'cn': (72, 82, 83), 'en': (72, 82, 83), 'jp': (69, 78, 82), 'tw': (72, 82, 83)}, button={'cn': (771, 191, 951, 209), 'en': (771, 191, 951, 209), 'jp': (728, 189, 950, 211), 'tw': (771, 191, 951, 209)}, file={'cn': './assets/cn/tactical/OCR_SKILL_EXP.png', 'en': './assets/en/tactical/OCR_SKILL_EXP.png', 'jp': './assets/jp/tactical/OCR_SKILL_EXP.png', 'tw': './assets/tw/tactical/OCR_SKILL_EXP.png'}) RAPID_TRAINING = Button(area={'cn': (518, 566, 583, 582), 'en': (518, 568, 585, 580), 'jp': (518, 566, 584, 583), 'tw': (518, 566, 583, 582)}, color={'cn': (233, 212, 171), 'en': (229, 205, 156), 'jp': (232, 209, 165), 'tw': (233, 212, 171)}, button={'cn': (518, 566, 583, 582), 'en': (518, 568, 585, 580), 'jp': (518, 566, 584, 583), 'tw': (518, 566, 583, 582)}, file={'cn': './assets/cn/tactical/RAPID_TRAINING.png', 'en': './assets/en/tactical/RAPID_TRAINING.png', 'jp': './assets/jp/tactical/RAPID_TRAINING.png', 'tw': './assets/cn/tactical/RAPID_TRAINING.png'}) -REWARD_2 = Button(area={'cn': (418, 413, 468, 434), 'en': (403, 416, 504, 432), 'jp': (432, 415, 476, 436), 'tw': (418, 413, 468, 434)}, color={'cn': (240, 191, 120), 'en': (240, 201, 145), 'jp': (240, 191, 121), 'tw': (240, 191, 120)}, button={'cn': (383, 404, 503, 444), 'en': (392, 404, 515, 445), 'jp': (383, 404, 503, 444), 'tw': (383, 404, 503, 444)}, file={'cn': './assets/cn/tactical/REWARD_2.png', 'en': './assets/en/tactical/REWARD_2.png', 'jp': './assets/jp/tactical/REWARD_2.png', 'tw': './assets/tw/tactical/REWARD_2.png'}) +REWARD_2 = Button(area={'cn': (418, 413, 468, 434), 'en': (403, 416, 504, 432), 'jp': (432, 415, 476, 436), 'tw': (418, 413, 468, 434)}, color={'cn': (240, 191, 120), 'en': (240, 201, 145), 'jp': (240, 191, 121), 'tw': (240, 191, 120)}, button={'cn': (383, 404, 503, 444), 'en': (392, 404, 515, 445), 'jp': (399, 415, 520, 450), 'tw': (383, 404, 503, 444)}, file={'cn': './assets/cn/tactical/REWARD_2.png', 'en': './assets/en/tactical/REWARD_2.png', 'jp': './assets/jp/tactical/REWARD_2.png', 'tw': './assets/tw/tactical/REWARD_2.png'}) SKILL_CONFIRM = Button(area={'cn': (575, 563, 705, 594), 'en': (600, 558, 681, 581), 'jp': (576, 563, 705, 594), 'tw': (577, 563, 704, 593)}, color={'cn': (147, 177, 216), 'en': (167, 191, 223), 'jp': (136, 170, 213), 'tw': (161, 187, 220)}, button={'cn': (575, 563, 705, 594), 'en': (600, 558, 681, 581), 'jp': (576, 563, 705, 594), 'tw': (577, 563, 704, 593)}, file={'cn': './assets/cn/tactical/SKILL_CONFIRM.png', 'en': './assets/en/tactical/SKILL_CONFIRM.png', 'jp': './assets/jp/tactical/SKILL_CONFIRM.png', 'tw': './assets/tw/tactical/SKILL_CONFIRM.png'}) TACTICAL_CLASS_CANCEL = Button(area={'cn': (818, 591, 990, 647), 'en': (836, 591, 973, 639), 'jp': (840, 606, 969, 637), 'tw': (819, 590, 989, 647)}, color={'cn': (153, 154, 154), 'en': (163, 164, 164), 'jp': (175, 176, 176), 'tw': (152, 153, 154)}, button={'cn': (818, 591, 990, 647), 'en': (836, 591, 973, 639), 'jp': (840, 606, 969, 637), 'tw': (819, 590, 989, 647)}, file={'cn': './assets/cn/tactical/TACTICAL_CLASS_CANCEL.png', 'en': './assets/en/tactical/TACTICAL_CLASS_CANCEL.png', 'jp': './assets/jp/tactical/TACTICAL_CLASS_CANCEL.png', 'tw': './assets/tw/tactical/TACTICAL_CLASS_CANCEL.png'}) TACTICAL_CLASS_START = Button(area={'cn': (1024, 590, 1197, 648), 'en': (1045, 592, 1176, 640), 'jp': (1046, 606, 1176, 637), 'tw': (1026, 590, 1196, 647)}, color={'cn': (96, 139, 194), 'en': (95, 137, 190), 'jp': (132, 165, 208), 'tw': (101, 143, 196)}, button={'cn': (1024, 590, 1197, 648), 'en': (1045, 592, 1176, 640), 'jp': (1046, 606, 1176, 637), 'tw': (1026, 590, 1196, 647)}, file={'cn': './assets/cn/tactical/TACTICAL_CLASS_START.png', 'en': './assets/en/tactical/TACTICAL_CLASS_START.png', 'jp': './assets/jp/tactical/TACTICAL_CLASS_START.png', 'tw': './assets/tw/tactical/TACTICAL_CLASS_START.png'}) diff --git a/module/ui/page.py b/module/ui/page.py index 9a165a718..34087eb3f 100644 --- a/module/ui/page.py +++ b/module/ui/page.py @@ -134,7 +134,7 @@ page_campaign.link(button=CAMPAIGN_GOTO_EVENT, destination=page_sp) # FROSTFALL # page_coalition = Page(FROSTFALL_COALITION_CHECK) # page_coalition.link(button=GOTO_MAIN, destination=page_main) -# page_coalition.link(button=BACK_ARROW, destination=page_campaign) +# page_coalition.link(button=BACK_ARROW, destination=page_campaign_menu) # page_campaign_menu.link(button=CAMPAIGN_MENU_GOTO_EVENT, destination=page_coalition) # ACADEMY # page_coalition_menu = Page(COALITION_ACADEMY_MAIN_CHECK) @@ -147,12 +147,17 @@ page_campaign.link(button=CAMPAIGN_GOTO_EVENT, destination=page_sp) # NEONCITY # page_coalition = Page(NEONCITY_COALITION_CHECK) # page_coalition.link(button=NEONCITY_UI_HOME, destination=page_main) -# page_coalition.link(button=NEONCITY_UI_BACK, destination=page_campaign) +# page_coalition.link(button=NEONCITY_UI_BACK, destination=page_campaign_menu) # page_campaign_menu.link(button=CAMPAIGN_MENU_GOTO_EVENT, destination=page_coalition) # DAL -page_coalition = Page(FROSTFALL_COALITION_CHECK) +# page_coalition = Page(FROSTFALL_COALITION_CHECK) +# page_coalition.link(button=GOTO_MAIN, destination=page_main) +# page_coalition.link(button=BACK_ARROW, destination=page_campaign_menu) +# page_campaign_menu.link(button=CAMPAIGN_MENU_GOTO_EVENT, destination=page_coalition) +# FASHION +page_coalition = Page(FASHION_COALITION_CHECK) page_coalition.link(button=GOTO_MAIN, destination=page_main) -page_coalition.link(button=BACK_ARROW, destination=page_campaign) +page_coalition.link(button=BACK_ARROW, destination=page_campaign_menu) page_campaign_menu.link(button=CAMPAIGN_MENU_GOTO_EVENT, destination=page_coalition) # Operation Siren