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 Apr 23, 2024
1 parent 53a822d commit 4742357
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 @@ -165,7 +165,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 @@ -262,6 +261,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 @@ -272,7 +275,7 @@ def get_common_rarity_cv(self):

logger.hr('FINDING FLAGSHIP')

scanner = ShipScanner(level=(1, 31), emotion=(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 @@ -321,7 +324,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 @@ -332,7 +335,7 @@ def get_common_rarity_dd(self):
else:
max_level = 70

scanner = ShipScanner(level=(max_level, max_level), emotion=(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 4742357

Please sign in to comment.