Skip to content

Commit

Permalink
feat: 最后一个角色出战的时候是自动的,所以要额外添加角色被击败的判断
Browse files Browse the repository at this point in the history
  • Loading branch information
huiyadanli committed Aug 7, 2023
1 parent bff4c6f commit 52c06a1
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion GeniusInvokationAutoToy/Core/GameControl.cs
Original file line number Diff line number Diff line change
Expand Up @@ -921,7 +921,7 @@ public void WaitForMyTurn(Duel duel, int waitTime = 0)
}
else
{
// 多延迟2s // 保证阵亡提示已经完成显示
// 多延迟2s // 保证被击败提示已经完成显示
inMyActionCount++;
if (inMyActionCount == 3)
{
Expand Down Expand Up @@ -1162,6 +1162,12 @@ public void AppendCharacterStatus(Character character, Mat srcMat)

public Character WhichCharacterActiveWithRetry(Duel duel)
{
// 检查角色是否被击败 // 这里又检查一次是因为最后一个角色存活的情况下,会自动出战
bool[] defeatedArray = WhatCharacterDefeated(duel.CharacterCardRects);
for (int i = defeatedArray.Length - 1; i >= 0; i--)
{
duel.Characters[i + 1].IsDefeated = defeatedArray[i];
}
return Retry.Do(() => WhichCharacterActiveByHpWord(duel), TimeSpan.FromSeconds(0.3), 2);
}

Expand Down

0 comments on commit 52c06a1

Please sign in to comment.