Skip to content

Commit

Permalink
#87 体力规划增加支持 经验、 信用、光锥技能、角色突破
Browse files Browse the repository at this point in the history
  • Loading branch information
DoctorReid committed Nov 17, 2023
1 parent 03d7eee commit a4e48b0
Show file tree
Hide file tree
Showing 17 changed files with 353 additions and 92 deletions.
Binary file modified data/locales/en/LC_MESSAGES/ocr.mo
Binary file not shown.
64 changes: 32 additions & 32 deletions data/locales/ocr/en.po
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ msgstr "Monitoring Room"
msgid "接待中心"
msgstr "Reception Center"

msgid "空海之形"
msgid "空海之形凝滞虚影"
msgstr "Stagnant Shadow"

# Special Point - Herta Space Station - Storage Zone
Expand All @@ -217,10 +217,10 @@ msgstr "Special Purpose Lab"
msgid "无明之间"
msgstr "Gallery of Shadow"

msgid "毁灭之蕾"
msgid "毁灭之蕾拟造花萼赤"
msgstr "Bud of Destruction"

msgid "霜风之径"
msgid "霜风之径侵蚀隧洞"
msgstr "Path of Gelid Wind"

msgid "裂界征兆"
Expand All @@ -236,7 +236,7 @@ msgstr "Railway Platform"
msgid "电力室"
msgstr "Electrical Room"

msgid "存护之蕾"
msgid "存护之蕾拟造花萼赤"
msgstr "Bud of Preservation"

msgid "毁灭的开端"
Expand Down Expand Up @@ -299,10 +299,10 @@ msgstr "Long Slope"
msgid "着陆点"
msgstr "Landing Point"

msgid "巡猎之蕾"
msgid "巡猎之蕾拟造花萼赤"
msgstr "Bud of The Hunt"

msgid "回忆之蕾"
msgid "回忆之蕾拟造花萼金"
msgstr "Bud of Memories"

msgid "玲可"
Expand All @@ -318,13 +318,13 @@ msgstr "Leisure Plaza"
msgid "歌德旧宅"
msgstr "Goethe Mansion"

msgid "幻光之形"
msgid "幻光之形凝滞虚影"
msgstr "Shape of Mirage"

msgid "丰饶之蕾"
msgid "丰饶之蕾拟造花萼赤"
msgstr "Bud of Abundance"

msgid "以太之蕾"
msgid "以太之蕾拟造花萼金"
msgstr "Bud of Aether"

# Special Point - Jarilo-VI - Silvermane Guard Restricted Zone
Expand All @@ -337,10 +337,10 @@ msgstr "Frontline"
msgid "能源枢纽"
msgstr "Energy Hub"

msgid "炎华之形"
msgid "炎华之形凝滞虚影"
msgstr "Shape of Blaze"

msgid "迅拳之径"
msgid "迅拳之径侵蚀隧洞"
msgstr "Path of Jabbing Punch"

msgid "以眼还眼"
Expand All @@ -362,13 +362,13 @@ msgstr "Command Center"
msgid "古战场前线"
msgstr "Ancient Battlefield: Frontline"

msgid "鸣雷之形"
msgid "鸣雷之形凝滞虚影"
msgstr "Shape of Fulmination"

msgid "霜晶之形"
msgid "霜晶之形凝滞虚影"
msgstr "Shape of Rime"

msgid "漂泊之径"
msgid "漂泊之径侵蚀隧洞"
msgstr "Path of Drifting"

# Special Point - Jarilo-VI - Everwinter Hill
Expand All @@ -378,7 +378,7 @@ msgstr "Ancient Battlefield"
msgid "造物平台"
msgstr "Deck of Creation"

msgid "睿治之径"
msgid "睿治之径侵蚀隧洞"
msgstr "Path of Providence"

msgid "寒潮的落幕"
Expand Down Expand Up @@ -433,16 +433,16 @@ msgstr "Overlook"
msgid "主矿道"
msgstr "Main Mine Shaft"

msgid "锋芒之形"
msgid "锋芒之形凝滞虚影"
msgstr "Shape of Spike"

msgid "燔灼之形"
msgid "燔灼之形凝滞虚影"
msgstr "Shape of Scorch"

msgid "虚无之蕾"
msgid "虚无之蕾拟造花萼赤"
msgstr "Bud of Nihility"

msgid "藏珍之蕾"
msgid "藏珍之蕾拟造花萼金"
msgstr "Bud of Treasures"

# Special Point - Jarilo-VI - Rivet Town
Expand All @@ -452,10 +452,10 @@ msgstr "Orphanage"
msgid "废弃市集"
msgstr "Abandoned Market"

msgid "巽风之形"
msgid "巽风之形凝滞虚影"
msgstr "Shape of Gust"

msgid "智识之蕾"
msgid "智识之蕾拟造花萼赤"
msgstr "Bud of Erudition"

# Special Point - Jarilo-VI - Robot Settlement
Expand All @@ -468,7 +468,7 @@ msgstr "Svarog's Base"
msgid "能源转换设施"
msgstr "Energy Conversion Station"

msgid "同谐之蕾"
msgid "同谐之蕾拟造花萼赤"
msgstr "Bud of Harmony"

# Special Point - The Xianzhou Luofu - Central Starskiff Haven
Expand Down Expand Up @@ -512,10 +512,10 @@ msgstr "Trove of Verdure: South Wing"
msgid "流云渡乘槎处"
msgstr "Cloudford: Skiff Boarding Area"

msgid "冰棱之形"
msgid "冰棱之形凝滞虚影"
msgstr "Shape of Icicle"

msgid "圣颂之径"
msgid "圣颂之径侵蚀隧洞"
msgstr "Path of Holy Hymn"

msgid "过期邮包收购处"
Expand All @@ -534,10 +534,10 @@ msgstr "Ship Nursery - The Burgeoning"
msgid "泊航区"
msgstr "The Mooring"

msgid "震厄之形"
msgid "震厄之形凝滞虚影"
msgstr "Shape of Doom"

msgid "野焰之径"
msgid "野焰之径侵蚀隧洞"
msgstr "Path of Conflagration"

# Special Point - The Xianzhou Luofu - Exalting Sanctum
Expand Down Expand Up @@ -631,7 +631,7 @@ msgstr "Arcane Moorage"
msgid "造化洪炉"
msgstr "Creation Furnace"

msgid "偃偶之形"
msgid "偃偶之形凝滞虚影"
msgstr "Shape of Puppetry"

# Interact
Expand All @@ -651,10 +651,10 @@ msgstr "Healer's Market"
msgid "岐黄署"
msgstr "Medicine Bureau"

msgid "天人之形"
msgid "天人之形凝滞虚影"
msgstr "Shape of Celestial"

msgid "药使之径"
msgid "药使之径侵蚀隧洞"
msgstr "Path of Elixir Seekers"

msgid "祈龙坛"
Expand All @@ -679,7 +679,7 @@ msgstr "Ancient Sea Palace Ruins"
msgid "显龙大雩殿"
msgstr "Draggonvista Rain Hall"

msgid "孽兽之形"
msgid "孽兽之形凝滞虚影"
msgstr "Shape of Abomination"

msgid "不死的神实"
Expand All @@ -698,10 +698,10 @@ msgstr "Verdant Terrace Entrance"
msgid "燕乐亭入口"
msgstr "Swallowsong Pavilion Entrance"

msgid "幽府之形"
msgid "幽府之形凝滞虚影"
msgstr "Shape of Perdition"

msgid "幽冥之径"
msgid "幽冥之径侵蚀隧洞"
msgstr "Path of Darkness"

# Large Map Btn
Expand Down
Binary file added images/template/battle_times_minus/origin.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/template/battle_times_minus/raw.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/template/battle_times_plus/origin.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/template/battle_times_plus/raw.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
18 changes: 18 additions & 0 deletions src/basic/str_utils.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
import re

from basic.log_utils import log


def find(source: str, target: str, ignore_case: bool = False) -> int:
"""
字符串find的封装 在原目标串中招目标字符串
Expand Down Expand Up @@ -57,3 +62,16 @@ def longest_common_subsequence_length(str1: str, str2: str):
dp[i][j] = max(dp[i - 1][j], dp[i][j - 1])

return dp[m][n]


def get_digits(v: str) -> int:
"""
返回字符串中的数字部分
:param v:
:return:
"""
try:
return int(re.sub(r"\D", "", v))
except Exception:
log.error('目标字符串中没有数字 %s', v)
return 0
7 changes: 3 additions & 4 deletions src/sr/app/routine/trailblaze_power.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

from cv2.typing import MatLike

from basic import Rect
from basic import Rect, str_utils
from basic.i18_utils import gt
from basic.img import cv2_utils
from basic.log_utils import log
Expand All @@ -14,7 +14,7 @@
from sr.operation.combine.use_trailblaze_power import get_point_by_unique_id, TrailblazePowerPoint, UseTrailblazePower
from sr.operation.unit.open_map import OpenMap

TRAILBLAZE_POWER = AppDescription(cn='开拓力(测试中)', id='trailblaze_power')
TRAILBLAZE_POWER = AppDescription(cn='开拓力', id='trailblaze_power')
register_app(TRAILBLAZE_POWER)


Expand Down Expand Up @@ -127,8 +127,7 @@ def _execute_one_round(self) -> int:
screen: MatLike = self.screenshot()
part, _ = cv2_utils.crop_image(screen, TrailblazePower.MAP_POWER_RECT)
ocr_result = self.ctx.ocr.ocr_for_single_line(part, strict_one_line=True)
digit_result = re.sub(r"\D", "", ocr_result)
self.power = int(digit_result)
self.power = str_utils.get_digits(ocr_result)
log.info('当前体力 %d', self.power)
self.phase += 1
return Operation.WAIT
Expand Down
Loading

0 comments on commit a4e48b0

Please sign in to comment.