Skip to content

Commit

Permalink
Opt: always keep common cv at retirement if GemsFarming enabled
Browse files Browse the repository at this point in the history
  • Loading branch information
guoh064 authored and LmeSzinc committed Jul 19, 2024
1 parent a2ebcbe commit 11e3580
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 5 deletions.
1 change: 0 additions & 1 deletion module/campaign/gems_farming.py
Original file line number Diff line number Diff line change
Expand Up @@ -400,7 +400,6 @@ def run(self, name, folder='campaign_main', mode='normal', total=0):
total (int):
"""
self.config.STOP_IF_REACH_LV32 = self.change_flagship
self.config.RETIRE_KEEP_COMMON_CV = True

while 1:
self._trigger_lv32 = False
Expand Down
1 change: 0 additions & 1 deletion module/config/config_manual.py
Original file line number Diff line number Diff line change
Expand Up @@ -353,7 +353,6 @@ def SERVER(self):
"""
DOCK_FULL_TRIGGERED = False
GET_SHIP_TRIGGERED = False
RETIRE_KEEP_COMMON_CV = False
COMMON_CV_THRESHOLD = 0.9

"""
Expand Down
10 changes: 7 additions & 3 deletions module/retire/retirement.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,10 @@ class Retirement(Enhancement, QuickRetireSettingHandler):
# From MapOperation
map_cat_attack_timer = Timer(2)

@property
def retire_keep_common_cv(self):
return self.config.is_task_enabled('GemsFarming')

def _retirement_choose(self, amount=10, target_rarity=('N',)):
"""
Args:
Expand Down Expand Up @@ -114,7 +118,7 @@ def _retirement_confirm(self, skip_first_screenshot=True):
else:
self.interval_clear(SHIP_CONFIRM)
if self.appear(SHIP_CONFIRM_2, offset=(30, 30), interval=2):
if self.config.RETIRE_KEEP_COMMON_CV and not self._have_kept_cv:
if self.retire_keep_common_cv and not self._have_kept_cv:
self.keep_one_common_cv()
self.device.click(SHIP_CONFIRM_2)
self.interval_clear(GET_ITEMS_1)
Expand Down Expand Up @@ -171,7 +175,7 @@ def retire_ships_one_click(self):
end = False
total = 0

if self.config.RETIRE_KEEP_COMMON_CV:
if self.retire_keep_common_cv:
self._have_kept_cv = False

while 1:
Expand Down Expand Up @@ -246,7 +250,7 @@ def retire_ships_old(self, amount=None, rarity=None):
self.dock_favourite_set(False)
total = 0

if self.config.RETIRE_KEEP_COMMON_CV:
if self.retire_keep_common_cv:
self._have_kept_cv = False

while amount:
Expand Down

0 comments on commit 11e3580

Please sign in to comment.