perf: 迁移肉鸽UseSupport

This commit is contained in:
status102
2023-11-17 21:01:18 +08:00
parent 5356ad9439
commit 854e17f4ec
5 changed files with 7 additions and 4 deletions

View File

@@ -42,7 +42,6 @@ namespace asst
static inline const std::string RoguelikeCharElitePrefix = "RoguelikeElite-";
static inline const std::string RoguelikeCharLevelPrefix = "RoguelikeLevel-";
static inline const std::string RoguelikeCharOverview = "RoguelikeOverview";
static inline const std::string RoguelikeUseSupport = "RoguelikeUseSupport";
static inline const std::string RoguelikeUseNonfriendSupport = "RoguelikeUseNonfriendSupport";
static inline const std::string ProcessTaskLastTimePrefix = "#LastTime#";

View File

@@ -7,6 +7,8 @@ void asst::RoguelikeConfig::clear() {
m_trader_no_longer_buy = false;
m_core_char = std::string();
m_team_full_without_rookie = false;
m_use_support = false;
m_foldartal_floor.reset();
m_foldartal.clear();
}

View File

@@ -65,6 +65,8 @@ namespace asst
std::string get_core_char() { return m_core_char; }
void set_team_full_without_rookie(bool without_rookie) { m_team_full_without_rookie = without_rookie; }
bool get_team_full_without_rookie() { return m_team_full_without_rookie; }
void set_use_support(bool use_support) { m_use_support = use_support; }
bool get_use_support() { return m_use_support; }
void set_foldartal_floor(std::optional<std::string> floor) { m_foldartal_floor = std::move(floor); }
const std::optional<std::string>& get_foldartal_floor() { return m_foldartal_floor; }
@@ -88,6 +90,7 @@ namespace asst
bool m_trader_no_longer_buy = false;
std::string m_core_char;
bool m_team_full_without_rookie = false;
bool m_use_support = false;
/* 密文板 */
// 当前层的预见密文板,在下一层获得

View File

@@ -140,7 +140,7 @@ bool asst::RoguelikeCustomStartTaskPlugin::hijack_core_char()
sleep(Task.get("RoguelikeCustom-HijackCoChar")->pre_delay);
status()->set_str(Status::RoguelikeUseSupport, m_customs[RoguelikeCustomType::UseSupport]);
m_config->set_use_support(m_customs[RoguelikeCustomType::UseSupport] == "1");
status()->set_str(Status::RoguelikeUseNonfriendSupport, m_customs[RoguelikeCustomType::UseNonfriendSupport]);
m_config->set_core_char(char_name);
return true;

View File

@@ -66,8 +66,7 @@ bool asst::RoguelikeRecruitTaskPlugin::_run()
bool team_complete = m_config->get_recruitment_team_complete();
// 是否使用助战干员开局
bool use_support = get_status_bool(Status::RoguelikeUseSupport);
if (use_support) {
if (m_config->get_use_support()) {
if (recruit_support_char()) {
start_complete = true;
return true;