mirror of
https://gitee.com/sui-feng-cb/AzurLaneAutoScript1
synced 2026-03-12 14:27:00 +08:00
Add: Entrance of SOS stages
This commit is contained in:
BIN
assets/cn/template/TEMPLATE_STAGE_SOS.png
Normal file
BIN
assets/cn/template/TEMPLATE_STAGE_SOS.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 3.2 KiB |
BIN
assets/en/template/TEMPLATE_STAGE_SOS.png
Normal file
BIN
assets/en/template/TEMPLATE_STAGE_SOS.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 3.2 KiB |
BIN
assets/jp/template/TEMPLATE_STAGE_SOS.png
Normal file
BIN
assets/jp/template/TEMPLATE_STAGE_SOS.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 3.2 KiB |
27
campaign/campaign_sos/campaign_base.py
Normal file
27
campaign/campaign_sos/campaign_base.py
Normal file
@@ -0,0 +1,27 @@
|
|||||||
|
from module.base.button import Button
|
||||||
|
from module.base.utils import *
|
||||||
|
from module.campaign.campaign_base import CampaignBase as CampaignBase_
|
||||||
|
from module.exception import CampaignNameError
|
||||||
|
from module.template.assets import TEMPLATE_STAGE_SOS
|
||||||
|
|
||||||
|
|
||||||
|
class CampaignBase(CampaignBase_):
|
||||||
|
def campaign_get_entrance(self, name):
|
||||||
|
"""
|
||||||
|
SOS stages don't have names in game, although players call them X-5 or X-sos.
|
||||||
|
In most stages, alas use ocr to find stage entrances, but here, consider the submarine icon as stage entrance.
|
||||||
|
|
||||||
|
Args:
|
||||||
|
name (str): Campaign name, such as '7-2', 'd3', 'sp3'.
|
||||||
|
|
||||||
|
Returns:
|
||||||
|
Button:
|
||||||
|
"""
|
||||||
|
sim, point = TEMPLATE_STAGE_SOS.match_result(self.device.image)
|
||||||
|
if sim < 0.85:
|
||||||
|
raise CampaignNameError
|
||||||
|
|
||||||
|
button = area_offset(area=(-12, -12, 44, 32), offset=point)
|
||||||
|
color = get_color(self.device.image, button)
|
||||||
|
entrance = Button(area=button, color=color, button=button, name=name)
|
||||||
|
return entrance
|
||||||
@@ -61,4 +61,5 @@ TEMPLATE_STAGE_BLUE_CLEAR = Template(file={'cn': './assets/cn/template/TEMPLATE_
|
|||||||
TEMPLATE_STAGE_BLUE_PERCENT = Template(file={'cn': './assets/cn/template/TEMPLATE_STAGE_BLUE_PERCENT.png', 'en': './assets/en/template/TEMPLATE_STAGE_BLUE_PERCENT.png', 'jp': './assets/jp/template/TEMPLATE_STAGE_BLUE_PERCENT.png'})
|
TEMPLATE_STAGE_BLUE_PERCENT = Template(file={'cn': './assets/cn/template/TEMPLATE_STAGE_BLUE_PERCENT.png', 'en': './assets/en/template/TEMPLATE_STAGE_BLUE_PERCENT.png', 'jp': './assets/jp/template/TEMPLATE_STAGE_BLUE_PERCENT.png'})
|
||||||
TEMPLATE_STAGE_CLEAR = Template(file={'cn': './assets/cn/template/TEMPLATE_STAGE_CLEAR.png', 'en': './assets/en/template/TEMPLATE_STAGE_CLEAR.png', 'jp': './assets/jp/template/TEMPLATE_STAGE_CLEAR.png'})
|
TEMPLATE_STAGE_CLEAR = Template(file={'cn': './assets/cn/template/TEMPLATE_STAGE_CLEAR.png', 'en': './assets/en/template/TEMPLATE_STAGE_CLEAR.png', 'jp': './assets/jp/template/TEMPLATE_STAGE_CLEAR.png'})
|
||||||
TEMPLATE_STAGE_PERCENT = Template(file={'cn': './assets/cn/template/TEMPLATE_STAGE_PERCENT.png', 'en': './assets/en/template/TEMPLATE_STAGE_PERCENT.png', 'jp': './assets/jp/template/TEMPLATE_STAGE_PERCENT.png'})
|
TEMPLATE_STAGE_PERCENT = Template(file={'cn': './assets/cn/template/TEMPLATE_STAGE_PERCENT.png', 'en': './assets/en/template/TEMPLATE_STAGE_PERCENT.png', 'jp': './assets/jp/template/TEMPLATE_STAGE_PERCENT.png'})
|
||||||
|
TEMPLATE_STAGE_SOS = Template(file={'cn': './assets/cn/template/TEMPLATE_STAGE_SOS.png', 'en': './assets/cn/template/TEMPLATE_STAGE_SOS.png', 'jp': './assets/cn/template/TEMPLATE_STAGE_SOS.png'})
|
||||||
TEMPLATE_SUBMARINE = Template(file={'cn': './assets/cn/template/TEMPLATE_SUBMARINE.png', 'en': './assets/en/template/TEMPLATE_SUBMARINE.png', 'jp': './assets/jp/template/TEMPLATE_SUBMARINE.png'})
|
TEMPLATE_SUBMARINE = Template(file={'cn': './assets/cn/template/TEMPLATE_SUBMARINE.png', 'en': './assets/en/template/TEMPLATE_SUBMARINE.png', 'jp': './assets/jp/template/TEMPLATE_SUBMARINE.png'})
|
||||||
|
|||||||
Reference in New Issue
Block a user