Skip to content

Commit

Permalink
为简单战役添加plan
Browse files Browse the repository at this point in the history
  • Loading branch information
veadex committed Sep 3, 2024
1 parent 106c683 commit ecc7944
Show file tree
Hide file tree
Showing 15 changed files with 105 additions and 3 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
参与开发、用户交流、闲聊: qq群 568500514

## 近期更新
- 为简单战役添加plan,现在可以在战役练习战术. **2024/09/03**
- 修复决战无法正常重置的bug,增加log输出相对应的颜色. **2024/09/01**
- 添加对常规地图9-4的支持,更新ship_name文件,修复决战出征的bug. **2024/08/31**
- 请重新下载`example`文件夹,OCR识别增加新的后端,如果感觉paddleocr速度较慢,可在`user_settings`中设置`OCR_BACKEND``easyocr`,增加2-1捞胖次的plan. **2024/08/02**
Expand Down
2 changes: 1 addition & 1 deletion autowsgr/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = "0.2.4.7"
__version__ = "0.2.4.8"
10 changes: 10 additions & 0 deletions autowsgr/data/plans/battle/简单巡洋.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# MapLevel
map: 2 # 简单1-5 困难6-10
repair_mode: [1, 1, 1, 2, 2, 2]
# NodeLevel
node_args:
# 阵型选择阶段
formation: 2 # 正常情况阵型选择,1-5
# 夜战选择阶段
night: True # 是否夜战
SL_when_enter_fight: False # 是否在进入战斗时SL,如果要刷战术,建议设为True
10 changes: 10 additions & 0 deletions autowsgr/data/plans/battle/简单战列.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# MapLevel
map: 3 # 简单1-5 困难6-10

# NodeLevel
node_args:
# 阵型选择阶段
formation: 5 # 正常情况阵型选择,1-5
# 夜战选择阶段
night: True # 是否夜战
SL_when_enter_fight: False # 是否在进入战斗时SL,如果要刷战术,建议设为True
9 changes: 9 additions & 0 deletions autowsgr/data/plans/battle/简单潜艇.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# MapLevel
map: 5 # 简单1-5 困难6-10
repair_mode: 2

# NodeLevel
node_args:
# 夜战选择阶段
night: True # 是否夜战
SL_when_enter_fight: False # 是否在进入战斗时SL,如果要刷战术,建议设为True
11 changes: 11 additions & 0 deletions autowsgr/data/plans/battle/简单航母.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# MapLevel
map: 4 # 简单1-5 困难6-10
repair_mode: [1, 1, 2, 2, 2, 2]

# NodeLevel
node_args:
# 阵型选择阶段
formation: 2 # 正常情况阵型选择,1-5
# 夜战选择阶段
night: True # 是否夜战
SL_when_enter_fight: False # 是否在进入战斗时SL,如果要刷战术,建议设为True
10 changes: 10 additions & 0 deletions autowsgr/data/plans/battle/简单驱逐.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# MapLevel
map: 1 # 简单1-5 困难6-10

# NodeLevel
node_args:
# 阵型选择阶段
formation: 2 # 正常情况阵型选择,1-5
# 夜战选择阶段
night: True # 是否夜战
SL_when_enter_fight: False # 是否在进入战斗时SL,如果要刷战术,建议设为True
1 change: 1 addition & 0 deletions autowsgr/game/game_operation.py
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,7 @@ def quick_repair(timer: Timer, repair_mode=2, ship_stats=None, *args, **kwargs):
ship_stats = detect_ship_stats(timer)
if not any(x in ship_stats for x in [0, 1, 2]):
timer.logger.warning("执行修理操作时没有成功检测到舰船")
raise ValueError("没有成功检测到舰船,请检查是否正确编队")

assert type(repair_mode) in [int, list, tuple]
if type(repair_mode) == int: # 指定所有统一修理方案
Expand Down
3 changes: 2 additions & 1 deletion autowsgr/scripts/daily_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ def run(self):
# 自动战役,直到超过次数
if self.config.auto_battle:
ret = literals.OPERATION_SUCCESS_FLAG
while ret == literals.OPERATION_SUCCESS_FLAG:
while ret is not literals.BATTLE_TIMES_EXCEED:
ret = self.battle_plan.run()

# 自动开启战役支援
Expand Down Expand Up @@ -137,6 +137,7 @@ def _ship_max(self):
if self.timer.got_ship_num < 500:
return True
else:
self.timer.logger.info("船只数量已达到上限,结束出征")
return False

def check_exercise(self):
Expand Down
1 change: 0 additions & 1 deletion autowsgr/timer/backends/ocr_backend.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,6 @@ def post_process_text(t):
return results
else:
if not results:
print(f"OCR识别失败: {results}")
results = ["Unkown"]
return results[0]

Expand Down
10 changes: 10 additions & 0 deletions examples/plans/battle/简单巡洋.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# MapLevel
map: 2 # 简单1-5 困难6-10
repair_mode: [1, 1, 1, 2, 2, 2]
# NodeLevel
node_args:
# 阵型选择阶段
formation: 2 # 正常情况阵型选择,1-5
# 夜战选择阶段
night: True # 是否夜战
SL_when_enter_fight: False # 是否在进入战斗时SL,如果要刷战术,建议设为True
10 changes: 10 additions & 0 deletions examples/plans/battle/简单战列.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# MapLevel
map: 3 # 简单1-5 困难6-10

# NodeLevel
node_args:
# 阵型选择阶段
formation: 5 # 正常情况阵型选择,1-5
# 夜战选择阶段
night: True # 是否夜战
SL_when_enter_fight: False # 是否在进入战斗时SL,如果要刷战术,建议设为True
9 changes: 9 additions & 0 deletions examples/plans/battle/简单潜艇.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# MapLevel
map: 5 # 简单1-5 困难6-10
repair_mode: 2

# NodeLevel
node_args:
# 夜战选择阶段
night: True # 是否夜战
SL_when_enter_fight: False # 是否在进入战斗时SL,如果要刷战术,建议设为True
11 changes: 11 additions & 0 deletions examples/plans/battle/简单航母.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# MapLevel
map: 4 # 简单1-5 困难6-10
repair_mode: [1, 1, 2, 2, 2, 2]

# NodeLevel
node_args:
# 阵型选择阶段
formation: 2 # 正常情况阵型选择,1-5
# 夜战选择阶段
night: True # 是否夜战
SL_when_enter_fight: False # 是否在进入战斗时SL,如果要刷战术,建议设为True
10 changes: 10 additions & 0 deletions examples/plans/battle/简单驱逐.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# MapLevel
map: 1 # 简单1-5 困难6-10

# NodeLevel
node_args:
# 阵型选择阶段
formation: 2 # 正常情况阵型选择,1-5
# 夜战选择阶段
night: True # 是否夜战
SL_when_enter_fight: False # 是否在进入战斗时SL,如果要刷战术,建议设为True

0 comments on commit ecc7944

Please sign in to comment.