Просмотр исходного кода

feat(CostumeBattle): add battle theme 12 (招财纳福)

Add new battle theme support with win/lose detection assets:
- Add COSTUME_BATTLE_12 enum in config
- Add image.json and assets for battle12
- Update battle_theme_model to include theme 12
lhye 9 месяцев назад
Родитель
Сommit
586459efc1

+ 1 - 0
tasks/Component/Costume/config.py

@@ -68,6 +68,7 @@ class BattleType(str, Enum):
     COSTUME_BATTLE_9 = 'costume_battle_9'  # 莲华圣域
     COSTUME_BATTLE_10 = 'costume_battle_10'  # 流焰蝶舞
     COSTUME_BATTLE_11 = 'costume_battle_11'  # 辰烁奇夜
+    COSTUME_BATTLE_12 = 'costume_battle_12'  # 招财纳福
 
 
 

+ 7 - 1
tasks/Component/Costume/costume_base.py

@@ -56,7 +56,7 @@ carpbanner_costume_model = {
 
 # 战斗主题(使用循环处理常规情况 + 特例处理)
 battle_theme_model = {}
-for i in range(1, 12):
+for i in range(1, 13):
     entry = {
         'I_LOCAL': f'I_LOCAL_{i}',
         'I_EXIT': f'I_EXIT_{i}',
@@ -68,6 +68,12 @@ for i in range(1, 12):
             'I_DE_WIN': 'I_DE_WIN_8',
             'I_FALSE': 'I_FALSE_8'
         })
+    if i == 12:  # 特殊处理第12项
+        entry.update({
+            'I_WIN': 'I_WIN_12',
+            'I_DE_WIN': 'I_DE_WIN_12',
+            'I_FALSE': 'I_FALSE_12'
+        })
     battle_theme_model[getattr(BattleType, f"COSTUME_BATTLE_{i}")] = entry
 
 # 幕间主题

+ 15 - 0
tasks/Component/CostumeBattle/assets.py

@@ -115,3 +115,18 @@ class CostumeBattleAssets:
 	I_LOCAL_9 = RuleImage(roi_front=(114,489,37,37), roi_back=(114,489,37,37), threshold=0.8, method="Template matching", file="./tasks/Component/CostumeBattle/battle9/battle9_local_9.png")
 
 
+	# Image Rule Assets
+	# 左上角退出 
+	I_EXIT_12 = RuleImage(roi_front=(16,15,22,25), roi_back=(16,15,40,40), threshold=0.8, method="Template matching", file="./tasks/Component/CostumeBattle/battle12/battle12_exit_12.png")
+	# 左上角好友 
+	I_FRIENDS_12 = RuleImage(roi_front=(90,14,22,30), roi_back=(90,14,40,40), threshold=0.8, method="Template matching", file="./tasks/Component/CostumeBattle/battle12/battle12_friends_12.png")
+	# 指针 
+	I_LOCAL_12 = RuleImage(roi_front=(29,566,28,28), roi_back=(29,566,40,40), threshold=0.8, method="Template matching", file="./tasks/Component/CostumeBattle/battle12/battle12_local_12.png")
+	# 战斗胜利 
+	I_WIN_12 = RuleImage(roi_front=(390,30,46,88), roi_back=(390,30,510,290), threshold=0.8, method="Template matching", file="./tasks/Component/CostumeBattle/battle12/battle12_win_12.png")
+	# 针对封魔的特殊 
+	I_DE_WIN_12 = RuleImage(roi_front=(390,30,46,88), roi_back=(390,30,510,290), threshold=0.8, method="Template matching", file="./tasks/Component/CostumeBattle/battle12/battle12_de_win_12.png")
+	# 失败 
+	I_FALSE_12 = RuleImage(roi_front=(390,30,58,86), roi_back=(390,30,510,290), threshold=0.8, method="Template matching", file="./tasks/Component/CostumeBattle/battle12/battle12_false_12.png")
+
+

BIN
tasks/Component/CostumeBattle/battle12/battle12_de_win_12.png


BIN
tasks/Component/CostumeBattle/battle12/battle12_exit_12.png


BIN
tasks/Component/CostumeBattle/battle12/battle12_false_12.png


BIN
tasks/Component/CostumeBattle/battle12/battle12_friends_12.png


BIN
tasks/Component/CostumeBattle/battle12/battle12_local_12.png


BIN
tasks/Component/CostumeBattle/battle12/battle12_win_12.png


+ 56 - 0
tasks/Component/CostumeBattle/battle12/image.json

@@ -0,0 +1,56 @@
+[
+  {
+    "itemName": "exit_12",
+    "imageName": "battle12_exit_12.png",
+    "roiFront": "16,15,22,25",
+    "roiBack": "16,15,40,40",
+    "method": "Template matching",
+    "threshold": 0.8,
+    "description": "左上角退出"
+  },
+  {
+    "itemName": "friends_12",
+    "imageName": "battle12_friends_12.png",
+    "roiFront": "90,14,22,30",
+    "roiBack": "90,14,40,40",
+    "method": "Template matching",
+    "threshold": 0.8,
+    "description": "左上角好友"
+  },
+  {
+    "itemName": "local_12",
+    "imageName": "battle12_local_12.png",
+    "roiFront": "29,566,28,28",
+    "roiBack": "29,566,40,40",
+    "method": "Template matching",
+    "threshold": 0.8,
+    "description": "指针"
+  },
+  {
+    "itemName": "win_12",
+    "imageName": "battle12_win_12.png",
+    "roiFront": "390,30,46,88",
+    "roiBack": "390,30,510,290",
+    "method": "Template matching",
+    "threshold": 0.8,
+    "description": "战斗胜利"
+  },
+  {
+    "itemName": "de_win_12",
+    "imageName": "battle12_de_win_12.png",
+    "roiFront": "390,30,46,88",
+    "roiBack": "390,30,510,290",
+    "method": "Template matching",
+    "threshold": 0.8,
+    "description": "针对封魔的特殊"
+  },
+  {
+    "itemName": "false_12",
+    "imageName": "battle12_false_12.png",
+    "roiFront": "390,30,58,86",
+    "roiBack": "390,30,510,290",
+    "method": "Template matching",
+    "threshold": 0.8,
+    "description": "失败"
+  }
+]