Merge pull request #3504 from WLLEGit/ReclamationAlgorithm
feat: 五天流生息演算
@@ -9727,5 +9727,333 @@
|
||||
"BattleStartPreFlag": {
|
||||
"baseTask": "BattleStartPre",
|
||||
"action": "DoNothing"
|
||||
},
|
||||
|
||||
"Reclamation@Begin":{
|
||||
"algorithm": "JustReturn",
|
||||
"next":[
|
||||
"Reclamation@GiveupAlgorithm",
|
||||
"Reclamation@StartAlgorithm"
|
||||
]
|
||||
},
|
||||
"Reclamation@StartAlgorithm":{
|
||||
"roi": [
|
||||
844,
|
||||
569,
|
||||
436,
|
||||
151
|
||||
],
|
||||
"action": "ClickSelf",
|
||||
"next": [
|
||||
"Reclamation@ClickChooseInitUnits",
|
||||
"Reclamation@StartAlgorithm"
|
||||
]
|
||||
},
|
||||
"Reclamation@ClickChooseInitUnits":{
|
||||
"roi": [
|
||||
1055,
|
||||
0,
|
||||
225,
|
||||
178
|
||||
],
|
||||
"action": "ClickSelf",
|
||||
"next": [
|
||||
"Reclamation@InitSupplyAll",
|
||||
"Reclamation@ClickChooseInitUnits"
|
||||
]
|
||||
},
|
||||
"Reclamation@InitSupplyAll":{
|
||||
"roi": [
|
||||
862,
|
||||
572,
|
||||
418,
|
||||
148
|
||||
],
|
||||
"action": "ClickSelf",
|
||||
"next": [
|
||||
"Reclamation@ConfirmStart",
|
||||
"Reclamation@InitSupplyAll"
|
||||
]
|
||||
},
|
||||
"Reclamation@ConfirmStart":{
|
||||
"roi": [
|
||||
874,
|
||||
503,
|
||||
350,
|
||||
212
|
||||
],
|
||||
"action": "ClickSelf",
|
||||
"next": [
|
||||
"Reclamation@SkipAnnounce",
|
||||
"Reclamation@SkipDailyReport",
|
||||
"Reclamation@Emergency",
|
||||
"Reclamation@ClickCenterBase",
|
||||
"Reclamation@ResetScope"
|
||||
]
|
||||
},
|
||||
"Reclamation@SkipAnnounce":{
|
||||
"algorithm": "OcrDetect",
|
||||
"roi": [
|
||||
1109, 0, 171, 151
|
||||
],
|
||||
"text": [
|
||||
"跳过"
|
||||
],
|
||||
"action": "ClickSelf",
|
||||
"next": [
|
||||
"Reclamation@ConfirmStart#next"
|
||||
]
|
||||
},
|
||||
"Reclamation@SkipDailyReport":{
|
||||
"algorithm": "OcrDetect",
|
||||
"cache": false,
|
||||
"roi": [
|
||||
539,39,207,134
|
||||
],
|
||||
"text": [
|
||||
"今日",
|
||||
"日报"
|
||||
],
|
||||
"action": "ClickRect",
|
||||
"specificRect": [
|
||||
1190,
|
||||
651,
|
||||
52,
|
||||
48
|
||||
],
|
||||
"next": [
|
||||
"Reclamation@ConfirmStart#next"
|
||||
]
|
||||
},
|
||||
"Reclamation@ClickCenterBase":{
|
||||
"roi": [
|
||||
557, 281, 162, 155
|
||||
],
|
||||
"action": "ClickSelf",
|
||||
"postDelay": 1000,
|
||||
"next": [
|
||||
"Reclamation@ClickAnyZoneOcr",
|
||||
"Reclamation@SkipAnnounce",
|
||||
"Reclamation@SkipDailyReport",
|
||||
"Reclamation@ResetScope",
|
||||
"Reclamation@ClickCenterBase"
|
||||
]
|
||||
},
|
||||
"Reclamation@ClickAnyZoneOcr":{
|
||||
"algorithm": "OcrDetect",
|
||||
"cache": false,
|
||||
"roi": [
|
||||
308, 73, 739, 567
|
||||
],
|
||||
"text": [
|
||||
"区",
|
||||
"Zone"
|
||||
],
|
||||
"action": "ClickSelf",
|
||||
"next": [
|
||||
"Reclamation@StartActionEnter",
|
||||
"Reclamation@ClickAnyZoneOcr"
|
||||
]
|
||||
},
|
||||
"Reclamation@StartActionEnter":{
|
||||
"algorithm": "OcrDetect",
|
||||
"cache": false,
|
||||
"roi": [
|
||||
995, 550, 285, 130
|
||||
],
|
||||
"text": [
|
||||
"开始行动",
|
||||
"决断"
|
||||
],
|
||||
"action": "ClickSelf",
|
||||
"next": [
|
||||
"Reclamation@PrepareAction",
|
||||
"Reclamation@StartActionEnter"
|
||||
]
|
||||
},
|
||||
"Reclamation@PrepareAction":{
|
||||
"algorithm": "OcrDetect",
|
||||
"roi": [
|
||||
996,590,254,130
|
||||
],
|
||||
"text": [
|
||||
"行动准备"
|
||||
],
|
||||
"action": "ClickSelf",
|
||||
"next": [
|
||||
"Reclamation@StartActionConfirm",
|
||||
"Reclamation@PrepareAction"
|
||||
]
|
||||
},
|
||||
"Reclamation@StartActionConfirm":{
|
||||
"roi": [
|
||||
962, 65, 311, 522
|
||||
],
|
||||
"action": "ClickSelf",
|
||||
"next": [
|
||||
"Reclamation@StartActionPopupConfirm",
|
||||
"Reclamation@StartActionConfirm"
|
||||
]
|
||||
},
|
||||
"Reclamation@StartActionPopupConfirm":{
|
||||
"template": "PopupConfirm.png",
|
||||
"action": "ClickSelf",
|
||||
"roi": [
|
||||
630,
|
||||
400,
|
||||
650,
|
||||
160
|
||||
],
|
||||
"next": [
|
||||
"Reclamation@ClickExitLevel",
|
||||
"Reclamation@StartActionPopupConfirm"
|
||||
]
|
||||
},
|
||||
"Reclamation@ClickExitLevel":{
|
||||
"action": "ClickRect",
|
||||
"roi": [
|
||||
100, 0, 164, 166
|
||||
],
|
||||
"specificRect": [
|
||||
46, 28, 59, 61
|
||||
],
|
||||
"next": [
|
||||
"Reclamation@ExitLevelConfirm",
|
||||
"Reclamation@ExitLevelWithEnermyConfirm",
|
||||
"Reclamation@ClickExitLevel"
|
||||
]
|
||||
},
|
||||
"Reclamation@ExitLevelConfirm":{
|
||||
"roi": [
|
||||
857, 337, 370, 177
|
||||
],
|
||||
"action": "ClickSelf",
|
||||
"next": [
|
||||
"Reclamation@LevelComplete",
|
||||
"Reclamation@ExitLevelConfirm"
|
||||
]
|
||||
},
|
||||
"Reclamation@ExitLevelWithEnermyConfirm":{
|
||||
"roi": [
|
||||
855, 335, 372, 181
|
||||
],
|
||||
"action": "ClickSelf",
|
||||
"next": [
|
||||
"Reclamation@LevelComplete",
|
||||
"Reclamation@ExitLevelWithEnermyConfirm"
|
||||
]
|
||||
},
|
||||
"Reclamation@LevelComplete":{
|
||||
"algorithm": "OcrDetect",
|
||||
"cache": false,
|
||||
"roi": [
|
||||
0, 197, 469, 224
|
||||
],
|
||||
"action": "ClickSelf",
|
||||
"text": [
|
||||
"结束",
|
||||
"MISSON",
|
||||
"RESULTS"
|
||||
],
|
||||
"next": [
|
||||
"Reclamation@NextDay",
|
||||
"Reclamation@ResetScope",
|
||||
"Reclamation@LevelComplete"
|
||||
]
|
||||
},
|
||||
"Reclamation@ResetScope":{
|
||||
"roi": [
|
||||
0, 605, 141, 115
|
||||
],
|
||||
"action": "ClickSelf",
|
||||
"postDelay": 500,
|
||||
"next": [
|
||||
"Reclamation@ClickCenterBase",
|
||||
"Reclamation@ResetScope"
|
||||
]
|
||||
},
|
||||
"Reclamation@NextDay":{
|
||||
"roi": [
|
||||
1055, 0, 225, 177
|
||||
],
|
||||
"action": "ClickSelf",
|
||||
"postDelay": 1000,
|
||||
"next": [
|
||||
"Reclamation@Emergency",
|
||||
"Reclamation@NextDay",
|
||||
"Reclamation@ConfirmStart#next"
|
||||
]
|
||||
},
|
||||
"Reclamation@Emergency":{
|
||||
"action": "DoNothing",
|
||||
"roi": [
|
||||
1055, 0, 225, 181
|
||||
],
|
||||
"next": [
|
||||
"Reclamation@ExitAlgorithm"
|
||||
]
|
||||
},
|
||||
"Reclamation@ExitAlgorithm":{
|
||||
"roi": [
|
||||
0, 0, 160, 154
|
||||
],
|
||||
"action": "ClickSelf",
|
||||
"next": [
|
||||
"Reclamation@GiveupAlgorithm",
|
||||
"Reclamation@ExitAlgorithm"
|
||||
]
|
||||
},
|
||||
"Reclamation@GiveupAlgorithm":{
|
||||
"roi": [
|
||||
684, 569, 273, 151
|
||||
],
|
||||
"action": "ClickSelf",
|
||||
"next": [
|
||||
"Reclamation@GiveupAlgorithmConfirm",
|
||||
"Reclamation@GiveupAlgorithm"
|
||||
]
|
||||
},
|
||||
"Reclamation@GiveupAlgorithmConfirm":{
|
||||
"template": "PopupConfirm.png",
|
||||
"action": "ClickSelf",
|
||||
"roi": [
|
||||
630,
|
||||
400,
|
||||
650,
|
||||
160
|
||||
],
|
||||
"next": [
|
||||
"Reclamation@GiveupReportSkip",
|
||||
"Reclamation@GiveupAlgorithmConfirm"
|
||||
]
|
||||
},
|
||||
"Reclamation@GiveupReportSkip":{
|
||||
"roi": [
|
||||
1074, 537, 183, 180
|
||||
],
|
||||
"action": "ClickSelf",
|
||||
"next": [
|
||||
"Reclamation@GiveupReportSkip",
|
||||
"Reclamation@GiveupSkipConfirm"
|
||||
]
|
||||
},
|
||||
"Reclamation@GiveupSkipConfirm":{
|
||||
"roi": [
|
||||
1082, 547, 198, 157
|
||||
],
|
||||
"action": "ClickSelf",
|
||||
"next": [
|
||||
"Reclamation@GainReword",
|
||||
"Reclamation@GiveupSkipConfirm"
|
||||
]
|
||||
},
|
||||
"Reclamation@GainReword":{
|
||||
"roi": [
|
||||
556, 559, 179, 161
|
||||
],
|
||||
"action": "ClickSelf",
|
||||
"next": [
|
||||
"Reclamation@Begin"
|
||||
]
|
||||
}
|
||||
}
|
||||
|
||||
BIN
resource/template/Reclamation@ClickCenterBase.png
Normal file
|
After Width: | Height: | Size: 6.6 KiB |
BIN
resource/template/Reclamation@ClickChooseInitUnits.png
Normal file
|
After Width: | Height: | Size: 10 KiB |
BIN
resource/template/Reclamation@ClickExitLevel.png
Normal file
|
After Width: | Height: | Size: 3.8 KiB |
BIN
resource/template/Reclamation@ConfirmStart.png
Normal file
|
After Width: | Height: | Size: 22 KiB |
BIN
resource/template/Reclamation@Emergency.png
Normal file
|
After Width: | Height: | Size: 8.4 KiB |
BIN
resource/template/Reclamation@ExitAlgorithm.png
Normal file
|
After Width: | Height: | Size: 2.3 KiB |
BIN
resource/template/Reclamation@ExitLevelConfirm.png
Normal file
|
After Width: | Height: | Size: 10 KiB |
BIN
resource/template/Reclamation@ExitLevelWithEnermyConfirm.png
Normal file
|
After Width: | Height: | Size: 8.6 KiB |
BIN
resource/template/Reclamation@GainReword.png
Normal file
|
After Width: | Height: | Size: 7.7 KiB |
BIN
resource/template/Reclamation@GiveupAlgorithm.png
Normal file
|
After Width: | Height: | Size: 7.3 KiB |
BIN
resource/template/Reclamation@GiveupReportSkip.png
Normal file
|
After Width: | Height: | Size: 9.8 KiB |
BIN
resource/template/Reclamation@GiveupSkipConfirm.png
Normal file
|
After Width: | Height: | Size: 5.9 KiB |
BIN
resource/template/Reclamation@InitSupplyAll.png
Normal file
|
After Width: | Height: | Size: 6.7 KiB |
BIN
resource/template/Reclamation@NextDay.png
Normal file
|
After Width: | Height: | Size: 9.9 KiB |
BIN
resource/template/Reclamation@ResetScope.png
Normal file
|
After Width: | Height: | Size: 2.6 KiB |
BIN
resource/template/Reclamation@StartActionConfirm.png
Normal file
|
After Width: | Height: | Size: 74 KiB |
BIN
resource/template/Reclamation@StartAlgorithm.png
Normal file
|
After Width: | Height: | Size: 18 KiB |
@@ -17,6 +17,7 @@
|
||||
#include "Task/Interface/SingleStepTask.h"
|
||||
#include "Task/Interface/MallTask.h"
|
||||
#include "Task/Interface/RecruitTask.h"
|
||||
#include "Task/Interface/ReclamationTask.h"
|
||||
#include "Task/Interface/RoguelikeTask.h"
|
||||
#include "Task/Interface/SSSCopilotTask.h"
|
||||
#include "Task/Interface/StartUpTask.h"
|
||||
@@ -162,6 +163,7 @@ asst::Assistant::TaskId asst::Assistant::append_task(const std::string& type, co
|
||||
ASST_ASSISTANT_APPEND_TASK_FROM_STRING_IF_BRANCH(SSSCopilotTask)
|
||||
ASST_ASSISTANT_APPEND_TASK_FROM_STRING_IF_BRANCH(SingleStepTask)
|
||||
ASST_ASSISTANT_APPEND_TASK_FROM_STRING_IF_BRANCH(DepotTask)
|
||||
ASST_ASSISTANT_APPEND_TASK_FROM_STRING_IF_BRANCH(ReclamationTask)
|
||||
#ifdef ASST_DEBUG
|
||||
ASST_ASSISTANT_APPEND_TASK_FROM_STRING_IF_BRANCH(DebugTask)
|
||||
#endif
|
||||
|
||||
@@ -32,6 +32,7 @@
|
||||
<ClInclude Include="Config\Miscellaneous\SSSCopilotConfig.h" />
|
||||
<ClInclude Include="Controller.h" />
|
||||
<ClInclude Include="InstHelper.h" />
|
||||
<ClInclude Include="Task\Interface\ReclamationTask.h" />
|
||||
<ClInclude Include="Task\BattleHelper.h" />
|
||||
<ClInclude Include="Task\Interface\SingleStepTask.h" />
|
||||
<ClInclude Include="Task\Interface\SSSCopilotTask.h" />
|
||||
@@ -158,6 +159,7 @@
|
||||
<ClCompile Include="Config\Miscellaneous\SSSCopilotConfig.cpp" />
|
||||
<ClCompile Include="Controller.cpp" />
|
||||
<ClCompile Include="InstHelper.cpp" />
|
||||
<ClCompile Include="Task\Interface\ReclamationTask.cpp" />
|
||||
<ClCompile Include="Task\BattleHelper.cpp" />
|
||||
<ClCompile Include="Task\Interface\SingleStepTask.cpp" />
|
||||
<ClCompile Include="Task\Interface\SSSCopilotTask.cpp" />
|
||||
|
||||
@@ -492,6 +492,9 @@
|
||||
<ClInclude Include="Task\Interface\SingleStepTask.h">
|
||||
<Filter>源文件\Task\Interface</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="Task\Interface\ReclamationTask.h">
|
||||
<Filter>源文件\Task\Interface</Filter>
|
||||
</ClInclude>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="Vision\AbstractImageAnalyzer.cpp">
|
||||
@@ -809,5 +812,8 @@
|
||||
<ClCompile Include="Task\Interface\SingleStepTask.cpp">
|
||||
<Filter>源文件\Task\Interface</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="Task\Interface\ReclamationTask.cpp">
|
||||
<Filter>源文件\Task\Interface</Filter>
|
||||
</ClCompile>
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
16
src/MaaCore/Task/Interface/ReclamationTask.cpp
Normal file
@@ -0,0 +1,16 @@
|
||||
#include "Task/Interface/ReclamationTask.h"
|
||||
|
||||
#include "Common/AsstBattleDef.h"
|
||||
#include "Status.h"
|
||||
#include "Task/ProcessTask.h"
|
||||
#include "Utils/Logger.hpp"
|
||||
|
||||
|
||||
asst::ReclamationTask::ReclamationTask(const AsstCallback& callback, Assistant* inst)
|
||||
: InterfaceTask(callback, inst, TaskType),
|
||||
m_reclamation_task_ptr(std::make_shared<ProcessTask>(callback, inst, TaskType))
|
||||
{
|
||||
m_reclamation_task_ptr->set_tasks({ "Reclamation@Begin" });
|
||||
m_subtasks.emplace_back(m_reclamation_task_ptr);
|
||||
|
||||
}
|
||||
26
src/MaaCore/Task/Interface/ReclamationTask.h
Normal file
@@ -0,0 +1,26 @@
|
||||
#pragma once
|
||||
#include "Task/InterfaceTask.h"
|
||||
|
||||
namespace asst
|
||||
{
|
||||
class ProcessTask;
|
||||
class RoguelikeRecruitTaskPlugin;
|
||||
class RoguelikeSkillSelectionTaskPlugin;
|
||||
class RoguelikeBattleTaskPlugin;
|
||||
class RoguelikeCustomStartTaskPlugin;
|
||||
class RoguelikeDebugTaskPlugin;
|
||||
|
||||
class ReclamationTask : public InterfaceTask
|
||||
{
|
||||
public:
|
||||
inline static constexpr std::string_view TaskType = "ReclamationAlgorithm";
|
||||
|
||||
ReclamationTask(const AsstCallback& callback, Assistant* inst);
|
||||
virtual ~ReclamationTask() override = default;
|
||||
|
||||
//virtual bool set_params(const json::value& params) override;
|
||||
|
||||
private:
|
||||
std::shared_ptr<ProcessTask> m_reclamation_task_ptr = nullptr;
|
||||
};
|
||||
}
|
||||
@@ -1503,6 +1503,17 @@ namespace MaaWpfGui
|
||||
return id != 0;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 自动生息演算。
|
||||
/// </summary>
|
||||
/// <returns>是否成功。</returns>
|
||||
public bool AsstAppendReclamation()
|
||||
{
|
||||
AsstTaskId id = AsstAppendTaskWithEncoding("ReclamationAlgorithm");
|
||||
_latestTaskId[TaskType.Recruit] = id;
|
||||
return id != 0;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 公招识别。
|
||||
/// </summary>
|
||||
|
||||
@@ -192,6 +192,7 @@ namespace MaaWpfGui
|
||||
"Mall",
|
||||
"Mission",
|
||||
"AutoRoguelike",
|
||||
"ReclamationAlgorithm",
|
||||
};
|
||||
ActionAfterCompletedList = new List<GenericCombData<ActionType>>
|
||||
{
|
||||
@@ -654,6 +655,10 @@ namespace MaaWpfGui
|
||||
{
|
||||
ret &= AppendRoguelike();
|
||||
}
|
||||
else if(item.OriginalName == "ReclamationAlgorithm")
|
||||
{
|
||||
ret &= AppendReclamation();
|
||||
}
|
||||
else
|
||||
{
|
||||
--count;
|
||||
@@ -919,6 +924,12 @@ namespace MaaWpfGui
|
||||
settings.RoguelikeEnableNonfriendSupport, settings.RoguelikeTheme);
|
||||
}
|
||||
|
||||
private bool AppendReclamation()
|
||||
{
|
||||
var asstProxy = _container.Get<AsstProxy>();
|
||||
return asstProxy.AsstAppendReclamation();
|
||||
}
|
||||
|
||||
[DllImport("User32.dll", EntryPoint = "FindWindow")]
|
||||
private static extern IntPtr FindWindow(string lpClassName, string lpWindowName);
|
||||
|
||||
|
||||
@@ -241,6 +241,7 @@
|
||||
<system:String x:Key="Mall">获取信用及购物</system:String>
|
||||
<system:String x:Key="Mission">领取日常奖励</system:String>
|
||||
<system:String x:Key="AutoRoguelike">自动肉鸽</system:String>
|
||||
<system:String x:Key="ReclamationAlgorithm">自动生息演算</system:String>
|
||||
|
||||
<system:String x:Key="SelectAll">全选</system:String>
|
||||
<system:String x:Key="Inverse">反选</system:String>
|
||||
|
||||