From d1b488e4d0d9a0eed11b7076679881ba52a1f80f Mon Sep 17 00:00:00 2001 From: Air111 <1796389814@qq.com> Date: Tue, 23 Apr 2024 20:33:28 +0800 Subject: [PATCH] Opt: adjust lower bound of emotion to reduce ship changing frequency --- module/campaign/gems_farming.py | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/module/campaign/gems_farming.py b/module/campaign/gems_farming.py index 8bae389631..20b9414516 100644 --- a/module/campaign/gems_farming.py +++ b/module/campaign/gems_farming.py @@ -132,7 +132,6 @@ class GemsCampaign(GemsCampaignOverride, self.module.Campaign): self.campaign.config.override(Emotion_Mode='calculate') else: self.campaign.config.override(Emotion_Mode='ignore') - self.emotion_expected_reduce = self.campaign._map_battle * 2 @property def change_flagship(self): @@ -239,6 +238,10 @@ def _ship_change_confirm(self, button): self._dock_reset() self.dock_select_confirm(check_button=page_fleet.check_button) + @property + def emotion_lower_bound(self): + return 3 + EMOTION_LIMIT + self.campaign._map_battle * 2 + def get_common_rarity_cv(self): """ Get a common rarity cv by config.GemsFarming_CommonCV @@ -249,7 +252,7 @@ def get_common_rarity_cv(self): logger.hr('FINDING FLAGSHIP') - scanner = ShipScanner(level=(1, 31), emotion=(1 + EMOTION_LIMIT + self.emotion_expected_reduce, 150), + scanner = ShipScanner(level=(1, 31), emotion=(self.emotion_lower_bound, 150), fleet=self.fleet_to_attack, status='free') scanner.disable('rarity') @@ -298,7 +301,7 @@ def get_common_rarity_cv(self): def get_common_rarity_dd(self): """ Get a common rarity dd with level is 100 (70 for servers except CN) - and emotion > EMOTION_LIMIT + self.emotion_expected_reduce + and emotion >= self.emotion_lower_bound Returns: Ship: """ @@ -309,7 +312,7 @@ def get_common_rarity_dd(self): else: max_level = 70 - scanner = ShipScanner(level=(max_level, max_level), emotion=(1 + EMOTION_LIMIT + self.emotion_expected_reduce, 150), + scanner = ShipScanner(level=(max_level, max_level), emotion=(self.emotion_lower_bound, 150), fleet=[0, self.fleet_to_attack], status='free') scanner.disable('rarity')