mirror of
https://gitee.com/sui-feng-cb/AzurLaneAutoScript1
synced 2026-03-19 23:33:33 +08:00
Add: FASHION Coalition assets
This commit is contained in:
@@ -6,6 +6,7 @@ from module.coalition.combat import CoalitionCombat
|
||||
from module.exception import ScriptEnd, ScriptError
|
||||
from module.logger import logger
|
||||
from module.ocr.ocr import Digit
|
||||
from module.ui.page import page_campaign_menu
|
||||
|
||||
|
||||
class AcademyPtOcr(Digit):
|
||||
@@ -22,6 +23,7 @@ class AcademyPtOcr(Digit):
|
||||
pass
|
||||
return super().after_process(result)
|
||||
|
||||
|
||||
class DALPtOcr(Digit):
|
||||
def __init__(self, *args, **kwargs):
|
||||
super().__init__(*args, **kwargs)
|
||||
@@ -55,7 +57,9 @@ class Coalition(CoalitionCombat, CampaignEvent):
|
||||
# use generic ocr model
|
||||
ocr = Digit(NEONCITY_PT_OCR, name='OCR_PT', lang='cnocr', letter=(208, 208, 208), threshold=128)
|
||||
elif event == 'coalition_20251120':
|
||||
ocr = DALPtOcr(DAL_PT_OCR, name='OCR_PT' ,letter=(255, 213, 69), threshold=128)
|
||||
ocr = DALPtOcr(DAL_PT_OCR, name='OCR_PT', letter=(255, 213, 69), threshold=128)
|
||||
elif event == 'coalition_20260122':
|
||||
ocr = Digit(FASHION_PT_OCR, name='OCR_PT', letter=(41, 40, 40), threshold=128)
|
||||
else:
|
||||
logger.error(f'ocr object is not defined in event {event}')
|
||||
raise ScriptError
|
||||
@@ -71,6 +75,16 @@ class Coalition(CoalitionCombat, CampaignEvent):
|
||||
|
||||
return pt
|
||||
|
||||
@property
|
||||
def _coalition_has_oil_icon(self):
|
||||
"""
|
||||
Game devs are too asshole to drop oil display for UI design
|
||||
https://github.com/LmeSzinc/AzurLaneAutoScript/issues/5214
|
||||
"""
|
||||
if self.config.Campaign_Event == 'coalition_20260122':
|
||||
return False
|
||||
return True
|
||||
|
||||
def triggered_stop_condition(self, oil_check=False, pt_check=False):
|
||||
"""
|
||||
Returns:
|
||||
@@ -83,7 +97,7 @@ class Coalition(CoalitionCombat, CampaignEvent):
|
||||
self.config.Scheduler_Enable = False
|
||||
return True
|
||||
# Oil limit
|
||||
if oil_check:
|
||||
if oil_check and self._coalition_has_oil_icon:
|
||||
if self.get_oil() < max(500, self.config.StopCondition_OilLimit):
|
||||
logger.hr('Triggered stop condition: Oil limit')
|
||||
self.config.task_delay(minute=(120, 240))
|
||||
@@ -173,10 +187,10 @@ class Coalition(CoalitionCombat, CampaignEvent):
|
||||
logger.info(f'Count: {self.run_count}')
|
||||
|
||||
# UI switches
|
||||
# if self.config.SERVER in ['tw']:
|
||||
# self.ui_goto(page_campaign_menu)
|
||||
# if self.triggered_stop_condition(oil_check=True):
|
||||
# break
|
||||
if not self._coalition_has_oil_icon:
|
||||
self.ui_goto(page_campaign_menu)
|
||||
if self.triggered_stop_condition(oil_check=True):
|
||||
break
|
||||
self.device.stuck_record_clear()
|
||||
self.device.click_record_clear()
|
||||
self.ui_goto_coalition()
|
||||
@@ -206,3 +220,9 @@ class Coalition(CoalitionCombat, CampaignEvent):
|
||||
# Scheduler
|
||||
if self.config.task_switched():
|
||||
self.config.task_stop()
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
self = Coalition('alas5', task='Coalition')
|
||||
self.device.screenshot()
|
||||
self.get_event_pt()
|
||||
|
||||
Reference in New Issue
Block a user