fix: 修复一些自动战斗的bug

This commit is contained in:
MistEO
2022-11-20 05:22:07 +08:00
parent 22d89dd992
commit b4b5faf2ba
3 changed files with 9 additions and 14 deletions

View File

@@ -6248,7 +6248,7 @@
"BattleOperCooling": {
"template": "empty.png",
"specialParams": [
1000
1500
],
"specialParams_Doc": "这个任务中作为符合range的像素点数量阈值",
"rectMove": [

View File

@@ -362,7 +362,6 @@ bool asst::BattleProcessTask::do_action(size_t action_index)
return false;
}
const auto& next_action = m_copilot_data.actions.at(action_index + 1);
m_in_bullet_time = true;
if (next_action.type == BattleActionType::Deploy) {
ret = oper_deploy(next_action, true);
}
@@ -377,6 +376,7 @@ bool asst::BattleProcessTask::do_action(size_t action_index)
Log.error("Bullte time 's next step is not deploy, skill or retreat!");
return false;
}
m_in_bullet_time = true;
} break;
case BattleActionType::SkillUsage: {
auto& oper_info = m_group_to_oper_mapping[action.group_name];

View File

@@ -213,7 +213,6 @@ namespace MeoAsstGui
}
private string _curStageName = string.Empty;
private string _curCopilotData = string.Empty;
private bool _isDataFromWeb = false;
private const string TempCopilotFile = "resource/_temp_copilot.json";
@@ -221,7 +220,6 @@ namespace MeoAsstGui
{
try
{
_curCopilotData = string.Empty;
var json = (JObject)JsonConvert.DeserializeObject(jsonStr);
if (json == null)
{
@@ -312,7 +310,12 @@ namespace MeoAsstGui
AddLog(string.Format("共 {0} 名干员", count), UILogColor.Message);
_curStageName = json["stage_name"].ToString();
_curCopilotData = json.ToString();
if (_isDataFromWeb)
{
File.Delete(TempCopilotFile);
File.WriteAllText(TempCopilotFile, json.ToString());
}
AddLog(
"\n\n" +
Localization.GetString("CopilotTip") + "\n\n" +
@@ -419,15 +422,7 @@ namespace MeoAsstGui
AddLog(errMsg, UILogColor.Error);
}
if (!_isDataFromWeb)
{
UpdateFileDoc(Filename);
}
File.Delete(TempCopilotFile);
File.WriteAllText(TempCopilotFile, _curCopilotData);
bool ret = asstProxy.AsstStartCopilot(_curStageName, TempCopilotFile, Form);
bool ret = asstProxy.AsstStartCopilot(_curStageName, _isDataFromWeb ? TempCopilotFile : Filename, Form);
if (ret)
{
AddLog("Star Burst Stream!");