Skip to content

Commit

Permalink
#180 修复无支援角色的情况
Browse files Browse the repository at this point in the history
  • Loading branch information
DoctorReid committed Feb 26, 2024
1 parent b108fbc commit 405d9f2
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/sr/operation/battle/choose_support.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
class ChooseSupport(StateOperation):

STATUS_SUPPORT_NOT_FOUND: ClassVar[str] = '未找到支援角色'
STATUS_SUPPORT_NO_NEED: ClassVar[str] = '无需支援角色'
STATUS_SUPPORT_NEEDED: ClassVar[str] = '需要支援角色'

def __init__(self, ctx: Context, character_id: Optional[str]):
"""
Expand All @@ -28,7 +28,7 @@ def __init__(self, ctx: Context, character_id: Optional[str]):
wait = StateOperationNode('等待画面加载', self._wait)

click_support = StateOperationNode('点击支援', self._click_support)
edges.append(StateOperationEdge(wait, click_support))
edges.append(StateOperationEdge(wait, click_support, status=ChooseSupport.STATUS_SUPPORT_NEEDED))

click_avatar = StateOperationNode('点击头像', self._click_avatar)
edges.append(StateOperationEdge(click_support, click_avatar))
Expand Down Expand Up @@ -60,9 +60,9 @@ def _wait(self) -> OperationOneRoundResult:
area = ScreenTeam.TEAM_TITLE.value
if self.find_area(area):
if self.character_id is None:
return Operation.round_success(ChooseSupport.STATUS_SUPPORT_NO_NEED)
else:
return Operation.round_success()
else:
return Operation.round_success(ChooseSupport.STATUS_SUPPORT_NEEDED)
else:
return Operation.round_retry('未在%s画面' % area.status, wait=1)

Expand Down

0 comments on commit 405d9f2

Please sign in to comment.