StarRailCopilot/module/handler/fast_forward.py
LmeSzinc 70936f4f39 Add: 适配第二章
- 修复了不开启周回模式时, 会在出击界面开启自动的问题
- 修复了多打一战后, 打完BOSS不判定当前出击结束的问题
- 增加掉落新船时锁定的功能
- 增加了地图不支持周回模式时, 跳过周回检查的功能
  周回模式的选项可以无脑开了
- 修改透视识别报warning为info
  因为低级图地图小降低了检测的阈值, 导致需要纠正错误有点多
- 减少了战斗准备页面的多余点击
- 减少了挂委托时的多余点击
2020-04-14 17:32:26 +08:00

49 lines
1.8 KiB
Python

from module.base.base import ModuleBase
from module.base.switch import Switch
from module.handler.assets import *
from module.logger import logger
fast_forward = Switch('Fast_Forward')
fast_forward.add_status('on', check_button=FAST_FORWARD_ON)
fast_forward.add_status('off', check_button=FAST_FORWARD_OFF)
fleet_lock = Switch('Fleet_Lock')
fleet_lock.add_status('on', check_button=FLEET_LOCKED)
fleet_lock.add_status('off', check_button=FLEET_UNLOCKED)
class FastForwardHandler(ModuleBase):
def handle_fast_forward(self):
if not self.appear(MAP_STAR_1) or not self.appear(MAP_STAR_2) or not self.appear(MAP_STAR_3):
logger.info('Campaign is not 3-star cleared.')
return False
if not self.appear(MAP_GREEN):
logger.info('Campaign is not green sea.')
return False
if not fast_forward.appear(main=self):
self.config.ENABLE_FAST_FORWARD = False
self.config.MAP_HAS_AMBUSH = True
logger.info('No fast forward mode.')
return False
if self.config.ENABLE_FAST_FORWARD:
self.config.MAP_HAS_AMBUSH = False
status = 'on'
else:
# When disable fast forward, MAP_HAS_AMBUSH depends on map settings.
# self.config.MAP_HAS_AMBUSH = True
status = 'off'
changed = fast_forward.set(status=status, main=self)
return changed
def handle_map_fleet_lock(self):
if not fleet_lock.appear(main=self):
logger.info('No fleet lock option.')
return False
logger.info('fleet_lock')
self.config.MAP_HAS_AMBUSH = False
status = 'on' if self.config.ENABLE_MAP_FLEET_LOCK else 'off'
changed = fleet_lock.set(status=status, main=self)
return changed