From f207b6a6ac1b3fd938fc696cb498b26b03bd93cb Mon Sep 17 00:00:00 2001 From: Drest <117995310+dikxingmengya@users.noreply.github.com> Date: Sun, 27 Jul 2025 08:28:28 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E9=80=82=E9=85=8D=E9=95=BF=E6=9C=9F?= =?UTF-8?q?=E5=89=BF=E7=81=AD=20(#13241)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: HX3N Co-authored-by: Constrat <56174894+Constrat@users.noreply.github.com> Co-authored-by: momomochi987 Co-authored-by: Manicsteiner --- .../global/YoStarEN/resource/tasks/tasks.json | 12 ++++++ .../global/YoStarJP/resource/tasks/tasks.json | 12 ++++++ .../global/YoStarKR/resource/tasks/tasks.json | 12 ++++++ .../global/txwy/resource/tasks/tasks.json | 12 ++++++ resource/tasks/tasks.json | 42 ++++++++++++++++++- src/MaaWpfGui/Constants/ConfigurationKeys.cs | 1 + src/MaaWpfGui/Res/Localizations/en-us.xaml | 11 +++-- src/MaaWpfGui/Res/Localizations/ja-jp.xaml | 11 +++-- src/MaaWpfGui/Res/Localizations/ko-kr.xaml | 11 +++-- src/MaaWpfGui/Res/Localizations/zh-cn.xaml | 5 +++ src/MaaWpfGui/Res/Localizations/zh-tw.xaml | 12 ++++-- src/MaaWpfGui/Services/StageManager.cs | 8 +++- .../ViewModels/UI/TaskQueueViewModel.cs | 20 +++++++-- .../FightSettingsUserControlModel.cs | 20 +++++++++ .../TaskQueue/FightSettingsUserControl.xaml | 31 +++++++++++++- 15 files changed, 201 insertions(+), 19 deletions(-) diff --git a/resource/global/YoStarEN/resource/tasks/tasks.json b/resource/global/YoStarEN/resource/tasks/tasks.json index f8bcf31d59..c0451c5381 100644 --- a/resource/global/YoStarEN/resource/tasks/tasks.json +++ b/resource/global/YoStarEN/resource/tasks/tasks.json @@ -885,6 +885,18 @@ "text": ["Submitting feedback", "to the neural network"], "roi": [675, 605, 427, 115] }, + "Chernobog": { + "text": ["Chernobog"] + }, + "LungmenOutskirts": { + "text": ["Lungmen Outskirts"] + }, + "LungmenDowntown": { + "text": ["Lungmen Downtown"] + }, + "AnnihilationSwitchButton": { + "text": ["Switch"] + }, "UsePrts": { "templThreshold": 0.7 }, diff --git a/resource/global/YoStarJP/resource/tasks/tasks.json b/resource/global/YoStarJP/resource/tasks/tasks.json index 073e7a5819..6437af7bae 100644 --- a/resource/global/YoStarJP/resource/tasks/tasks.json +++ b/resource/global/YoStarJP/resource/tasks/tasks.json @@ -867,6 +867,18 @@ "text": ["ニューラル", "コネクタ", "接続中"], "roi": [700, 600, 350, 120] }, + "Chernobog": { + "text": ["チェルノボーグ"] + }, + "LungmenOutskirts": { + "text": ["龍門郊外"] + }, + "LungmenDowntown": { + "text": ["龍門市街"] + }, + "AnnihilationSwitchButton": { + "text": ["切替"] + }, "StartButton1": { "ocrReplace": [["行重動", "行動"]], "text": ["行動開始"] diff --git a/resource/global/YoStarKR/resource/tasks/tasks.json b/resource/global/YoStarKR/resource/tasks/tasks.json index 321d3fcd86..189c069365 100644 --- a/resource/global/YoStarKR/resource/tasks/tasks.json +++ b/resource/global/YoStarKR/resource/tasks/tasks.json @@ -940,6 +940,18 @@ "text": ["피드백", "전달"], "roi": [700, 620, 400, 80] }, + "Chernobog": { + "text": ["체르노보그"] + }, + "LungmenOutskirts": { + "text": ["용문외곽"] + }, + "LungmenDowntown": { + "text": ["용문시내"] + }, + "AnnihilationSwitchButton": { + "text": ["변경"] + }, "StartButton1": { "ocrReplace": [["개.+", "개시"]], "text": ["작전개시"] diff --git a/resource/global/txwy/resource/tasks/tasks.json b/resource/global/txwy/resource/tasks/tasks.json index 929551f81c..44f8828885 100644 --- a/resource/global/txwy/resource/tasks/tasks.json +++ b/resource/global/txwy/resource/tasks/tasks.json @@ -580,6 +580,18 @@ "LoadingText": { "text": ["正在提交", "反饋至神經"] }, + "Chernobog": { + "text": ["切爾諾伯格"] + }, + "LungmenOutskirts": { + "text": ["龍門外環"] + }, + "LungmenDowntown": { + "text": ["龍門市區"] + }, + "AnnihilationSwitchButton": { + "text": ["切換"] + }, "StartButton1": { "text": ["開始行動"] }, diff --git a/resource/tasks/tasks.json b/resource/tasks/tasks.json index 1042c258dd..de4b4f987b 100644 --- a/resource/tasks/tasks.json +++ b/resource/tasks/tasks.json @@ -1150,13 +1150,53 @@ "StartUp@ClickCorner": { "next": ["StartUp@ReturnButtons#next", "StartUp", "StartUp@CloseAnnos#next", "StartUp@OfflineConfirm"] }, + "Chernobog": { + "Doc": "切换剿灭关卡-切尔诺伯格", + "algorithm": "OcrDetect", + "text": ["切尔诺伯格"], + "roi": [721, 22, 529, 693], + "action": "ClickSelf" + }, + "LungmenOutskirts": { + "Doc": "切换剿灭关卡-龙门外环", + "algorithm": "OcrDetect", + "text": ["龙门外环"], + "roi": [721, 22, 529, 693], + "action": "ClickSelf" + }, + "LungmenDowntown": { + "Doc": "切换剿灭关卡-龙门市区", + "algorithm": "OcrDetect", + "text": ["龙门市区"], + "roi": [721, 22, 529, 693], + "action": "ClickSelf" + }, + "AnnihilationSwitchButton": { + "Doc": "切换剿灭关卡(菜单按钮)", + "algorithm": "OcrDetect", + "text": ["切换"], + "action": "ClickSelf", + "roi": [966, 577, 315, 142], + "next": ["#back"] + }, + "AnnihilationReturn": { + "Doc": "从剿灭关卡界面退回到含有切换按钮的界面", + "template": "Return.png", + "templThreshold": 0.7, + "action": "ClickSelf", + "preDelay": 1000, + "postDelay": 500, + "roi": [0, 0, 180, 80], + "next": ["AnnihilationSwitchButton"] + }, "Annihilation": { "Doc": "剿灭作战,一般本周的满了也不会有人再刷的,所以只识别右上角ToDoList里的剿灭就可以了", "template": "StageAnnihilation.png", "templThreshold": 0.9, "action": "ClickSelf", "roi": [900, 70, 380, 400], - "maskRange": [1, 255] + "maskRange": [1, 255], + "next": ["#back"] }, "StageBegin": { "algorithm": "JustReturn", diff --git a/src/MaaWpfGui/Constants/ConfigurationKeys.cs b/src/MaaWpfGui/Constants/ConfigurationKeys.cs index 81170bd130..db59bd1929 100644 --- a/src/MaaWpfGui/Constants/ConfigurationKeys.cs +++ b/src/MaaWpfGui/Constants/ConfigurationKeys.cs @@ -246,6 +246,7 @@ namespace MaaWpfGui.Constants public const string Stage2 = "MainFunction.Stage2"; public const string Stage3 = "MainFunction.Stage3"; public const string Stage4 = "MainFunction.Stage4"; + public const string Annihilation = "MainFunction.Annihilation"; public const string UseMedicine = "MainFunction.UseMedicine"; public const string UseMedicineQuantity = "MainFunction.UseMedicine.Quantity"; public const string UseStone = "MainFunction.UseStone"; diff --git a/src/MaaWpfGui/Res/Localizations/en-us.xaml b/src/MaaWpfGui/Res/Localizations/en-us.xaml index 36171fe855..aa82f66ee5 100644 --- a/src/MaaWpfGui/Res/Localizations/en-us.xaml +++ b/src/MaaWpfGui/Res/Localizations/en-us.xaml @@ -454,10 +454,10 @@ Please do not check it when the stage OF-1 is not unlocked. Hide to tray when minimized System Notification -MAA is a portable (non-installed) application. Its notification feature uses the Microsoft.Toolkit.Uwp.Notifications library, which by default registers notifications using the application's executable path. -If you have run MAA from multiple locations, Windows will create separate notification icons (e.g., in the taskbar toast) for each path. This is the default behavior of the library and cannot be controlled or cleaned up automatically by MAA. +MAA is a portable (non-installed) application. Its notification feature uses the Microsoft.Toolkit.Uwp.Notifications library, which by default registers notifications using the application's executable path. +If you have run MAA from multiple locations, Windows will create separate notification icons (e.g., in the taskbar toast) for each path. This is the default behavior of the library and cannot be controlled or cleaned up automatically by MAA. To clean up, open the Registry Editor and navigate to: -HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Notifications\Settings +HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Notifications\Settings Then delete the entries corresponding to the paths. Hide close button @@ -647,7 +647,11 @@ Do not adjust the proxy multiplier setting in the game Pio/Sup Ⅱ Grd/Spc Ⅰ Grd/Spc Ⅱ + Annihilation Mode Annihilation + Chernobog + Lungmen Outskirts + Lungmen Downtown Today's open stages:  CE (LMD) AP (Purchase Certificate) @@ -683,6 +687,7 @@ Do not adjust the proxy multiplier setting in the game Unknown ending action The stage selected is an annihilation task. After the task is completed, the remaining alternative stages will be attempted. Some battle settings will not take effect. Annihilation task failed, will try to use alternate stage, some combat settings will not be effective. + If you use the Annihilation Mode, please configure alternate stage. Toolbox diff --git a/src/MaaWpfGui/Res/Localizations/ja-jp.xaml b/src/MaaWpfGui/Res/Localizations/ja-jp.xaml index f1cfbe11f9..b7e57a797e 100644 --- a/src/MaaWpfGui/Res/Localizations/ja-jp.xaml +++ b/src/MaaWpfGui/Res/Localizations/ja-jp.xaml @@ -648,7 +648,11 @@ C:\\leidian\\LDPlayer9 先鋒/補助SoC・中 前衛/特殊SoC・初 前衛/特殊SoC・中 - 殲滅作戦 + 殲滅作戦 + 今期の殲滅作戦 + チェルノボーグ + 龍門郊外 + 龍門市街 今日のステージのヒント: CE(龍門幣) AP(購買資格証) @@ -682,8 +686,9 @@ C:\\leidian\\LDPlayer9 完了しました。休止状態にしようとしています 完了しました、スリープ状態に入ります 未知の終了動作 - ステージ選択が殲滅任務になっています。任務終了後、残りの代替ステージが試されます。一部の戦闘設定は有効になりません。 - 殲滅戦に失敗、代替ステージを使用しますが、一部の戦闘設定が有効ではありません + ステージ選択が殲滅作戦になっています。任務終了後、残りの代替ステージが試されます。一部の戦闘設定は有効になりません。 + 殲滅作戦に失敗、代替ステージを使用しますが、一部の戦闘設定が有効ではありません。 + 殲滅作戦を使用する場合は、代替ステージを設定してください。 ツールボックス diff --git a/src/MaaWpfGui/Res/Localizations/ko-kr.xaml b/src/MaaWpfGui/Res/Localizations/ko-kr.xaml index 7da05be628..ad68a1ba53 100644 --- a/src/MaaWpfGui/Res/Localizations/ko-kr.xaml +++ b/src/MaaWpfGui/Res/Localizations/ko-kr.xaml @@ -453,10 +453,10 @@ OF-1 스테이지가 개방되지 않은 경우에는 선택하지 마세요.최소화 시 트레이에 숨기기 중요 알림 팝업 -MAA는 설치하지 않는 포터블 프로그램입니다. 알림 기능은 Microsoft.Toolkit.Uwp.Notifications 라이브러리를 사용하며, 이 라이브러리는 기본적으로 실행 파일 경로를 등록 식별자로 사용합니다. -여러 위치에서 MAA를 실행하면 Windows는 각 경로마다 별도의 알림 아이콘(예: 작업 표시줄 알림)을 생성합니다. 이는 라이브러리의 기본 동작이며 MAA가 제어하거나 자동으로 정리할 수 없습니다. +MAA는 설치하지 않는 포터블 프로그램입니다. 알림 기능은 Microsoft.Toolkit.Uwp.Notifications 라이브러리를 사용하며, 이 라이브러리는 기본적으로 실행 파일 경로를 등록 식별자로 사용합니다. +여러 위치에서 MAA를 실행하면 Windows는 각 경로마다 별도의 알림 아이콘(예: 작업 표시줄 알림)을 생성합니다. 이는 라이브러리의 기본 동작이며 MAA가 제어하거나 자동으로 정리할 수 없습니다. 정리하려면 레지스트리 편집기를 열고 다음 경로로 이동하세요: -HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Notifications\Settings +HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Notifications\Settings 해당 경로에 해당하는 항목을 삭제하세요. 닫기 버튼 숨기기 @@ -648,6 +648,10 @@ C:\\leidian\\LDPlayer9 PR-D-1 (가드/스페셜리스트) PR-D-2 (가드/스페셜리스트) 섬멸 작전 + 섬멸 모드 + 체르노보그 + 용문 외곽 + 용문 시내 오늘 오픈된 스테이지: CE (용문폐) AP (구매증명서) @@ -683,6 +687,7 @@ C:\\leidian\\LDPlayer9 알 수 없는 종료 동작 선택한 스테이지는 섬멸 임무입니다. 임무 완료 후 남은 대체 스테이지가 시도됩니다. 일부 전투 설정은 적용되지 않습니다. 섬멸 작전에 실패하여 대체 스테이지를 진행합니다. 일부 전투 설정이 무시될 수 있습니다 + 제거 모드를 사용할 경우 대체 스테이지 설정해 주십시오. 툴박스 diff --git a/src/MaaWpfGui/Res/Localizations/zh-cn.xaml b/src/MaaWpfGui/Res/Localizations/zh-cn.xaml index 9b7c5c98d3..e178fd286e 100644 --- a/src/MaaWpfGui/Res/Localizations/zh-cn.xaml +++ b/src/MaaWpfGui/Res/Localizations/zh-cn.xaml @@ -647,7 +647,11 @@ C:\\leidian\\LDPlayer9。\n 先/辅芯片组 近/特芯片 近/特芯片组 + 剿灭模式 当期剿灭 + 切尔诺伯格 + 龙门外环 + 龙门市区 今日关卡小提示: CE(龙门币) AP(红票) @@ -683,6 +687,7 @@ C:\\leidian\\LDPlayer9。\n 未知的结束动作 关卡选择为剿灭任务,任务结束后将尝试使用剩余备选关卡,部分战斗设置将不生效。 剿灭任务失败,将尝试使用剩余备选关卡,部分战斗设置将不生效。 + 若使用剿灭模式,请配置备选关卡。 小工具 diff --git a/src/MaaWpfGui/Res/Localizations/zh-tw.xaml b/src/MaaWpfGui/Res/Localizations/zh-tw.xaml index be4c4b0477..5cfc055252 100644 --- a/src/MaaWpfGui/Res/Localizations/zh-tw.xaml +++ b/src/MaaWpfGui/Res/Localizations/zh-tw.xaml @@ -452,10 +452,10 @@ 最小化時隱藏至工作列 重要訊息彈出系統通知 -MAA 是非安裝型軟體,通知功能使用 Microsoft.Toolkit.Uwp.Notifications 庫,該庫預設以程式所在路徑作為註冊識別。 -若從多個路徑啟動過 MAA,Windows 會為每個路徑產生不同的通知來源圖示(如工作列彈出圖示),這是該庫的預設行為,MAA 無法控制或自動清除。 +MAA 是非安裝型軟體,通知功能使用 Microsoft.Toolkit.Uwp.Notifications 庫,該庫預設以程式所在路徑作為註冊識別。 +若從多個路徑啟動過 MAA,Windows 會為每個路徑產生不同的通知來源圖示(如工作列彈出圖示),這是該庫的預設行為,MAA 無法控制或自動清除。 如需清理,請手動開啟登錄檔編輯器,定位至: -HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Notifications\Settings +HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Notifications\Settings 刪除對應的路徑項目即可。 隱藏關閉按鈕 @@ -645,7 +645,11 @@ C:\\leidian\\LDPlayer9。\n 先/輔晶片組 近/特晶片 近/特晶片組 + 剿滅模式 當期剿滅 + 切爾諾伯格 + 龍門外環 + 龍門市區 今日關卡小提示: CE(龍門幣) AP(紅票) @@ -681,6 +685,8 @@ C:\\leidian\\LDPlayer9。\n 未知的結束動作 關卡選擇為剿滅任務,任務結束後將嘗試使用剩餘備選關卡,部分戰鬥設置將不生效。 剿滅任務失敗,將嘗試使用剩餘備選關卡,部分戰鬥設定將不生效。 + 若使用剿滅模式,請配置備選關卡。 + 小工具 diff --git a/src/MaaWpfGui/Services/StageManager.cs b/src/MaaWpfGui/Services/StageManager.cs index 1192696b88..d43835a804 100644 --- a/src/MaaWpfGui/Services/StageManager.cs +++ b/src/MaaWpfGui/Services/StageManager.cs @@ -296,8 +296,12 @@ namespace MaaWpfGui.Services { "SK-5", new("SK-5", "SKTip", [DayOfWeek.Monday, DayOfWeek.Wednesday, DayOfWeek.Friday, DayOfWeek.Saturday], resourceCollection) }, // 剿灭模式 - { "Annihilation", new() { Display = LocalizationHelper.GetString("Annihilation"), Value = "Annihilation" } }, - + { "AnnihilationMode", new() { Display = LocalizationHelper.GetString("AnnihilationMode"), Value = "AnnihilationMode" } }, + /* removed + { "Chernobog", new() { Display = LocalizationHelper.GetString("Chernobog"), Value = "Chernobog@AnnihilationReturn@Annihilation" } }, + { "LungmenOutskirts", new() { Display = LocalizationHelper.GetString("LungmenOutskirts"), Value = "LungmenOutskirts@AnnihilationReturn@Annihilation" } }, + { "LungmenDowntown", new() { Display = LocalizationHelper.GetString("LungmenDowntown"), Value = "LungmenDowntown@AnnihilationReturn@Annihilation" } }, + */ // 芯片本 { "PR-A-1", new("PR-A-1", "PR-ATip", [DayOfWeek.Monday, DayOfWeek.Thursday, DayOfWeek.Friday, DayOfWeek.Sunday], resourceCollection) }, { "PR-A-2", new("PR-A-2", string.Empty, [DayOfWeek.Monday, DayOfWeek.Thursday, DayOfWeek.Friday, DayOfWeek.Sunday], resourceCollection) }, diff --git a/src/MaaWpfGui/ViewModels/UI/TaskQueueViewModel.cs b/src/MaaWpfGui/ViewModels/UI/TaskQueueViewModel.cs index cd51e01073..2b321f70cb 100644 --- a/src/MaaWpfGui/ViewModels/UI/TaskQueueViewModel.cs +++ b/src/MaaWpfGui/ViewModels/UI/TaskQueueViewModel.cs @@ -1635,14 +1635,25 @@ namespace MaaWpfGui.ViewModels.UI var (type, mainParam) = FightTask.Serialize(); bool mainFightRet = Instances.AsstProxy.AsstAppendTaskWithEncoding(TaskType.Fight, type, mainParam); - if (!mainFightRet) + if (!mainFightRet && curStage != "AnnihilationMode") { AddLog(LocalizationHelper.GetString("UnsupportedStages") + ": " + curStage, UiLogColor.Error); return false; } - if ((curStage == "Annihilation") && FightTask.UseAlternateStage) + if ((curStage == "AnnihilationMode") && FightTask.UseAlternateStage) { + AddLog(LocalizationHelper.GetString("AnnihilationTaskTip"), UiLogColor.Info); + + // 先打剿灭 + var annihilationTask = mainParam.ToObject(); + annihilationTask.Stage = ConfigurationHelper.GetValue(ConfigurationKeys.Annihilation, "Annihilation"); + annihilationTask.Stone = 0; + annihilationTask.MaxTimes = int.MaxValue; + annihilationTask.Drops = []; + mainFightRet = Instances.AsstProxy.AsstAppendTaskWithEncoding(TaskType.FightAnnihilationAlternate, type, annihilationTask.Serialize().Params); + + // 再打备选 foreach (var stage in FightTask.Stages) { if (stage is null || !IsStageOpen(stage) || (stage == curStage)) @@ -1650,7 +1661,6 @@ namespace MaaWpfGui.ViewModels.UI continue; } - AddLog(LocalizationHelper.GetString("AnnihilationTaskTip"), UiLogColor.Info); var task = mainParam.ToObject(); if (task != null) { @@ -1664,6 +1674,10 @@ namespace MaaWpfGui.ViewModels.UI break; } } + else if (curStage == "AnnihilationMode") + { + AddLog(LocalizationHelper.GetString("AnnihilationWarning"), UiLogColor.Warning); + } if (mainFightRet && FightTask.UseRemainingSanityStage && !string.IsNullOrEmpty(FightTask.RemainingSanityStage)) { diff --git a/src/MaaWpfGui/ViewModels/UserControl/TaskQueue/FightSettingsUserControlModel.cs b/src/MaaWpfGui/ViewModels/UserControl/TaskQueue/FightSettingsUserControlModel.cs index d729bacbf5..735c492177 100644 --- a/src/MaaWpfGui/ViewModels/UserControl/TaskQueue/FightSettingsUserControlModel.cs +++ b/src/MaaWpfGui/ViewModels/UserControl/TaskQueue/FightSettingsUserControlModel.cs @@ -707,6 +707,26 @@ public class FightSettingsUserControlModel : TaskViewModel #endregion Drops + public static Dictionary AnnihilationModeList { get; } = new() + { + { LocalizationHelper.GetString("Annihilation"), "Annihilation" }, + { LocalizationHelper.GetString("Chernobog"), "Chernobog@AnnihilationReturn@Annihilation" }, + { LocalizationHelper.GetString("LungmenOutskirts"), "LungmenOutskirts@AnnihilationReturn@Annihilation" }, + { LocalizationHelper.GetString("LungmenDowntown"), "LungmenDowntown@AnnihilationReturn@Annihilation" }, + }; + + private string _annihilationMode = ConfigurationHelper.GetValue(ConfigurationKeys.Annihilation, "Annihilation"); + + public string AnnihilationMode + { + get => _annihilationMode; + set + { + SetAndNotify(ref _annihilationMode, value); + ConfigurationHelper.SetValue(ConfigurationKeys.Annihilation, value); + } + } + private bool _isDrGrandet = Convert.ToBoolean(ConfigurationHelper.GetValue(ConfigurationKeys.IsDrGrandet, bool.FalseString)); /// diff --git a/src/MaaWpfGui/Views/UserControl/TaskQueue/FightSettingsUserControl.xaml b/src/MaaWpfGui/Views/UserControl/TaskQueue/FightSettingsUserControl.xaml index e2a95a20ee..cbe4ab8e92 100644 --- a/src/MaaWpfGui/Views/UserControl/TaskQueue/FightSettingsUserControl.xaml +++ b/src/MaaWpfGui/Views/UserControl/TaskQueue/FightSettingsUserControl.xaml @@ -414,7 +414,36 @@ - + + + + + + + + + + + + + +