Skip to content

Commit

Permalink
Only skip wave animations in battle (#1729)
Browse files Browse the repository at this point in the history
  • Loading branch information
ArthurKun21 authored Dec 31, 2023
1 parent d4cc5e8 commit afdad9c
Showing 1 changed file with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -87,8 +87,8 @@ class AutoBattle @Inject constructor(
// for tracking whether the story skip button could be visible in the current screen
private var storySkipPossible = true

// for tracking whether to check for servant deaths or not
private var servantDeathPossible = false
// for tracking whether to check for servant death and wave transition animations
private var isInBattle = false

override fun script(): Nothing {
try {
Expand Down Expand Up @@ -175,8 +175,8 @@ class AutoBattle @Inject constructor(
{ connectionRetry.needsToRetry() } to { connectionRetry.retry() },
{ battle.isIdle() } to {
storySkipPossible = false
isInBattle = true
battle.performBattle()
servantDeathPossible = true
},
{ isInMenu() } to { menu() },
{ isStartingNp() } to { skipNp() },
Expand Down Expand Up @@ -270,7 +270,7 @@ class AutoBattle @Inject constructor(
images[Images.CEDetails] in locations.resultCeRewardDetailsRegion

private fun isDeathAnimation() =
servantDeathPossible && FieldSlot.list
isInBattle && FieldSlot.list
.map { locations.battle.servantPresentRegion(it) }
.count { it.exists(images[Images.ServantExist], similarity = 0.70) } in 1..2

Expand All @@ -289,7 +289,7 @@ class AutoBattle @Inject constructor(
* Clicks through the reward screens.
*/
private fun result() {
servantDeathPossible = false
isInBattle = false
locations.resultClick.click(15)
storySkipPossible = true
}
Expand Down Expand Up @@ -430,7 +430,7 @@ class AutoBattle @Inject constructor(
* Black screen probably means we're between waves.
*/
private fun isBetweenWaves() =
locations.npStartedRegion.isBlack()
isInBattle && locations.npStartedRegion.isBlack()

/**
* Taps in the bottom right a few times to trigger NP skip in BetterFGO.
Expand Down

0 comments on commit afdad9c

Please sign in to comment.