feat: RA store (#12833)

* feat: RA store

* feat: 生息演算商店接入刷点数

* fix: 停止方式
This commit is contained in:
晓丶梦丶仁
2025-05-31 18:13:14 +08:00
committed by GitHub
parent 5d7006236a
commit 4fa1cb4c97
19 changed files with 140 additions and 1 deletions

View File

@@ -4,5 +4,8 @@
},
"RA@Navigation-EnterCurrentTheme": {
"text": ["Reclamation", "Algorithm"]
},
"RA@Store@Purchase": {
"text": ["Pay", "Total", "Cost"]
}
}

View File

@@ -4,5 +4,8 @@
},
"RA@Navigation-EnterCurrentTheme": {
"text": ["生息演算"]
},
"RA@Store@Purchase": {
"text": ["購入"]
}
}

View File

@@ -4,5 +4,8 @@
},
"RA@Navigation-EnterCurrentTheme": {
"text": ["생존", "연산"]
},
"RA@Store@Purchase": {
"text": ["합계"]
}
}

View File

@@ -4,5 +4,8 @@
},
"RA@Navigation-EnterCurrentTheme": {
"text": ["生息演算"]
},
"RA@Store@Purchase": {
"text": ["支付"]
}
}

View File

@@ -594,7 +594,8 @@
"doc": "生息点数达到上限, 点击右下角删除存档图标, 确认删除存档, 仍要删除存档",
"baseTask": "Tales@RA@SwipeSave",
"template": "Tales@RA@SwipeSave.png",
"sub": ["Tales@RA@DialogConfirmRed*2"]
"sub": ["Tales@RA@DialogConfirmRed*2"],
"next": ["RA@Store@WaitEnterStore"]
},
"Tales@RA@PNS-RecogniseHeadquartersButton": {
"doc": "识别到左下角驻扎地图标",

View File

@@ -53,5 +53,81 @@
"roi": [908, 54, 372, 500],
"maskRange": [1, 255],
"next": ["RA@Navigation#next"]
},
"RA@Store@WaitEnterStore": {
"algorithm": "JustReturn",
"doc": "等动画",
"postDelay": 5000,
"next": ["RA@Store@EnterStore", "Stop"]
},
"RA@Store@EnterStore": {
"doc": "进入 <生息演算商店> 界面",
"action": "ClickSelf",
"roi": [3, 581, 132, 132],
"postDelay": 3000,
"next": ["RA@Store@Begin"]
},
"RA@Store@Begin": {
"doc": "生息演算商店,小游戏入口",
"algorithm": "JustReturn",
"next": ["RA@Store@ClickItem", "RA@Store@Swipe"]
},
"RA@Store@ClickItem": {
"action": "ClickSelf",
"method": "RGBCount",
"roi": [0, 336, 1280, 367],
"colorScales": [
[
[0, 0, 0],
[255, 255, 110]
]
],
"next": ["RA@Store@ChooseMaxAmount", "RA@Store@Purchase"]
},
"RA@Store@ChooseMaxAmount": {
"roi": [986, 352, 164, 139],
"next": ["RA@Store@UnderfundedOCR", "RA@Store@Purchase"]
},
"RA@Store@UnderfundedOCR": {
"roi": [878, 397, 82, 48]
},
"RA@Store@Purchase": {
"text": ["支付"],
"roi": [640, 400, 424, 220],
"next": ["RA@Store@PurchasedConfirm", "RA@Store@RecruitSkip", "RA@Store@Underfunded"]
},
"RA@Store@Underfunded": {
"template": "ReceivedAllMail.png",
"roi": [909, 33, 166, 165],
"method": "HSVCount",
"colorScales": [[250, 255]],
"next": ["Stop"]
},
"RA@Store@RecruitSkip": {
"template": "SS@Store@RecruitSkip.png",
"roi": [1143, 0, 137, 150],
"next": ["RA@Store@RecruitSkipClick"]
},
"RA@Store@RecruitSkipClick": {
"algorithm": "JustReturn",
"action": "ClickRect",
"specificRect": [1197, 23, 53, 45],
"next": ["RA@Store@RecruitSkipped", "RA@Store@RecruitSkipClick"]
},
"RA@Store@RecruitSkipped": {
"algorithm": "OcrDetect",
"text": ["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"],
"roi": [1160, 16, 97, 42],
"next": ["RA@Store@ClickItem", "RA@Store@Swipe"]
},
"RA@Store@PurchasedConfirm": {
"baseTask": "CreditShop-Bought",
"template": "CreditShop-Bought.png",
"next": ["RA@Store@PurchasedConfirm", "RA@Store@ClickItem", "RA@Store@Swipe"]
},
"RA@Store@Swipe": {
"baseTask": "SlowlySwipeToTheRight",
"postDelay": 1000,
"next": ["RA@Store@ClickItem", "Stop"]
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

View File

@@ -43,6 +43,9 @@ bool asst::ReclamationTask::set_params(const json::value& params)
switch (mode) {
case ReclamationMode::ProsperityNoSave:
m_reclamation_task_ptr->set_tasks({ theme + "@RA@ProsperityNoSave" });
if (!params.get("clear_store", false)) {
m_reclamation_task_ptr->set_times_limit("RA@Store@EnterStore", 0);
}
break;
case ReclamationMode::ProsperityInSave:
m_reclamation_task_ptr->set_tasks({ theme + "@RA@ProsperityInSave" });

View File

@@ -164,6 +164,7 @@ namespace MaaWpfGui.Constants
public const string ReclamationToolToCraft = "Reclamation.ToolToCraft";
public const string ReclamationIncrementMode = "Reclamation.ReclamationIncrementMode";
public const string ReclamationMaxCraftCountPerRound = "Reclamation.ReclamationMaxCraftCountPerRound";
public const string ReclamationClearStore = "Reclamation.ReclamationClearStore";
public const string RecruitMaxTimes = "AutoRecruit.MaxTimes";
public const string AutoRecruitFirstList = "AutoRecruit.AutoRecruitFirstList";

View File

@@ -60,6 +60,11 @@ public class AsstReclamationTask : AsstBaseTask
/// </summary>
public List<string> ToolToCraft { get; set; } = [];
/// <summary>
/// Gets or sets a value indicating whether 刷完点数后购买商店
/// </summary>
public bool ClearStore { get; set; } = false;
public override (AsstTaskType TaskType, JObject Params) Serialize()
{
var data = new JObject
@@ -69,6 +74,7 @@ public class AsstReclamationTask : AsstBaseTask
["increment_mode"] = IncrementMode,
["num_craft_batches"] = MaxCraftCountPerRound,
["tools_to_craft"] = new JArray(ToolToCraft),
["clear_store"] = ClearStore,
};
return (TaskType, data);

View File

@@ -524,6 +524,7 @@ The primary instance is 0, and other instances are the numbers after the version
<system:String x:Key="ReclamationIncrementModeClick">Click</system:String>
<system:String x:Key="ReclamationIncrementModeHold">Hold</system:String>
<system:String x:Key="ReclamationMaxCraftCountPerRound">Max Craft Count Per Round</system:String>
<system:String x:Key="ReclamationClearStore">Clear Store after finished</system:String>
<system:String x:Key="OperNameLanguage">Operator display language</system:String>
<system:String x:Key="OperNameLanguageMAA">Follow MAA</system:String>
<system:String x:Key="OperNameLanguageClient">Follow game client</system:String>
@@ -700,6 +701,8 @@ The video aspect ratio needs to be 16:9 without interference factors such as bla
<system:String x:Key="MiniGameNameYellowTicketStoreTip" xml:space="preserve">Please ensure you have at least 258 yellow tickets.</system:String>
<system:String x:Key="MiniGameNameSsStore">Event Shop</system:String>
<system:String x:Key="MiniGameNameSsStoreTip" xml:space="preserve">Please start from the event shop page.&#10;Won't buy items with unlimited purchase quantities.</system:String>
<system:String x:Key="MiniGameNameRAStore">Reclamation Algorithm Shop</system:String>
<system:String x:Key="MiniGameNameRAStoreTip" xml:space="preserve">Please start from the event shop page.</system:String>
<!-- !小游戏 -->
<!-- Logs -->
<system:String x:Key="Identifying">Identifying……</system:String>

View File

@@ -526,6 +526,7 @@ C:\\leidian\\LDPlayer9
<system:String x:Key="ReclamationIncrementModeClick">連打</system:String>
<system:String x:Key="ReclamationIncrementModeHold">長押し</system:String>
<system:String x:Key="ReclamationMaxCraftCountPerRound">1回の最大クラフト回数</system:String>
<system:String x:Key="ReclamationClearStore">Clear Store after finished</system:String>
<system:String x:Key="OperNameLanguage">オペレーター名の表示言語</system:String>
<system:String x:Key="OperNameLanguageMAA">MAA をフォローする</system:String>
<system:String x:Key="OperNameLanguageClient">ゲームクライアントをフォローする</system:String>
@@ -704,6 +705,8 @@ C:\\leidian\\LDPlayer9
<system:String x:Key="MiniGameNameYellowTicketStoreTip" xml:space="preserve">少なくとも258枚の黄チケットを持っていることを確認してください。</system:String>
<system:String x:Key="MiniGameNameSsStore">イベントショップ</system:String>
<system:String x:Key="MiniGameNameSsStoreTip" xml:space="preserve">イベントのショップページからのみ始めてください。&#10;購入数量無制限のアイテムは購入することはありません。</system:String>
<system:String x:Key="MiniGameNameRAStore">生息演算商店</system:String>
<system:String x:Key="MiniGameNameRAStoreTip" xml:space="preserve">イベントのショップページからのみ始めてください。</system:String>
<!-- !小游戏 -->
<!-- Logs -->
<system:String x:Key="Identifying">認識中……</system:String>

View File

@@ -525,6 +525,7 @@ C:\\leidian\\LDPlayer9
<system:String x:Key="ReclamationIncrementModeClick">연타</system:String>
<system:String x:Key="ReclamationIncrementModeHold">길게 누르기</system:String>
<system:String x:Key="ReclamationMaxCraftCountPerRound">한 번의 최대 제작 횟수</system:String>
<system:String x:Key="ReclamationClearStore">Clear Store after finished</system:String>
<system:String x:Key="OperNameLanguage">오퍼레이터 이름 표시 언어</system:String>
<system:String x:Key="OperNameLanguageMAA">MAA 언어 따라가기</system:String>
<system:String x:Key="OperNameLanguageClient">게임 클라이언트 따라가기</system:String>
@@ -703,6 +704,8 @@ C:\\leidian\\LDPlayer9
<system:String x:Key="MiniGameNameYellowTicketStoreTip" xml:space="preserve">최소한 258장의 노란색 티켓을 가지고 있는지 확인하세요.</system:String>
<system:String x:Key="MiniGameNameSsStore">이벤트 상점</system:String>
<system:String x:Key="MiniGameNameSsStoreTip" xml:space="preserve">이벤트 상점 페이지에서만 시작하세요.&#10;구매 수량이 무제한인 아이템은 구매하지 마세요.</system:String>
<system:String x:Key="MiniGameNameRAStore">생존연산 상점</system:String>
<system:String x:Key="MiniGameNameRAStoreTip" xml:space="preserve">이벤트 상점 페이지에서만 시작하세요.</system:String>
<!-- !小游戏 -->
<!-- 로그 -->
<system:String x:Key="Identifying">인식 중……</system:String>

View File

@@ -526,6 +526,7 @@ C:\\leidian\\LDPlayer9。\n
<system:String x:Key="ReclamationIncrementModeClick">连点</system:String>
<system:String x:Key="ReclamationIncrementModeHold">长按</system:String>
<system:String x:Key="ReclamationMaxCraftCountPerRound">单次最大组装轮数</system:String>
<system:String x:Key="ReclamationClearStore">任务完成后购买商店</system:String>
<system:String x:Key="OperNameLanguage">干员名称显示语言</system:String>
<system:String x:Key="OperNameLanguageMAA">跟随 MAA</system:String>
<system:String x:Key="OperNameLanguageClient">跟随游戏客户端</system:String>
@@ -704,6 +705,8 @@ C:\\leidian\\LDPlayer9。\n
<system:String x:Key="MiniGameNameYellowTicketStoreTip" xml:space="preserve">请确保自己至少有258张黄票。</system:String>
<system:String x:Key="MiniGameNameSsStore">活动商店</system:String>
<system:String x:Key="MiniGameNameSsStoreTip" xml:space="preserve">请在活动商店页面开始。&#10;不买无限池。</system:String>
<system:String x:Key="MiniGameNameRAStore">生息演算商店</system:String>
<system:String x:Key="MiniGameNameRAStoreTip" xml:space="preserve">请在活动商店页面开始。</system:String>
<!-- !小游戏 -->
<!-- 日志 -->
<system:String x:Key="Identifying">正在识别……</system:String>

View File

@@ -524,6 +524,7 @@ C:\\leidian\\LDPlayer9。\n
<system:String x:Key="ReclamationIncrementModeClick">連點</system:String>
<system:String x:Key="ReclamationIncrementModeHold">長按</system:String>
<system:String x:Key="ReclamationMaxCraftCountPerRound">單次最大組裝輪數</system:String>
<system:String x:Key="ReclamationClearStore">任务完成后购买商店</system:String>
<system:String x:Key="OperNameLanguage">幹員名稱顯示語言</system:String>
<system:String x:Key="OperNameLanguageMAA">跟隨 MAA</system:String>
<system:String x:Key="OperNameLanguageClient">跟隨遊戲客戶端</system:String>
@@ -702,6 +703,8 @@ C:\\leidian\\LDPlayer9。\n
<system:String x:Key="MiniGameNameYellowTicketStoreTip" xml:space="preserve">請確保自己至少有258張黃票。</system:String>
<system:String x:Key="MiniGameNameSsStore">活動商店</system:String>
<system:String x:Key="MiniGameNameSsStoreTip" xml:space="preserve">請在活動商店頁面開始。&#10;不購買無限量物品。</system:String>
<system:String x:Key="MiniGameNameRAStore">生息演算商店</system:String>
<system:String x:Key="MiniGameNameRAStoreTip" xml:space="preserve">請在活動商店頁面開始。</system:String>
<!-- !小游戏 -->
<!-- 日誌 -->
<system:String x:Key="Identifying">正在辨識……</system:String>

View File

@@ -1136,6 +1136,7 @@ namespace MaaWpfGui.ViewModels.UI
new() { Display = LocalizationHelper.GetString("MiniGameNameGreenTicketStore"), Value = "GreenTicket@Store@Begin" },
new() { Display = LocalizationHelper.GetString("MiniGameNameYellowTicketStore"), Value = "YellowTicket@Store@Begin" },
new() { Display = LocalizationHelper.GetString("MiniGameNameSsStore"), Value = "SS@Store@Begin" },
new() { Display = LocalizationHelper.GetString("MiniGameNameRAStore"), Value = "RA@Store@Begin" },
];
private string _miniGameTaskName = ConfigurationHelper.GetGlobalValue(ConfigurationKeys.MiniGameTaskName, "Stop");
@@ -1171,6 +1172,7 @@ namespace MaaWpfGui.ViewModels.UI
"GreenTicket@Store@Begin" => LocalizationHelper.GetString("MiniGameNameGreenTicketStoreTip"),
"YellowTicket@Store@Begin" => LocalizationHelper.GetString("MiniGameNameYellowTicketStoreTip"),
"SS@Store@Begin" => LocalizationHelper.GetString("MiniGameNameSsStoreTip"),
"RA@Store@Begin" => LocalizationHelper.GetString("MiniGameNameRAStoreTip"),
_ => string.Empty,
};
}

View File

@@ -136,6 +136,18 @@ public class ReclamationSettingsUserControlModel : TaskViewModel
}
}
private bool _reclamationClearStore = Convert.ToBoolean(ConfigurationHelper.GetValue(ConfigurationKeys.ReclamationClearStore, bool.FalseString));
public bool ReclamationClearStore
{
get => _reclamationClearStore;
set
{
SetAndNotify(ref _reclamationClearStore, value);
ConfigurationHelper.SetValue(ConfigurationKeys.ReclamationClearStore, value.ToString());
}
}
/// <summary>
/// 自动生息演算。
/// </summary>
@@ -156,6 +168,7 @@ public class ReclamationSettingsUserControlModel : TaskViewModel
/// <param name="increment_mode">点击类型0 连点1 长按</param>
/// <param name="num_craft_batches">单次最大制造轮数</param>
/// <param name="tools_to_craft">要组装的支援道具。</param>
/// <param name="clear_store">刷完点数后是否清空商店。</param>
/// <returns>返回(Asst任务类型, 参数)</returns>
public override (AsstTaskType Type, JObject Params) Serialize()
{
@@ -166,6 +179,7 @@ public class ReclamationSettingsUserControlModel : TaskViewModel
IncrementMode = ReclamationIncrementMode,
MaxCraftCountPerRound = ReclamationMaxCraftCountPerRound,
ToolToCraft = ReclamationToolToCraft.Split(';').Select(s => s.Trim()).ToList(),
ClearStore = ReclamationClearStore,
}.Serialize();
}
}

View File

@@ -63,6 +63,15 @@
IsEnabled="{c:Binding 'ReclamationMode == &quot;1&quot;'}"
Minimum="0"
Value="{Binding ReclamationMaxCraftCountPerRound}" />
<CheckBox
Margin="0,10"
IsChecked="{Binding ReclamationClearStore}"
Visibility="{c:Binding 'ReclamationMode == 0'}">
<TextBlock
Block.TextAlignment="Left"
Text="{DynamicResource ReclamationClearStore}"
TextWrapping="Wrap" />
</CheckBox>
<!--<controls:TextBlock
Margin="5,50,5,10"
FontSize="40"