Skip to content

Commit

Permalink
fix: 修复刷理智-SS复刻模式下无法使用理智药
Browse files Browse the repository at this point in the history
  • Loading branch information
status102 committed Dec 22, 2023
1 parent a8031de commit 607d0f9
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 8 deletions.
16 changes: 9 additions & 7 deletions src/MaaCore/Task/Interface/FightTask.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,8 @@ asst::FightTask::FightTask(const AsstCallback& callback, Assistant* inst)
m_dr_grandet_task_plugin_ptr->set_enable(false);
m_fight_task_ptr->register_plugin<SanityBeforeStagePlugin>();
m_fight_task_ptr->register_plugin<FightTimesPlugin>();
m_medicine_plugin = m_fight_task_ptr->register_plugin<MedicineCounterPlugin>();
m_medicine_plugin_ptr = m_fight_task_ptr->register_plugin<MedicineCounterPlugin>();
m_sidestory_reopen_medicine_plugin_ptr = m_sidestory_reopen_task_ptr->register_plugin<MedicineCounterPlugin>();

m_subtasks.emplace_back(m_start_up_task_ptr);
m_subtasks.emplace_back(m_stage_navigation_task_ptr);
Expand Down Expand Up @@ -116,14 +117,15 @@ bool asst::FightTask::set_params(const json::value& params)
m_stage_drops_plugin_ptr->set_server(server);
}

m_fight_task_ptr->set_times_limit("MedicineConfirm", medicine)
.set_times_limit("ExpiringMedicineConfirm", expiring_medicine)
.set_times_limit("StoneConfirm", stone)
m_fight_task_ptr->set_times_limit("StoneConfirm", stone)
.set_times_limit("StartButton1", times)
.set_times_limit("StartButton2", times);
m_medicine_plugin->set_count(medicine);
m_medicine_plugin->set_use_expiring(expiring_medicine != 0);
m_medicine_plugin->set_dr_grandet(is_dr_grandet);
m_medicine_plugin_ptr->set_count(medicine);
m_medicine_plugin_ptr->set_use_expiring(expiring_medicine != 0);
m_medicine_plugin_ptr->set_dr_grandet(is_dr_grandet);
m_sidestory_reopen_medicine_plugin_ptr->set_count(medicine);
m_sidestory_reopen_medicine_plugin_ptr->set_use_expiring(expiring_medicine != 0);
m_sidestory_reopen_medicine_plugin_ptr->set_dr_grandet(is_dr_grandet);
m_dr_grandet_task_plugin_ptr->set_enable(is_dr_grandet);
m_stage_drops_plugin_ptr->set_enable_penguin(enable_penguin);
m_stage_drops_plugin_ptr->set_penguin_id(penguin_id);
Expand Down
3 changes: 2 additions & 1 deletion src/MaaCore/Task/Interface/FightTask.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,10 @@ namespace asst
std::shared_ptr<ProcessTask> m_start_up_task_ptr = nullptr;
std::shared_ptr<StageNavigationTask> m_stage_navigation_task_ptr = nullptr;
std::shared_ptr<ProcessTask> m_fight_task_ptr = nullptr;
std::shared_ptr<MedicineCounterPlugin> m_medicine_plugin = nullptr;
std::shared_ptr<MedicineCounterPlugin> m_medicine_plugin_ptr = nullptr;
std::shared_ptr<StageDropsTaskPlugin> m_stage_drops_plugin_ptr = nullptr;
std::shared_ptr<DrGrandetTaskPlugin> m_dr_grandet_task_plugin_ptr = nullptr;
std::shared_ptr<SideStoryReopenTask> m_sidestory_reopen_task_ptr = nullptr;
std::shared_ptr<MedicineCounterPlugin> m_sidestory_reopen_medicine_plugin_ptr = nullptr;
};
}

0 comments on commit 607d0f9

Please sign in to comment.