perf: 将CiphertextBoard更换为foldartal
@@ -239,10 +239,10 @@
|
||||
]
|
||||
}
|
||||
],
|
||||
"ciphertextBoard": [
|
||||
"foldartal": [
|
||||
{
|
||||
"name": "布局",
|
||||
"ciphertextBoard": [
|
||||
"foldartal": [
|
||||
{
|
||||
"name": "黜人",
|
||||
"effect": "选择所有右侧邻近的战斗节点"
|
||||
@@ -323,7 +323,7 @@
|
||||
},
|
||||
{
|
||||
"name": "本因",
|
||||
"ciphertextBoard": [
|
||||
"foldartal": [
|
||||
{
|
||||
"name": "歌唱",
|
||||
"effect": "我方在此战斗时攻击速度+50 。协语:场上出现斗志昂扬无人机"
|
||||
@@ -9935,7 +9935,7 @@
|
||||
47
|
||||
]
|
||||
},
|
||||
"RoguelikeCiphertextBoardSlowlySwipeToTheUp": {
|
||||
"RoguelikeFoldartalSlowlySwipeToTheUp": {
|
||||
"baseTask": "SlowlySwipeToTheUp",
|
||||
"specificRect": [
|
||||
180,
|
||||
@@ -9957,7 +9957,7 @@
|
||||
],
|
||||
"postDelay": 500
|
||||
},
|
||||
"RoguelikeCiphertextBoardSwipeToTheDown": {
|
||||
"RoguelikeFoldartalSwipeToTheDown": {
|
||||
"baseTask": "SwipeToTheDown",
|
||||
"specificRect": [
|
||||
180,
|
||||
@@ -13382,7 +13382,7 @@
|
||||
"Sami@Roguelike@ChooseOperConfirm#next"
|
||||
]
|
||||
},
|
||||
"Sami@Roguelike@CiphertextBoard": {
|
||||
"Sami@Roguelike@Foldartal": {
|
||||
"cache": false,
|
||||
"action": "ClickSelf",
|
||||
"roi": [
|
||||
@@ -13393,7 +13393,7 @@
|
||||
],
|
||||
"postDelay": 2000
|
||||
},
|
||||
"Sami@Roguelike@CiphertextBoardBack": {
|
||||
"Sami@Roguelike@FoldartalBack": {
|
||||
"action": "ClickSelf",
|
||||
"roi": [
|
||||
0,
|
||||
@@ -13403,9 +13403,9 @@
|
||||
],
|
||||
"postDelay": 2000
|
||||
},
|
||||
"Sami@Roguelike@CiphertextBoardGain": {
|
||||
"doc": "本任务注册插件RoguelikeCiphertextBoardGain",
|
||||
"template": "Sami@Roguelike@CiphertextBoardGain",
|
||||
"Sami@Roguelike@FoldartalGain": {
|
||||
"doc": "本任务注册插件RoguelikeFoldartalGain",
|
||||
"template": "Sami@Roguelike@FoldartalGain",
|
||||
"action": "ClickRect",
|
||||
"specificRect": [
|
||||
611,
|
||||
@@ -13425,11 +13425,11 @@
|
||||
255
|
||||
],
|
||||
"next": [
|
||||
"Sami@Roguelike@CiphertextBoardGain",
|
||||
"Sami@Roguelike@FoldartalGain",
|
||||
"Sami@Roguelike@SquadConfirm#next"
|
||||
]
|
||||
},
|
||||
"Sami@Roguelike@CiphertextBoardGainOcr": {
|
||||
"Sami@Roguelike@FoldartalGainOcr": {
|
||||
"algorithm": "OcrDetect",
|
||||
"action": "DoNothing",
|
||||
"cache": false,
|
||||
@@ -13486,8 +13486,8 @@
|
||||
]
|
||||
]
|
||||
},
|
||||
"Sami@Roguelike@CiphertextBoardGainOcrAfterCombat": {
|
||||
"baseTask": "Sami@Roguelike@CiphertextBoardGainOcr",
|
||||
"Sami@Roguelike@FoldartalGainOcrAfterCombat": {
|
||||
"baseTask": "Sami@Roguelike@FoldartalGainOcr",
|
||||
"roi": [
|
||||
44,
|
||||
309,
|
||||
@@ -13495,8 +13495,8 @@
|
||||
124
|
||||
]
|
||||
},
|
||||
"Sami@Roguelike@CiphertextBoardGainOcrNextLevel": {
|
||||
"baseTask": "Sami@Roguelike@CiphertextBoardGainOcr",
|
||||
"Sami@Roguelike@FoldartalGainOcrNextLevel": {
|
||||
"baseTask": "Sami@Roguelike@FoldartalGainOcr",
|
||||
"roi": [
|
||||
290,
|
||||
640,
|
||||
@@ -13504,7 +13504,7 @@
|
||||
34
|
||||
]
|
||||
},
|
||||
"Sami@Roguelike@CiphertextBoardUseConfirm": {
|
||||
"Sami@Roguelike@FoldartalUseConfirm": {
|
||||
"algorithm": "OcrDetect",
|
||||
"action": "ClickSelf",
|
||||
"text": [
|
||||
@@ -13524,7 +13524,7 @@
|
||||
]
|
||||
]
|
||||
},
|
||||
"Sami@Roguelike@CiphertextBoardUseOcr": {
|
||||
"Sami@Roguelike@FoldartalUseOcr": {
|
||||
"algorithm": "OcrDetect",
|
||||
"action": "DoNothing",
|
||||
"cache": false,
|
||||
@@ -13551,20 +13551,20 @@
|
||||
0
|
||||
]
|
||||
},
|
||||
"Sami@Roguelike@CiphertextBoardUseOnStage": {
|
||||
"Sami@Roguelike@FoldartalUseOnStage": {
|
||||
"cache": false,
|
||||
"action": "ClickSelf",
|
||||
"template": [
|
||||
"Sami@Roguelike@CiphertextBoardUseOnGambling.png",
|
||||
"Sami@Roguelike@CiphertextBoardUseOnWindAndRain.png",
|
||||
"Sami@Roguelike@CiphertextBoardUseOnEmergencyTransportation.png",
|
||||
"Sami@Roguelike@CiphertextBoardUseOnCombatDps.png",
|
||||
"Sami@Roguelike@CiphertextBoardUseOnMysteriousPresage.png",
|
||||
"Sami@Roguelike@CiphertextBoardUseOnEmergencyDps.png",
|
||||
"Sami@Roguelike@CiphertextBoardUseOnDreadfulFoe-5.png",
|
||||
"Sami@Roguelike@CiphertextBoardUseOnFerociousPresage.png",
|
||||
"Sami@Roguelike@CiphertextBoardUseOnEncounter.png",
|
||||
"Sami@Roguelike@CiphertextBoardUseOnTrader.png"
|
||||
"Sami@Roguelike@FoldartalUseOnGambling.png",
|
||||
"Sami@Roguelike@FoldartalUseOnWindAndRain.png",
|
||||
"Sami@Roguelike@FoldartalUseOnEmergencyTransportation.png",
|
||||
"Sami@Roguelike@FoldartalUseOnCombatDps.png",
|
||||
"Sami@Roguelike@FoldartalUseOnMysteriousPresage.png",
|
||||
"Sami@Roguelike@FoldartalUseOnEmergencyDps.png",
|
||||
"Sami@Roguelike@FoldartalUseOnDreadfulFoe-5.png",
|
||||
"Sami@Roguelike@FoldartalUseOnFerociousPresage.png",
|
||||
"Sami@Roguelike@FoldartalUseOnEncounter.png",
|
||||
"Sami@Roguelike@FoldartalUseOnTrader.png"
|
||||
],
|
||||
"templThreshold": [
|
||||
0.7,
|
||||
@@ -13868,7 +13868,7 @@
|
||||
"Sami@Roguelike@DialogSkip",
|
||||
"Sami@Roguelike@Stages#next",
|
||||
"Sami@Roguelike@MapObject",
|
||||
"Sami@Roguelike@CiphertextBoardGain"
|
||||
"Sami@Roguelike@FoldartalGain"
|
||||
]
|
||||
},
|
||||
"Sami@Roguelike@SquadDefault": {},
|
||||
|
||||
|
Before Width: | Height: | Size: 24 KiB After Width: | Height: | Size: 24 KiB |
|
Before Width: | Height: | Size: 1.1 KiB After Width: | Height: | Size: 1.1 KiB |
|
Before Width: | Height: | Size: 148 KiB After Width: | Height: | Size: 148 KiB |
|
Before Width: | Height: | Size: 8.0 KiB After Width: | Height: | Size: 8.0 KiB |
|
Before Width: | Height: | Size: 9.5 KiB After Width: | Height: | Size: 9.5 KiB |
|
Before Width: | Height: | Size: 10 KiB After Width: | Height: | Size: 10 KiB |
|
Before Width: | Height: | Size: 6.5 KiB After Width: | Height: | Size: 6.5 KiB |
|
Before Width: | Height: | Size: 7.0 KiB After Width: | Height: | Size: 7.0 KiB |
|
Before Width: | Height: | Size: 8.1 KiB After Width: | Height: | Size: 8.1 KiB |
|
Before Width: | Height: | Size: 7.0 KiB After Width: | Height: | Size: 7.0 KiB |
|
Before Width: | Height: | Size: 6.4 KiB After Width: | Height: | Size: 6.4 KiB |
|
Before Width: | Height: | Size: 6.5 KiB After Width: | Height: | Size: 6.5 KiB |
|
Before Width: | Height: | Size: 8.2 KiB After Width: | Height: | Size: 8.2 KiB |
@@ -15,7 +15,7 @@
|
||||
#include "Miscellaneous/StageDropsConfig.h"
|
||||
#include "Miscellaneous/TilePack.h"
|
||||
#include "OnnxSessions.h"
|
||||
#include "Roguelike/RoguelikeCiphertextBoardConfig.h"
|
||||
#include "Roguelike/RoguelikeFoldartalConfig.h"
|
||||
#include "Roguelike/RoguelikeCopilotConfig.h"
|
||||
#include "Roguelike/RoguelikeRecruitConfig.h"
|
||||
#include "Roguelike/RoguelikeShoppingConfig.h"
|
||||
@@ -185,7 +185,7 @@ bool asst::ResourceLoader::load(const std::filesystem::path& path)
|
||||
LoadResourceAndCheckRet(RoguelikeStageEncounterConfig, "roguelike"_p / "Mizuki"_p / "encounter_for_deposit.json"_p);
|
||||
LoadResourceAndCheckRet(RoguelikeStageEncounterConfig, "roguelike"_p / "Sami"_p / "encounter_for_deposit.json"_p);
|
||||
|
||||
LoadResourceAndCheckRet(RoguelikeCiphertextBoardConfig, "roguelike"_p / "Sami"_p / "ciphertext_board.json"_p);
|
||||
LoadResourceAndCheckRet(RoguelikeFoldartalConfig, "roguelike"_p / "Sami"_p / "foldartal.json"_p);
|
||||
|
||||
#undef LoadTemplByConfigAndCheckRet
|
||||
#undef LoadResourceAndCheckRet
|
||||
|
||||
@@ -1,23 +1,23 @@
|
||||
#include "RoguelikeCiphertextBoardConfig.h"
|
||||
#include "RoguelikeFoldartalConfig.h"
|
||||
|
||||
#include <meojson/json.hpp>
|
||||
|
||||
#include "Utils/Logger.hpp"
|
||||
|
||||
bool asst::RoguelikeCiphertextBoardConfig::parse(const json::value& json)
|
||||
bool asst::RoguelikeFoldartalConfig::parse(const json::value& json)
|
||||
{
|
||||
LogTraceFunction;
|
||||
|
||||
const std::string theme = json.at("theme").as_string();
|
||||
m_ciphertext_board_combination.erase(theme);
|
||||
m_foldartal_combination.erase(theme);
|
||||
|
||||
for (const auto& combination_json : json.at("groups").as_array()) {
|
||||
|
||||
RoguelikeCiphertextBoardCombination combination;
|
||||
RoguelikeFoldartalCombination combination;
|
||||
combination.usage = combination_json.get("usage", "none");
|
||||
|
||||
for (const auto& pairs : combination_json.at("pairs").as_array()) {
|
||||
CiphertextBoardPair pair;
|
||||
FoldartalPair pair;
|
||||
const json::array& up_boards = pairs.at("up").as_array();
|
||||
for (const auto& board : up_boards) {
|
||||
pair.up_board.emplace_back(board.as_string());
|
||||
@@ -28,7 +28,7 @@ bool asst::RoguelikeCiphertextBoardConfig::parse(const json::value& json)
|
||||
}
|
||||
combination.pairs.emplace_back(pair);
|
||||
}
|
||||
m_ciphertext_board_combination[theme].emplace_back(std::move(combination));
|
||||
m_foldartal_combination[theme].emplace_back(std::move(combination));
|
||||
}
|
||||
|
||||
return true;
|
||||
@@ -9,34 +9,34 @@
|
||||
namespace asst
|
||||
{
|
||||
// 板子组合
|
||||
struct CiphertextBoardPair
|
||||
struct FoldartalPair
|
||||
{
|
||||
std::vector<std::string> up_board; // 上板子
|
||||
std::vector<std::string> down_board; // 下板子
|
||||
};
|
||||
struct RoguelikeCiphertextBoardCombination
|
||||
struct RoguelikeFoldartalCombination
|
||||
{
|
||||
std::string usage; // 适用的节点类型和用法
|
||||
std::vector<CiphertextBoardPair> pairs; // 适用的板子组合
|
||||
std::vector<FoldartalPair> pairs; // 适用的板子组合
|
||||
};
|
||||
|
||||
class RoguelikeCiphertextBoardConfig final : public SingletonHolder<RoguelikeCiphertextBoardConfig>,
|
||||
class RoguelikeFoldartalConfig final : public SingletonHolder<RoguelikeFoldartalConfig>,
|
||||
public AbstractConfig
|
||||
{
|
||||
public:
|
||||
virtual ~RoguelikeCiphertextBoardConfig() override = default;
|
||||
virtual ~RoguelikeFoldartalConfig() override = default;
|
||||
|
||||
const auto& get_combination(const std::string& theme) const noexcept
|
||||
{
|
||||
return m_ciphertext_board_combination.at(theme);
|
||||
return m_foldartal_combination.at(theme);
|
||||
}
|
||||
|
||||
private:
|
||||
virtual bool parse(const json::value& json) override;
|
||||
|
||||
std::unordered_map<std::string, std::vector<RoguelikeCiphertextBoardCombination>>
|
||||
m_ciphertext_board_combination;
|
||||
std::unordered_map<std::string, std::vector<RoguelikeFoldartalCombination>>
|
||||
m_foldartal_combination;
|
||||
};
|
||||
|
||||
inline static auto& RoguelikeCiphertextBoard = RoguelikeCiphertextBoardConfig::get_instance();
|
||||
inline static auto& RoguelikeFoldartal = RoguelikeFoldartalConfig::get_instance();
|
||||
}
|
||||
@@ -48,14 +48,14 @@
|
||||
<ClInclude Include="Config\Miscellaneous\OcrConfig.h" />
|
||||
<ClInclude Include="Config\Miscellaneous\SSSCopilotConfig.h" />
|
||||
<ClInclude Include="Config\OnnxSessions.h" />
|
||||
<ClInclude Include="Config\Roguelike\RoguelikeCiphertextBoardConfig.h" />
|
||||
<ClInclude Include="Config\Roguelike\RoguelikeFoldartalConfig.h" />
|
||||
<ClInclude Include="Controller\adb-lite\client.hpp" />
|
||||
<ClInclude Include="Controller\adb-lite\protocol.hpp" />
|
||||
<ClInclude Include="Controller\Controller.h" />
|
||||
<ClInclude Include="Controller\ControllerAPI.h" />
|
||||
<ClInclude Include="Controller\ControllerFactory.h" />
|
||||
<ClInclude Include="Controller\ControlScaleProxy.h" />
|
||||
<ClCompile Include="Config\Roguelike\RoguelikeCiphertextBoardConfig.cpp" />
|
||||
<ClCompile Include="Config\Roguelike\RoguelikeFoldartalConfig.cpp" />
|
||||
<ClCompile Include="Controller\MaaThriftController.h" />
|
||||
<ClInclude Include="Controller\MaatouchController.h" />
|
||||
<ClInclude Include="Controller\MinitouchController.h" />
|
||||
@@ -88,8 +88,8 @@
|
||||
<ClInclude Include="Task\BattleHelper.h" />
|
||||
<ClInclude Include="Task\Interface\SingleStepTask.h" />
|
||||
<ClInclude Include="Task\Interface\SSSCopilotTask.h" />
|
||||
<ClInclude Include="Task\Roguelike\RoguelikeCiphertextBoardGainTaskPlugin.h" />
|
||||
<ClInclude Include="Task\Roguelike\RoguelikeCiphertextBoardUseTaskPlugin.h" />
|
||||
<ClInclude Include="Task\Roguelike\RoguelikeFoldartalGainTaskPlugin.h" />
|
||||
<ClInclude Include="Task\Roguelike\RoguelikeFoldartalUseTaskPlugin.h" />
|
||||
<ClInclude Include="Task\Roguelike\RoguelikeConfig.h" />
|
||||
<ClInclude Include="Task\Roguelike\RoguelikeDifficultySelectionTaskPlugin.h" />
|
||||
<ClInclude Include="Task\Roguelike\RoguelikeLastRewardTaskPlugin.h" />
|
||||
@@ -258,8 +258,8 @@
|
||||
<ClCompile Include="Task\BattleHelper.cpp" />
|
||||
<ClCompile Include="Task\Interface\SingleStepTask.cpp" />
|
||||
<ClCompile Include="Task\Interface\SSSCopilotTask.cpp" />
|
||||
<ClCompile Include="Task\Roguelike\RoguelikeCiphertextBoardGainTaskPlugin.cpp" />
|
||||
<ClCompile Include="Task\Roguelike\RoguelikeCiphertextBoardUseTaskPlugin.cpp" />
|
||||
<ClCompile Include="Task\Roguelike\RoguelikeFoldartalGainTaskPlugin.cpp" />
|
||||
<ClCompile Include="Task\Roguelike\RoguelikeFoldartalUseTaskPlugin.cpp" />
|
||||
<ClCompile Include="Task\Roguelike\RoguelikeConfig.cpp" />
|
||||
<ClCompile Include="Task\Roguelike\RoguelikeDifficultySelectionTaskPlugin.cpp" />
|
||||
<ClCompile Include="Task\Roguelike\RoguelikeLastRewardTaskPlugin.cpp" />
|
||||
|
||||
@@ -216,7 +216,7 @@
|
||||
<ClInclude Include="Config\TemplResource.h">
|
||||
<Filter>Source\Resource</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="Config\Roguelike\RoguelikeCiphertextBoardConfig.h">
|
||||
<ClInclude Include="Config\Roguelike\RoguelikeFoldartalConfig.h">
|
||||
<Filter>Source\Resource\Roguelike</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="Config\Roguelike\RoguelikeCopilotConfig.h">
|
||||
@@ -444,10 +444,10 @@
|
||||
<ClInclude Include="Task\Roguelike\RoguelikeBattleTaskPlugin.h">
|
||||
<Filter>Source\Task\Roguelike</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="Task\Roguelike\RoguelikeCiphertextBoardGainTaskPlugin.h">
|
||||
<ClInclude Include="Task\Roguelike\RoguelikeFoldartalGainTaskPlugin.h">
|
||||
<Filter>Source\Task\Roguelike</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="Task\Roguelike\RoguelikeCiphertextBoardUseTaskPlugin.h">
|
||||
<ClInclude Include="Task\Roguelike\RoguelikeFoldartalUseTaskPlugin.h">
|
||||
<Filter>Source\Task\Roguelike</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="Task\Roguelike\RoguelikeConfig.h">
|
||||
@@ -740,7 +740,7 @@
|
||||
<ClCompile Include="Config\TemplResource.cpp">
|
||||
<Filter>Source\Resource</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="Config\Roguelike\RoguelikeCiphertextBoardConfig.cpp">
|
||||
<ClCompile Include="Config\Roguelike\RoguelikeFoldartalConfig.cpp">
|
||||
<Filter>Source\Resource\Roguelike</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="Config\Roguelike\RoguelikeCopilotConfig.cpp">
|
||||
@@ -917,10 +917,10 @@
|
||||
<ClCompile Include="Task\Roguelike\RoguelikeBattleTaskPlugin.cpp">
|
||||
<Filter>Source\Task\Roguelike</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="Task\Roguelike\RoguelikeCiphertextBoardGainTaskPlugin.cpp">
|
||||
<ClCompile Include="Task\Roguelike\RoguelikeFoldartalGainTaskPlugin.cpp">
|
||||
<Filter>Source\Task\Roguelike</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="Task\Roguelike\RoguelikeCiphertextBoardUseTaskPlugin.cpp">
|
||||
<ClCompile Include="Task\Roguelike\RoguelikeFoldartalUseTaskPlugin.cpp">
|
||||
<Filter>Source\Task\Roguelike</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="Task\Roguelike\RoguelikeConfig.cpp">
|
||||
@@ -1113,4 +1113,4 @@
|
||||
<Filter>Source\Task\Miscellaneous</Filter>
|
||||
</ClCompile>
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
</Project>
|
||||
|
||||
@@ -55,8 +55,8 @@ namespace asst
|
||||
static inline const std::string RoguelikeMode = "RoguelikeMode";
|
||||
static inline const std::string RoguelikeDifficulty = "RoguelikeDifficulty";
|
||||
|
||||
static inline const std::string RoguelikeCiphertextBoardOverview = "RoguelikeCiphertextBoardOverview";
|
||||
static inline const std::string RoguelikeCiphertextBoardFloor = "RoguelikeCiphertextBoardFloor";
|
||||
static inline const std::string RoguelikeFoldartalOverview = "RoguelikeFoldartalOverview";
|
||||
static inline const std::string RoguelikeFoldartalFloor = "RoguelikeFoldartalFloor";
|
||||
|
||||
static inline const std::string ProcessTaskLastTimePrefix = "#LastTime#";
|
||||
|
||||
|
||||
@@ -19,8 +19,8 @@
|
||||
#include "Task/Roguelike/RoguelikeStageEncounterTaskPlugin.h"
|
||||
#include "Task/Roguelike/RoguelikeStrategyChangeTaskPlugin.h"
|
||||
|
||||
#include "Task/Roguelike/RoguelikeCiphertextBoardGainTaskPlugin.h"
|
||||
#include "Task/Roguelike/RoguelikeCiphertextBoardUseTaskPlugin.h"
|
||||
#include "Task/Roguelike/RoguelikeFoldartalGainTaskPlugin.h"
|
||||
#include "Task/Roguelike/RoguelikeFoldartalUseTaskPlugin.h"
|
||||
|
||||
#include "Utils/Logger.hpp"
|
||||
|
||||
@@ -53,9 +53,9 @@ asst::RoguelikeTask::RoguelikeTask(const AsstCallback& callback, Assistant* inst
|
||||
m_difficulty_selection_plugin_ptr = m_roguelike_task_ptr->register_plugin<RoguelikeDifficultySelectionTaskPlugin>();
|
||||
m_strategy_change_plugin_ptr = m_roguelike_task_ptr->register_plugin<RoguelikeStrategyChangeTaskPlugin>();
|
||||
|
||||
m_ciphertext_board_gain_plugin_ptr =
|
||||
m_roguelike_task_ptr->register_plugin<RoguelikeCiphertextBoardGainTaskPlugin>();
|
||||
m_ciphertext_board_use_plugin_ptr = m_roguelike_task_ptr->register_plugin<RoguelikeCiphertextBoardUseTaskPlugin>();
|
||||
m_foldartal_gain_plugin_ptr =
|
||||
m_roguelike_task_ptr->register_plugin<RoguelikeFoldartalGainTaskPlugin>();
|
||||
m_foldartal_use_plugin_ptr = m_roguelike_task_ptr->register_plugin<RoguelikeFoldartalUseTaskPlugin>();
|
||||
|
||||
// 这个任务如果卡住会放弃当前的肉鸽并重新开始,所以多添加一点。先这样凑合用
|
||||
for (int i = 0; i != 100; ++i) {
|
||||
@@ -85,8 +85,8 @@ bool asst::RoguelikeTask::set_params(const json::value& params)
|
||||
}
|
||||
}
|
||||
|
||||
m_ciphertext_board_gain_plugin_ptr->set_roguelike_theme(theme);
|
||||
m_ciphertext_board_use_plugin_ptr->set_roguelike_theme(theme);
|
||||
m_foldartal_gain_plugin_ptr->set_roguelike_theme(theme);
|
||||
m_foldartal_use_plugin_ptr->set_roguelike_theme(theme);
|
||||
|
||||
m_roguelike_task_ptr->set_tasks({ theme + "@Roguelike@Begin" });
|
||||
|
||||
|
||||
@@ -19,8 +19,8 @@ namespace asst
|
||||
class RoguelikeStageEncounterTaskPlugin;
|
||||
class RoguelikeStrategyChangeTaskPlugin;
|
||||
|
||||
class RoguelikeCiphertextBoardGainTaskPlugin;
|
||||
class RoguelikeCiphertextBoardUseTaskPlugin;
|
||||
class RoguelikeFoldartalGainTaskPlugin;
|
||||
class RoguelikeFoldartalUseTaskPlugin;
|
||||
|
||||
class RoguelikeTask : public InterfaceTask
|
||||
{
|
||||
@@ -49,7 +49,7 @@ namespace asst
|
||||
std::shared_ptr<RoguelikeStageEncounterTaskPlugin> m_stage_encounter_plugin_ptr = nullptr;
|
||||
std::shared_ptr<RoguelikeStrategyChangeTaskPlugin> m_strategy_change_plugin_ptr = nullptr;
|
||||
|
||||
std::shared_ptr<RoguelikeCiphertextBoardGainTaskPlugin> m_ciphertext_board_gain_plugin_ptr = nullptr;
|
||||
std::shared_ptr<RoguelikeCiphertextBoardUseTaskPlugin> m_ciphertext_board_use_plugin_ptr = nullptr;
|
||||
std::shared_ptr<RoguelikeFoldartalGainTaskPlugin> m_foldartal_gain_plugin_ptr = nullptr;
|
||||
std::shared_ptr<RoguelikeFoldartalUseTaskPlugin> m_foldartal_use_plugin_ptr = nullptr;
|
||||
};
|
||||
}
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
#include "RoguelikeCiphertextBoardGainTaskPlugin.h"
|
||||
#include "RoguelikeFoldartalGainTaskPlugin.h"
|
||||
|
||||
#include "Controller/Controller.h"
|
||||
#include "Status.h"
|
||||
#include "Utils/Logger.hpp"
|
||||
#include "Vision/OCRer.h"
|
||||
|
||||
bool asst::RoguelikeCiphertextBoardGainTaskPlugin::verify(AsstMsg msg, const json::value& details) const
|
||||
bool asst::RoguelikeFoldartalGainTaskPlugin::verify(AsstMsg msg, const json::value& details) const
|
||||
{
|
||||
if (msg != AsstMsg::SubTaskStart || details.get("subtask", std::string()) != "ProcessTask") {
|
||||
return false;
|
||||
@@ -26,7 +26,7 @@ bool asst::RoguelikeCiphertextBoardGainTaskPlugin::verify(AsstMsg msg, const jso
|
||||
task_view.remove_prefix(roguelike_name.length());
|
||||
}
|
||||
m_ocr_next_level = false;
|
||||
if (task_view == "Roguelike@CiphertextBoardGain") {
|
||||
if (task_view == "Roguelike@FoldartalGain") {
|
||||
m_ocr_after_combat = false;
|
||||
return true;
|
||||
}
|
||||
@@ -52,7 +52,7 @@ bool asst::RoguelikeCiphertextBoardGainTaskPlugin::verify(AsstMsg msg, const jso
|
||||
}
|
||||
}
|
||||
|
||||
bool asst::RoguelikeCiphertextBoardGainTaskPlugin::_run()
|
||||
bool asst::RoguelikeFoldartalGainTaskPlugin::_run()
|
||||
{
|
||||
LogTraceFunction;
|
||||
|
||||
@@ -62,38 +62,38 @@ bool asst::RoguelikeCiphertextBoardGainTaskPlugin::_run()
|
||||
auto image = ctrler()->get_image();
|
||||
|
||||
OCRer analyzer(image);
|
||||
std::string ciphertext_board = "None";
|
||||
std::string foldartal = "None";
|
||||
if (m_ocr_next_level) {
|
||||
analyzer.set_task_info(theme + "@Roguelike@CiphertextBoardGainOcrNextLevel");
|
||||
analyzer.set_task_info(theme + "@Roguelike@FoldartalGainOcrNextLevel");
|
||||
if (analyzer.analyze()) {
|
||||
ciphertext_board = analyzer.get_result().front().text;
|
||||
foldartal = analyzer.get_result().front().text;
|
||||
}
|
||||
store_to_status(ciphertext_board, Status::RoguelikeCiphertextBoardFloor);
|
||||
json::array ciphertext_board_floor_array = get_array(Status::RoguelikeCiphertextBoardFloor);
|
||||
store_to_status(foldartal, Status::RoguelikeFoldartalFloor);
|
||||
json::array foldartal_floor_array = get_array(Status::RoguelikeFoldartalFloor);
|
||||
// 到达第二层后,获得上一层预见的密文板
|
||||
if (ciphertext_board_floor_array.size() >= 2) {
|
||||
std::string ciphertext_board_last_floor = (ciphertext_board_floor_array.end() - 2)->to_string();
|
||||
if (ciphertext_board_last_floor.size() >= 2 && ciphertext_board_last_floor.front() == '"' &&
|
||||
ciphertext_board_last_floor.back() == '"') {
|
||||
ciphertext_board_last_floor =
|
||||
ciphertext_board_last_floor.substr(1, ciphertext_board_last_floor.size() - 2);
|
||||
if (foldartal_floor_array.size() >= 2) {
|
||||
std::string foldartal_last_floor = (foldartal_floor_array.end() - 2)->to_string();
|
||||
if (foldartal_last_floor.size() >= 2 && foldartal_last_floor.front() == '"' &&
|
||||
foldartal_last_floor.back() == '"') {
|
||||
foldartal_last_floor =
|
||||
foldartal_last_floor.substr(1, foldartal_last_floor.size() - 2);
|
||||
}
|
||||
if (ciphertext_board_last_floor != "None") {
|
||||
store_to_status(ciphertext_board_last_floor, Status::RoguelikeCiphertextBoardOverview);
|
||||
if (foldartal_last_floor != "None") {
|
||||
store_to_status(foldartal_last_floor, Status::RoguelikeFoldartalOverview);
|
||||
}
|
||||
}
|
||||
return true;
|
||||
};
|
||||
|
||||
std::string task_name = m_ocr_after_combat ? theme + "@Roguelike@CiphertextBoardGainOcrAfterCombat"
|
||||
: theme + "@Roguelike@CiphertextBoardGainOcr";
|
||||
std::string task_name = m_ocr_after_combat ? theme + "@Roguelike@FoldartalGainOcrAfterCombat"
|
||||
: theme + "@Roguelike@FoldartalGainOcr";
|
||||
analyzer.set_task_info(task_name);
|
||||
|
||||
if (!analyzer.analyze()) {
|
||||
return false;
|
||||
}
|
||||
ciphertext_board = analyzer.get_result().front().text;
|
||||
store_to_status(ciphertext_board, Status::RoguelikeCiphertextBoardOverview);
|
||||
foldartal = analyzer.get_result().front().text;
|
||||
store_to_status(foldartal, Status::RoguelikeFoldartalOverview);
|
||||
if (m_ocr_after_combat) {
|
||||
ctrler()->click(analyzer.get_result().front().rect);
|
||||
}
|
||||
@@ -101,15 +101,15 @@ bool asst::RoguelikeCiphertextBoardGainTaskPlugin::_run()
|
||||
return true;
|
||||
}
|
||||
|
||||
bool asst::RoguelikeCiphertextBoardGainTaskPlugin::store_to_status(std::string ciphertext_board, auto& status_string)
|
||||
bool asst::RoguelikeFoldartalGainTaskPlugin::store_to_status(std::string foldartal, auto& status_string)
|
||||
{
|
||||
json::array overview = get_array(status_string);
|
||||
overview.emplace_back(ciphertext_board);
|
||||
overview.emplace_back(foldartal);
|
||||
status()->set_str(status_string, overview.to_string());
|
||||
return true;
|
||||
}
|
||||
|
||||
json::array asst::RoguelikeCiphertextBoardGainTaskPlugin::get_array(auto& status_string)
|
||||
json::array asst::RoguelikeFoldartalGainTaskPlugin::get_array(auto& status_string)
|
||||
{
|
||||
std::string overview_str = status()->get_str(status_string).value_or(json::value().to_string());
|
||||
json::value overview_json = json::parse(overview_str).value_or(json::value());
|
||||
@@ -4,11 +4,11 @@
|
||||
|
||||
namespace asst
|
||||
{
|
||||
class RoguelikeCiphertextBoardGainTaskPlugin : public AbstractTaskPlugin, public RoguelikeConfig
|
||||
class RoguelikeFoldartalGainTaskPlugin : public AbstractTaskPlugin, public RoguelikeConfig
|
||||
{
|
||||
public:
|
||||
using AbstractTaskPlugin::AbstractTaskPlugin;
|
||||
virtual ~RoguelikeCiphertextBoardGainTaskPlugin() override = default;
|
||||
virtual ~RoguelikeFoldartalGainTaskPlugin() override = default;
|
||||
|
||||
public:
|
||||
virtual bool verify(AsstMsg msg, const json::value& details) const override;
|
||||
@@ -18,7 +18,7 @@ namespace asst
|
||||
|
||||
private:
|
||||
json::array get_array(auto& status_string);
|
||||
bool store_to_status(std::string ciphertext_board, auto& status_string);
|
||||
bool store_to_status(std::string foldartal, auto& status_string);
|
||||
// 战斗后识别密文板
|
||||
mutable bool m_ocr_after_combat = false;
|
||||
// 进入新一层后识别密文板
|
||||
@@ -1,6 +1,6 @@
|
||||
#include "RoguelikeCiphertextBoardUseTaskPlugin.h"
|
||||
#include "RoguelikeFoldartalUseTaskPlugin.h"
|
||||
|
||||
#include "Config/Roguelike/RoguelikeCiphertextBoardConfig.h"
|
||||
#include "Config/Roguelike/RoguelikeFoldartalConfig.h"
|
||||
#include "Config/TaskData.h"
|
||||
#include "Controller/Controller.h"
|
||||
#include "Status.h"
|
||||
@@ -8,7 +8,7 @@
|
||||
#include "Utils/Logger.hpp"
|
||||
#include "Vision/OCRer.h"
|
||||
|
||||
bool asst::RoguelikeCiphertextBoardUseTaskPlugin::verify(AsstMsg msg, const json::value& details) const
|
||||
bool asst::RoguelikeFoldartalUseTaskPlugin::verify(AsstMsg msg, const json::value& details) const
|
||||
{
|
||||
if (msg != AsstMsg::SubTaskStart || details.get("subtask", std::string()) != "ProcessTask") {
|
||||
return false;
|
||||
@@ -69,17 +69,17 @@ bool asst::RoguelikeCiphertextBoardUseTaskPlugin::verify(AsstMsg msg, const json
|
||||
}
|
||||
}
|
||||
|
||||
bool asst::RoguelikeCiphertextBoardUseTaskPlugin::_run()
|
||||
bool asst::RoguelikeFoldartalUseTaskPlugin::_run()
|
||||
{
|
||||
LogTraceFunction;
|
||||
|
||||
std::string theme = m_roguelike_theme;
|
||||
|
||||
std::vector<RoguelikeCiphertextBoardCombination> combination =
|
||||
RoguelikeCiphertextBoard.get_combination(m_roguelike_theme);
|
||||
std::vector<RoguelikeFoldartalCombination> combination =
|
||||
RoguelikeFoldartal.get_combination(m_roguelike_theme);
|
||||
|
||||
std::string overview_str =
|
||||
status()->get_str(Status::RoguelikeCiphertextBoardOverview).value_or(json::value().to_string());
|
||||
status()->get_str(Status::RoguelikeFoldartalOverview).value_or(json::value().to_string());
|
||||
json::value overview_json = json::parse(overview_str).value_or(json::value());
|
||||
m_all_boards = overview_json.as_array();
|
||||
Log.debug(m_all_boards);
|
||||
@@ -99,7 +99,7 @@ bool asst::RoguelikeCiphertextBoardUseTaskPlugin::_run()
|
||||
return true;
|
||||
}
|
||||
|
||||
bool asst::RoguelikeCiphertextBoardUseTaskPlugin::search_enable_pair(const auto& usage)
|
||||
bool asst::RoguelikeFoldartalUseTaskPlugin::search_enable_pair(const auto& usage)
|
||||
{
|
||||
LogTraceFunction;
|
||||
|
||||
@@ -116,7 +116,7 @@ bool asst::RoguelikeCiphertextBoardUseTaskPlugin::search_enable_pair(const auto&
|
||||
return false;
|
||||
}
|
||||
|
||||
bool asst::RoguelikeCiphertextBoardUseTaskPlugin::board_pair(const std::string& up_board, const std::string& down_board)
|
||||
bool asst::RoguelikeFoldartalUseTaskPlugin::board_pair(const std::string& up_board, const std::string& down_board)
|
||||
{
|
||||
|
||||
auto iter_up = std::find(m_all_boards.begin(), m_all_boards.end(), up_board);
|
||||
@@ -128,7 +128,7 @@ bool asst::RoguelikeCiphertextBoardUseTaskPlugin::board_pair(const std::string&
|
||||
m_all_boards.erase(iter_up);
|
||||
iter_down = std::find(m_all_boards.begin(), m_all_boards.end(), down_board);
|
||||
m_all_boards.erase(iter_down);
|
||||
status()->set_str(Status::RoguelikeCiphertextBoardOverview, m_all_boards.to_string());
|
||||
status()->set_str(Status::RoguelikeFoldartalOverview, m_all_boards.to_string());
|
||||
Log.debug("Board pair used");
|
||||
return true;
|
||||
}
|
||||
@@ -136,25 +136,25 @@ bool asst::RoguelikeCiphertextBoardUseTaskPlugin::board_pair(const std::string&
|
||||
return false;
|
||||
}
|
||||
|
||||
bool asst::RoguelikeCiphertextBoardUseTaskPlugin::use_board(const std::string& up_board, const std::string& down_board)
|
||||
bool asst::RoguelikeFoldartalUseTaskPlugin::use_board(const std::string& up_board, const std::string& down_board)
|
||||
{
|
||||
Log.trace("Try to use the board pair", up_board, down_board);
|
||||
|
||||
if (ProcessTask(*this, { m_roguelike_theme + "@Roguelike@CiphertextBoard" }).run()) {
|
||||
if (ProcessTask(*this, { m_roguelike_theme + "@Roguelike@Foldartal" }).run()) {
|
||||
swipe_to_top();
|
||||
// todo:插入一个滑动时顺便更新密文板overview,因为有的板子可以用两次
|
||||
if (search_and_click_board(up_board) && search_and_click_board(down_board)) {
|
||||
search_and_click_stage();
|
||||
if (ProcessTask(*this, { m_roguelike_theme + "@Roguelike@CiphertextBoardUseConfirm" }).run()) {
|
||||
if (ProcessTask(*this, { m_roguelike_theme + "@Roguelike@FoldartalUseConfirm" }).run()) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
ProcessTask(*this, { m_roguelike_theme + "@Roguelike@CiphertextBoardBack" }).run();
|
||||
ProcessTask(*this, { m_roguelike_theme + "@Roguelike@FoldartalBack" }).run();
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
bool asst::RoguelikeCiphertextBoardUseTaskPlugin::search_and_click_board(const std::string& board)
|
||||
bool asst::RoguelikeFoldartalUseTaskPlugin::search_and_click_board(const std::string& board)
|
||||
{
|
||||
Log.trace("Search and click the board", board);
|
||||
|
||||
@@ -162,7 +162,7 @@ bool asst::RoguelikeCiphertextBoardUseTaskPlugin::search_and_click_board(const s
|
||||
int try_time = 0;
|
||||
while (try_time < max_retry && !need_exit()) {
|
||||
OCRer analyzer(ctrler()->get_image());
|
||||
std::string task_name = m_roguelike_theme + "@Roguelike@CiphertextBoardUseOcr";
|
||||
std::string task_name = m_roguelike_theme + "@Roguelike@FoldartalUseOcr";
|
||||
analyzer.set_task_info(task_name);
|
||||
analyzer.set_required({ board });
|
||||
if (!analyzer.analyze()) {
|
||||
@@ -178,7 +178,7 @@ bool asst::RoguelikeCiphertextBoardUseTaskPlugin::search_and_click_board(const s
|
||||
return false;
|
||||
}
|
||||
|
||||
bool asst::RoguelikeCiphertextBoardUseTaskPlugin::search_and_click_stage()
|
||||
bool asst::RoguelikeFoldartalUseTaskPlugin::search_and_click_stage()
|
||||
{
|
||||
Log.trace("Try to click stage", m_stage);
|
||||
// todo:根据坐标换算位置,根据节点类型设置识别优先度
|
||||
@@ -188,19 +188,19 @@ bool asst::RoguelikeCiphertextBoardUseTaskPlugin::search_and_click_stage()
|
||||
sleep(1000);
|
||||
|
||||
// 节点会闪烁,所以这里不用单次Match
|
||||
if (ProcessTask(*this, { m_roguelike_theme + "@Roguelike@CiphertextBoardUseOnStage" }).run()) {
|
||||
if (ProcessTask(*this, { m_roguelike_theme + "@Roguelike@FoldartalUseOnStage" }).run()) {
|
||||
return true;
|
||||
}
|
||||
// 滑到最右边,萨米的地图只有两页,暂时先这么糊着,出现识别不到再写循环
|
||||
ProcessTask(*this, { "SwipeToTheRight" }).run();
|
||||
sleep(1000);
|
||||
if (ProcessTask(*this, { m_roguelike_theme + "@Roguelike@CiphertextBoardUseOnStage" }).run()) {
|
||||
if (ProcessTask(*this, { m_roguelike_theme + "@Roguelike@FoldartalUseOnStage" }).run()) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
void asst::RoguelikeCiphertextBoardUseTaskPlugin::swipe_to_top()
|
||||
void asst::RoguelikeFoldartalUseTaskPlugin::swipe_to_top()
|
||||
{
|
||||
LogTraceFunction;
|
||||
|
||||
@@ -210,23 +210,23 @@ void asst::RoguelikeCiphertextBoardUseTaskPlugin::swipe_to_top()
|
||||
while (try_time < max_retry && !need_exit()) {
|
||||
while (try_time < max_retry && !need_exit()) {
|
||||
OCRer analyzer(ctrler()->get_image());
|
||||
analyzer.set_task_info(m_roguelike_theme + "@Roguelike@CiphertextBoardUseOcr");
|
||||
analyzer.set_task_info(m_roguelike_theme + "@Roguelike@FoldartalUseOcr");
|
||||
if (analyzer.analyze()) {
|
||||
return;
|
||||
}
|
||||
else {
|
||||
// 往下滑
|
||||
ProcessTask(*this, { "RoguelikeCiphertextBoardSwipeToTheDown" }).run();
|
||||
ProcessTask(*this, { "RoguelikeFoldartalSwipeToTheDown" }).run();
|
||||
}
|
||||
try_time++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void asst::RoguelikeCiphertextBoardUseTaskPlugin::slowly_swipe(bool to_up, int swipe_dist)
|
||||
void asst::RoguelikeFoldartalUseTaskPlugin::slowly_swipe(bool to_up, int swipe_dist)
|
||||
{
|
||||
std::string swipe_task_name =
|
||||
to_up ? "RoguelikeCiphertextBoardSlowlySwipeToTheUp" : "RoguelikeCiphertextBoardSwipeToTheDown";
|
||||
to_up ? "RoguelikeFoldartalSlowlySwipeToTheUp" : "RoguelikeFoldartalSwipeToTheDown";
|
||||
if (!ControlFeat::support(ctrler()->support_features(),
|
||||
ControlFeat::PRECISE_SWIPE)) { // 不能精准滑动时不使用 swipe_dist 参数
|
||||
ProcessTask(*this, { swipe_task_name }).run();
|
||||
@@ -4,11 +4,11 @@
|
||||
|
||||
namespace asst
|
||||
{
|
||||
class RoguelikeCiphertextBoardUseTaskPlugin : public AbstractTaskPlugin, public RoguelikeConfig
|
||||
class RoguelikeFoldartalUseTaskPlugin : public AbstractTaskPlugin, public RoguelikeConfig
|
||||
{
|
||||
public:
|
||||
using AbstractTaskPlugin::AbstractTaskPlugin;
|
||||
virtual ~RoguelikeCiphertextBoardUseTaskPlugin() override = default;
|
||||
virtual ~RoguelikeFoldartalUseTaskPlugin() override = default;
|
||||
|
||||
public:
|
||||
virtual bool verify(AsstMsg msg, const json::value& details) const override;
|
||||
@@ -105,8 +105,8 @@ bool asst::RoguelikeShoppingTaskPlugin::_run()
|
||||
|
||||
bool bought = false;
|
||||
auto& all_goods = RoguelikeShopping.get_goods(m_roguelike_theme);
|
||||
std::vector<std::string> all_ciphertext_board =
|
||||
m_roguelike_theme == "Sami" ? Task.get<OcrTaskInfo>("Sami@Roguelike@CiphertextBoardGainOcr")->text
|
||||
std::vector<std::string> all_foldartal =
|
||||
m_roguelike_theme == "Sami" ? Task.get<OcrTaskInfo>("Sami@Roguelike@FoldartalGainOcr")->text
|
||||
: std::vector<std::string>();
|
||||
for (const auto& goods : all_goods) {
|
||||
if (need_exit()) {
|
||||
@@ -172,15 +172,15 @@ bool asst::RoguelikeShoppingTaskPlugin::_run()
|
||||
bought = true;
|
||||
if (m_roguelike_theme == "Sami") {
|
||||
|
||||
auto iter = std::find(all_ciphertext_board.begin(), all_ciphertext_board.end(), goods.name);
|
||||
if (iter != all_ciphertext_board.end()) {
|
||||
auto iter = std::find(all_foldartal.begin(), all_foldartal.end(), goods.name);
|
||||
if (iter != all_foldartal.end()) {
|
||||
std::string overview_str =
|
||||
status()->get_str(Status::RoguelikeCiphertextBoardOverview).value_or(json::value().to_string());
|
||||
status()->get_str(Status::RoguelikeFoldartalOverview).value_or(json::value().to_string());
|
||||
|
||||
auto& overview = json::parse(overview_str).value_or(json::value()).as_array();
|
||||
// 把goods.name存到密文板overview里
|
||||
overview.push_back(goods.name);
|
||||
status()->set_str(Status::RoguelikeCiphertextBoardOverview, overview.to_string());
|
||||
status()->set_str(Status::RoguelikeFoldartalOverview, overview.to_string());
|
||||
}
|
||||
}
|
||||
if (goods.no_longer_buy) {
|
||||
|
||||