fix: 修复了召唤物识别错误的问题

This commit is contained in:
DavidWang19
2022-10-08 17:53:06 +01:00
committed by zzyyyl
parent c2c402a290
commit a21812a676
2 changed files with 11 additions and 3 deletions

View File

@@ -6078,6 +6078,10 @@
"template": "empty.png",
"templThreshold": 0.6
},
"DiceAvatarMatch": {
"template": "empty.png",
"templThreshold": 0.8
},
"BattleKillsFlag": {
"roi": [
150,
@@ -8995,4 +8999,4 @@
138
]
}
}
}

View File

@@ -294,17 +294,21 @@ bool asst::RoguelikeBattleTaskPlugin::auto_battle()
const auto use_oper_task_ptr = Task.get("BattleUseOper");
bool has_dice = false;
BattleRealTimeOper dice;
for (auto& oper : opers) {
for (const auto& oper : opers) {
if (oper.cooling) cooling_count++;
if (oper.available) available_count++;
}
for (auto& oper : opers) {
if (oper.role == BattleRole::Drone) {
if (!m_dice_image.empty()) {
MatchImageAnalyzer dice_analyzer(image);
MatchImageAnalyzer dice_analyzer(oper.avatar);
dice_analyzer.set_task_info("DiceAvatarMatch");
dice_analyzer.set_templ(m_dice_image);
if (dice_analyzer.analyze()) {
has_dice = true;
oper.name = "骰子";
dice = oper;
break;
}
}
}