mirror of
https://github.com/MaaAssistantArknights/MaaAssistantArknights.git
synced 2026-07-18 18:20:39 +08:00
feat(MaaCore): Copilot支持切换技能用法使用坐标 (#14818)
* feat: 支持切换技能用法使用坐标 * chore: Auto update by pre-commit hooks [skip changelog] * fix: usage * fix: const ref * perf: capture * fix: case define --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
This commit is contained in:
@@ -247,13 +247,36 @@ bool asst::BattleProcessTask::do_action(const battle::copilot::Action& action, s
|
||||
}
|
||||
break;
|
||||
|
||||
case ActionType::SkillUsage:
|
||||
m_skill_usage[name] = action.modify_usage;
|
||||
if (action.modify_usage == SkillUsage::Times) {
|
||||
m_skill_times[name] = action.modify_times;
|
||||
{
|
||||
case ActionType::SkillUsage:
|
||||
const auto set_usage = [this](const std::string& name, SkillUsage usage, int times) {
|
||||
m_skill_usage[name] = usage;
|
||||
if (usage == SkillUsage::Times) {
|
||||
m_skill_times[name] = times;
|
||||
}
|
||||
};
|
||||
if (!location.empty()) {
|
||||
std::string drone_name;
|
||||
if (!name.empty()) {
|
||||
LogWarn << "Both name and location are set for SkillUsage action. Skip this step.";
|
||||
break;
|
||||
}
|
||||
if (auto it = m_used_tiles.find(location); it == m_used_tiles.end()) {
|
||||
LogInfo << "Tile hasn't used, register for drone" << location;
|
||||
drone_name = std::format("drone_{}_{}", location.x, location.y);
|
||||
register_deployed_oper(drone_name, location);
|
||||
}
|
||||
else {
|
||||
drone_name = it->second;
|
||||
}
|
||||
set_usage(drone_name, action.modify_usage, action.modify_times);
|
||||
}
|
||||
else {
|
||||
set_usage(name, action.modify_usage, action.modify_times);
|
||||
}
|
||||
ret = true;
|
||||
break;
|
||||
}
|
||||
ret = true;
|
||||
break;
|
||||
|
||||
case ActionType::Output:
|
||||
// DoNothing
|
||||
|
||||
Reference in New Issue
Block a user