mirror of
https://github.com/sui-feng-cb/AzurLaneAutoScript1.git
synced 2026-08-16 12:00:30 +08:00
Feat: aggressive yellow coin preserve via port shop
This commit is contained in:
@@ -61,9 +61,13 @@ class OSStatus(UI):
|
|||||||
tasks = SelectedGrids(self.config.pending_task + self.config.waiting_task).filter(func).sort('next_run')
|
tasks = SelectedGrids(self.config.pending_task + self.config.waiting_task).filter(func).sort('next_run')
|
||||||
return tasks.first_or_none()
|
return tasks.first_or_none()
|
||||||
|
|
||||||
|
@property
|
||||||
|
def bought_all_yellow_coin_items_in_port_shop(self) -> bool:
|
||||||
|
return self.config.cross_get("OpsiShop.Storage.Storage.BoughtAllYellowCoinItems", False)
|
||||||
|
|
||||||
@cached_property
|
@cached_property
|
||||||
def yellow_coins_preserve(self):
|
def yellow_coins_preserve(self):
|
||||||
if self.is_cl1_enabled:
|
if self.is_cl1_enabled and not self.bought_all_yellow_coin_items_in_port_shop:
|
||||||
return 100000
|
return 100000
|
||||||
else:
|
else:
|
||||||
return 35000
|
return 35000
|
||||||
|
|||||||
@@ -210,11 +210,19 @@ class OSShop(PortShop, AkashiShop):
|
|||||||
items = self.scan_all()
|
items = self.scan_all()
|
||||||
if not len(items):
|
if not len(items):
|
||||||
logger.warning('Empty OS shop.')
|
logger.warning('Empty OS shop.')
|
||||||
|
self.config.cross_set("OpsiShop.Storage.Storage.BoughtAllYellowCoinItems", True)
|
||||||
return False
|
return False
|
||||||
items = self.items_filter_in_os_shop(items)
|
items = self.items_filter_in_os_shop(items)
|
||||||
if not len(items):
|
if not len(items):
|
||||||
logger.warning('Nothing to buy.')
|
logger.warning('Nothing to buy.')
|
||||||
|
self.config.cross_set("OpsiShop.Storage.Storage.BoughtAllYellowCoinItems", True)
|
||||||
return False
|
return False
|
||||||
|
if all(item.cost == 'PurpleCoins' for item in items):
|
||||||
|
logger.info("All yellow coin items are bought.")
|
||||||
|
self.config.cross_set("OpsiShop.Storage.Storage.BoughtAllYellowCoinItems", True)
|
||||||
|
else:
|
||||||
|
logger.info("There are still yellow coin items to buy.")
|
||||||
|
self.config.cross_set("OpsiShop.Storage.Storage.BoughtAllYellowCoinItems", False)
|
||||||
self.os_shop_get_coins()
|
self.os_shop_get_coins()
|
||||||
skip_get_coins = True
|
skip_get_coins = True
|
||||||
items.reverse()
|
items.reverse()
|
||||||
|
|||||||
Reference in New Issue
Block a user