Fix: predict_enemy_genre in t4 of event_20241024_cn (#4352)

This commit is contained in:
Hao Guo 2024-11-06 18:25:22 +08:00 committed by GitHub
parent 0d0aff44c0
commit 29b1e8b19c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -1,8 +1,10 @@
from .campaign_base import CampaignBase, EventGrid
from module.base.utils import color_similarity_2d
from .campaign_base import CampaignBase, EventGrid as Grid
from module.map.map_base import CampaignMap
from module.map.map_grids import SelectedGrids, RoadGrids
from module.logger import logger
from .t1 import Config as ConfigBase
from module.template.assets import TEMPLATE_ENEMY_BOSS
MAP = CampaignMap('T4')
MAP.shape = 'J8'
@ -78,6 +80,20 @@ class Config(ConfigBase):
MAP_SWIPE_MULTIPLY_MAATOUCH = (1.186, 1.208)
class EventGrid(Grid):
def predict_enemy_genre(self):
if self.enemy_scale:
return ''
image = self.relative_crop((-0, -0.2, 0.8, 0.2), shape=(40, 20))
image = color_similarity_2d(image, color=(255, 190, 84))
if image[image > 221].shape[0] > 30:
if TEMPLATE_ENEMY_BOSS.match(image, similarity=0.6, scaling=0.5):
return 'Siren_Siren'
return super().predict_enemy_genre()
class Campaign(CampaignBase):
MAP = MAP
ENEMY_FILTER = '1L > 1M > 1E > 1C > 2L > 2M > 2E > 2C > 3L > 3M > 3E > 3C'