diff --git a/app/src/main/assets/En/immobilized.png b/app/src/main/assets/En/immobilized.png new file mode 100644 index 000000000..b585397d5 Binary files /dev/null and b/app/src/main/assets/En/immobilized.png differ diff --git a/app/src/main/java/io/github/fate_grand_automata/util/ImageLoader.kt b/app/src/main/java/io/github/fate_grand_automata/util/ImageLoader.kt index 089a6a82f..0d9e52ec9 100644 --- a/app/src/main/java/io/github/fate_grand_automata/util/ImageLoader.kt +++ b/app/src/main/java/io/github/fate_grand_automata/util/ImageLoader.kt @@ -85,6 +85,7 @@ class ImageLoader @Inject constructor( Images.FPSummonContinue -> "fp_continue.png" Images.SkillTen -> "skill_ten.png" Images.Stun -> "stun.png" + Images.Immobilized -> "immobilized.png" Images.SelectedParty -> "selected_party.png" Images.SilverXP -> "SilverXP.png" Images.GoldXP -> "GoldXP.png" diff --git a/libautomata/src/main/java/io/github/lib_automata/AutomataApi.kt b/libautomata/src/main/java/io/github/lib_automata/AutomataApi.kt index 77edfca08..d73c56388 100644 --- a/libautomata/src/main/java/io/github/lib_automata/AutomataApi.kt +++ b/libautomata/src/main/java/io/github/lib_automata/AutomataApi.kt @@ -22,6 +22,8 @@ interface AutomataApi { operator fun Region.contains(image: Pattern) = exists(image) + operator fun Region.contains(images: Collection) = images.any { contains(it) } + fun Region.find( pattern: Pattern, similarity: Double? = null diff --git a/scripts/src/main/java/io/github/fate_grand_automata/scripts/Images.kt b/scripts/src/main/java/io/github/fate_grand_automata/scripts/Images.kt index 6309851cd..701b7f21b 100644 --- a/scripts/src/main/java/io/github/fate_grand_automata/scripts/Images.kt +++ b/scripts/src/main/java/io/github/fate_grand_automata/scripts/Images.kt @@ -37,6 +37,7 @@ enum class Images { FPSummonContinue, SkillTen, Stun, + Immobilized, SelectedParty, SilverXP, GoldXP, diff --git a/scripts/src/main/java/io/github/fate_grand_automata/scripts/entrypoints/AutoDetect.kt b/scripts/src/main/java/io/github/fate_grand_automata/scripts/entrypoints/AutoDetect.kt index f3386702b..58d6a3fc2 100644 --- a/scripts/src/main/java/io/github/fate_grand_automata/scripts/entrypoints/AutoDetect.kt +++ b/scripts/src/main/java/io/github/fate_grand_automata/scripts/entrypoints/AutoDetect.kt @@ -22,7 +22,7 @@ class AutoDetect @Inject constructor( images[Images.LotteryBoxFinished] in locations.lottery.checkRegion || images[Images.LotteryBoxFinished] in locations.lottery.finishedRegion -> ScriptModeEnum.Lottery - images[Images.GoldXP] in emberSearchRegion || images[Images.SilverXP] in emberSearchRegion -> + listOf(images[Images.GoldXP], images[Images.SilverXP]) in emberSearchRegion -> ScriptModeEnum.PresentBox locations.support.confirmSetupButtonRegion.exists(images[Images.SupportConfirmSetupButton], similarity = 0.75) -> diff --git a/scripts/src/main/java/io/github/fate_grand_automata/scripts/modules/CardParser.kt b/scripts/src/main/java/io/github/fate_grand_automata/scripts/modules/CardParser.kt index 3bf0e6370..f9685f1d0 100644 --- a/scripts/src/main/java/io/github/fate_grand_automata/scripts/modules/CardParser.kt +++ b/scripts/src/main/java/io/github/fate_grand_automata/scripts/modules/CardParser.kt @@ -38,7 +38,7 @@ class CardParser @Inject constructor( height = 188 ) - return images[Images.Stun] in stunRegion + return listOf(images[Images.Stun], images[Images.Immobilized]) in stunRegion } private fun CommandCard.Face.type(): CardTypeEnum {