This commit is contained in:
status102
2025-02-06 11:28:21 +08:00
parent 4a007f497c
commit 9b8f92f0f7
9 changed files with 8 additions and 85 deletions

View File

@@ -26,29 +26,6 @@ public:
const auto& get_event_names(const std::string& theme) const noexcept { return m_event_names.at(theme); }
bool set_event(std::string theme, RoguelikeMode mode, std::string event_name, int choose, int option_num)
{
std::pair<std::string, int> key = std::make_pair(theme, static_cast<int>(mode));
if (theme == "Sarkaz" || theme == "Sami") {
// 在调试器里发现 m_events 中Sami 和 Sarkaz 的 mode 只有 -1
key.second = -1;
}
// 边界检查
auto outerIt = m_events.find(key);
if (outerIt == m_events.end()) {
return false;
}
auto& innerMap = outerIt->second;
auto innerIt = innerMap.find(event_name);
if (innerIt == innerMap.end()) {
return false;
}
// 修改事件选择
m_events[key][event_name].default_choose = choose;
m_events[key][event_name].option_num = option_num;
return true;
}
enum class ComparisonType
{
GreaterThan,

View File

@@ -12,7 +12,7 @@
#include "Vision/Miscellaneous/BrightPointAnalyzer.h"
#include "Vision/MultiMatcher.h"
bool asst::RoguelikeRoutingTaskPlugin::load_params(const json::value& params)
bool asst::RoguelikeRoutingTaskPlugin::load_params([[maybe_unused]] const json::value& params)
{
const std::string& theme = m_config->get_theme();
@@ -36,8 +36,7 @@ bool asst::RoguelikeRoutingTaskPlugin::load_params(const json::value& params)
const RoguelikeMode& mode = m_config->get_mode();
const std::string squad = params.get("squad", "");
if (mode == RoguelikeMode::Investment &&
(squad == "点刺成锭分队" || (squad == "后勤分队" && params.get("start_with_seed", false)))) {
if (mode == RoguelikeMode::Investment && squad == "点刺成锭分队") {
m_routing_strategy = RoutingStrategy::FastInvestment;
return true;
}

View File

@@ -36,7 +36,6 @@ bool asst::RoguelikeConfig::verify_and_load_params(const json::value& params)
}
}
m_start_with_seed = params.get("start_with_seed", false);
m_start_with_elite_two = params.get("start_with_elite_two", false);
m_only_start_with_elite_two = params.get("only_start_with_elite_two", false);
if (mode != RoguelikeMode::Collectible && (m_start_with_elite_two || m_only_start_with_elite_two)) {
@@ -61,13 +60,9 @@ bool asst::RoguelikeConfig::verify_and_load_params(const json::value& params)
// 点刺成锭分队特殊策略
if (m_theme == "Sarkaz") {
auto squad = params.get("squad", "");
if (m_mode == RoguelikeMode::Investment &&
(squad == "点刺成锭分队" || (squad == "后勤分队" && m_start_with_seed))) {
if (squad == "点刺成锭分队") {
// 启用特殊策略,联动 RoguelikeRoutingTaskPlugin
Task.set_task_base(strategy_task, "Sarkaz@Roguelike@StrategyChange-FastInvestment");
}
if (m_mode == RoguelikeMode::Investment && params.get("squad", "") == "点刺成锭分队") {
// 启用特殊策略,联动 RoguelikeRoutingTaskPlugin
Task.set_task_base(strategy_task, "Sarkaz@Roguelike@StrategyChange-FastInvestment");
// 禁用前 2 层的 <思维负荷干员编队> 功能
Task.set_task_base(
"Sarkaz@Roguelike@StageBurdenOperation",

View File

@@ -158,13 +158,6 @@ private:
// ------------------ 密文板 ------------------
bool m_first_floor_foldartal = false; // 凹远见密文板
// =========================== 萨卡兹主题专用参数 ===========================
public:
bool get_start_with_seed() const { return m_start_with_seed; }
private:
bool m_start_with_seed = false; // 种子刷钱
// ================================================================================
// 以下为局内数据,每次重置
// ================================================================================

View File

@@ -72,14 +72,6 @@ bool asst::RoguelikeCustomStartTaskPlugin::load_params(const json::value& params
m_collectible_mode_squad = params.get("collectible_mode_squad", m_squad);
}
if (m_config->get_mode() == RoguelikeMode::Investment &&
params.get("start_with_seed", false)) { // 种子刷钱,强制随心所欲
set_custom(RoguelikeCustomType::Roles, "随心所欲");
}
else {
set_custom(RoguelikeCustomType::Roles, params.get("roles", "")); // 开局职业组
}
set_custom(RoguelikeCustomType::CoreChar, params.get("core_char", "")); // 开局干员名
m_config->set_use_support(params.get("use_support", false)); // 开局干员是否为助战干员
m_config->set_use_nonfriend_support(params.get("use_nonfriend_support", false)); // 是否可以是非好友助战干员
@@ -128,8 +120,6 @@ bool asst::RoguelikeCustomStartTaskPlugin::_run()
bool asst::RoguelikeCustomStartTaskPlugin::hijack_squad()
{
LogTraceFunction;
std::string squad = !m_config->get_run_for_collectible() ? m_squad : m_collectible_mode_squad;
if (squad.empty()) { // 简单处理,认为指挥分队无需滑屏,没有就随机
return ProcessTask(
@@ -195,8 +185,6 @@ bool asst::RoguelikeCustomStartTaskPlugin::hijack_reward()
bool asst::RoguelikeCustomStartTaskPlugin::hijack_roles()
{
LogTraceFunction;
auto image = ctrler()->get_image();
OCRer analyzer(image);
analyzer.set_task_info("RoguelikeCustom-HijackRoles");
@@ -212,25 +200,6 @@ bool asst::RoguelikeCustomStartTaskPlugin::hijack_roles()
bool asst::RoguelikeCustomStartTaskPlugin::hijack_core_char()
{
LogTraceFunction;
if (m_config->get_start_with_seed()) {
Log.trace("Start with seed");
auto image = ctrler()->get_image();
OCRer analyzer(image);
analyzer.set_task_info("RoguelikeCustom-HijackCoChar");
analyzer.set_roi({ 186, 500, 913, 200 });
analyzer.set_required({ "招募" });
if (!analyzer.analyze()) {
return false;
}
const auto& role_rect = analyzer.get_result().front().rect;
ctrler()->click(role_rect);
m_config->set_core_char(m_customs[RoguelikeCustomType::CoreChar]);
return true;
}
const std::string& char_name = m_customs[RoguelikeCustomType::CoreChar];
static const std::unordered_map<battle::Role, std::string> RoleOcrNameMap = {

View File

@@ -6,11 +6,6 @@
bool asst::RoguelikeInputSeedTaskPlugin::load_params([[maybe_unused]] const json::value& params)
{
// 萨卡兹种子刷钱
if (m_config->get_theme() == RoguelikeTheme::Sarkaz && params.get("start_with_seed", false)) {
RoguelikeStageEncounter.set_event(m_config->get_theme(), m_config->get_mode(), "相遇", 3, 4);
return true;
}
return false;
}

View File

@@ -71,8 +71,7 @@ bool asst::RoguelikeRecruitTaskPlugin::_run()
++m_recruit_count;
if (m_config->get_theme() == RoguelikeTheme::Sarkaz && m_config->get_mode() == RoguelikeMode::Investment &&
(m_config->get_squad() == "点刺成锭分队" ||
(m_config->get_squad() == "后勤分队" && m_config->get_start_with_seed()))) {
m_config->get_squad() == "点刺成锭分队") {
ProcessTask(*this, { "Sarkaz@RoguelikeRecruit-GiveUp" }).run();
return true;
}

View File

@@ -2555,10 +2555,6 @@ namespace MaaWpfGui.Main
taskParams["stop_at_final_boss"] = stopAtFinalBoss;
taskParams["stop_at_max_level"] = stopAtMaxLevel;
}
else if (mode == 1)
{
taskParams["start_with_seed"] = startWithSeed;
}
else if (mode == 4)
{
// 刷开局模式

View File

@@ -275,7 +275,7 @@
Text="{DynamicResource RoguelikeStopAtMaxLevel}"
TextWrapping="Wrap" />
</CheckBox>
<CheckBox
<!--<CheckBox
Margin="0,10"
IsChecked="{Binding RoguelikeStartWithSeedRaw}"
Visibility="{c:Binding 'RoguelikeMode == 1 and RoguelikeTheme == task:RoguelikeTheme.Sarkaz and (RoguelikeSquad == &quot;点刺成锭分队&quot; or RoguelikeSquad == &quot;后勤分队&quot;)'}">
@@ -283,7 +283,7 @@
Block.TextAlignment="Left"
Text="{DynamicResource RoguelikeStartWithSeed}"
TextWrapping="Wrap" />
</CheckBox>
</CheckBox>-->
</StackPanel>
</StackPanel>
</UserControl>