Skip to content

Commit

Permalink
Opt: adjust lower bound of emotion to reduce ship changing frequency
Browse files Browse the repository at this point in the history
  • Loading branch information
Air111 committed Jun 14, 2024
1 parent 0c53372 commit 501dcd4
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions module/campaign/gems_farming.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down Expand Up @@ -235,6 +234,10 @@ def _ship_change_confirm(self, button):
self.dock_sort_method_dsc_set()
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
Expand All @@ -245,7 +248,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')

Expand Down Expand Up @@ -294,7 +297,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:
"""
Expand All @@ -305,7 +308,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')

Expand Down

0 comments on commit 501dcd4

Please sign in to comment.