Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added app/src/main/assets/Cn/start_quest.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 app/src/main/assets/En/start_quest.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 app/src/main/assets/Jp/start_quest.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 app/src/main/assets/Kr/start_quest.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 app/src/main/assets/Tw/start_quest.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -76,9 +76,9 @@ class DroidCvPattern(
}

private fun match(template: Pattern): Mat? {
val result = Mat()
if (template is DroidCvPattern) {
if (template.width <= width && template.height <= height) {
val result = Mat()
Imgproc.matchTemplate(
mat,
template.mat,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,7 @@ class ImageLoader @Inject constructor(
Images.OkKR -> "ok-kr.png"
Images.Execute -> "execute.png"
Images.SupportBlankCE -> "support_blank_ce.png"
Images.StartQuest -> "start_quest.png"
}

override operator fun get(img: Images, gameServer: GameServer?): Pattern = synchronized(regionCachedPatterns) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,5 +88,6 @@ enum class Images {
*/
OkKR,
Execute,
SupportBlankCE
SupportBlankCE,
StartQuest
}
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ class AutoBattle @Inject constructor(
loop()
} catch (e: BattleExitException) {
throw ExitException(e.reason, makeExitState())
} catch (e: ScriptAbortException) {
} catch (_: ScriptAbortException) {
throw ExitException(ExitReason.Abort, makeExitState())
} catch (e: Exception) {
val reason = ExitReason.Unexpected(e)
Expand Down Expand Up @@ -339,10 +339,11 @@ class AutoBattle @Inject constructor(
locations.resultMatRewardsRegion.click()
}

private fun isInOrdealCallOutOfPodsScreen(): Boolean {
// Lock the Ordeal Call for JP server
if (prefs.gameServer !is GameServer.Jp) return false
private fun isInOrdealCallConfirmPodUseScreen(): Boolean {
return images[Images.StartQuest] in locations.ordealCallConfirmPodUseRegion
}

private fun isInOrdealCallOutOfPodsScreen(): Boolean {
return images[Images.Close] in locations.ordealCallOutOfPodsRegion
}

Expand Down Expand Up @@ -520,15 +521,18 @@ class AutoBattle @Inject constructor(

var closeScreen = false
var inventoryFull = false
var confirmPodUsage = false

useSameSnapIn {
closeScreen = isInOrdealCallOutOfPodsScreen()
inventoryFull = isInventoryFull()
confirmPodUsage = isInOrdealCallConfirmPodUseScreen()
}

when {
closeScreen -> throw BattleExitException(ExitReason.LimitRuns(state.runs))
inventoryFull -> throw BattleExitException(ExitReason.InventoryFull)
confirmPodUsage -> locations.ordealCallConfirmPodUseRegion.center.click()
}

refill.refill()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ class Locations @Inject constructor(

val inventoryFullRegion = Region(-280, 860, 560, 190).xFromCenter()

val ordealCallConfirmPodUseRegion = Region(190, 1096, 420, 62).xFromCenter()

val ordealCallOutOfPodsRegion = Region(-112, 1088, 219, 72).xFromCenter()

val ordealCallOutOfPodsClick = Location(-2, 1124).xFromCenter()
Expand Down