Add: Dorm reward
- Dorm reward use minitouch, ignores control method settings - Merge oil reward and mission reward into "General"
BIN
assets/cn/reward/DORM_FEED_CHECK.png
Normal file
After Width: | Height: | Size: 9.0 KiB |
BIN
assets/cn/reward/DORM_FEED_ENTER.png
Normal file
After Width: | Height: | Size: 9.2 KiB |
BIN
assets/cn/reward/OCR_DORM_FILL.png
Normal file
After Width: | Height: | Size: 7.5 KiB |
BIN
assets/cn/template/TEMPLATE_DORM_COIN.gif
Normal file
After Width: | Height: | Size: 11 KiB |
BIN
assets/cn/template/TEMPLATE_DORM_LOVE.gif
Normal file
After Width: | Height: | Size: 5.3 KiB |
BIN
assets/en/template/TEMPLATE_DORM_COIN.gif
Normal file
After Width: | Height: | Size: 11 KiB |
BIN
assets/en/template/TEMPLATE_DORM_LOVE.gif
Normal file
After Width: | Height: | Size: 5.3 KiB |
BIN
assets/jp/template/TEMPLATE_DORM_COIN.gif
Normal file
After Width: | Height: | Size: 11 KiB |
BIN
assets/jp/template/TEMPLATE_DORM_LOVE.gif
Normal file
After Width: | Height: | Size: 5.3 KiB |
BIN
assets/mask/MASK_DORM.png
Normal file
After Width: | Height: | Size: 9.6 KiB |
@ -69,6 +69,10 @@ enable_coin_reward = yes
|
||||
enable_mission_reward = yes
|
||||
enable_commission_reward = yes
|
||||
enable_tactical_reward = yes
|
||||
enable_dorm_reward = no
|
||||
enable_dorm_collect = yes
|
||||
dorm_interval = 278, 480
|
||||
dorm_feed_filter = 20000 > 10000 > 5000 > 3000 > 2000 > 1000
|
||||
commission_time_limit = 0
|
||||
duration_shorter_than_2 = 11
|
||||
duration_longer_than_6 = -11
|
||||
@ -199,6 +203,7 @@ exercise_count = 0
|
||||
|
||||
[RewardRecord]
|
||||
meowfficer = 2020-01-01_00:00:00
|
||||
dorm = 2020-01-01_00:00:00
|
||||
|
||||
[EventABRecord]
|
||||
a1 = 2020-01-01_00:00:00
|
||||
|
@ -233,12 +233,16 @@ def main(ini_name=''):
|
||||
reward_condition.add_argument('--收菜间隔关闭游戏', default=default('--收菜间隔关闭游戏'), choices=['是', '否'], gooey_options={'label_color': '#4B5F83'})
|
||||
reward_condition.add_argument('--启用每日收获', default=default('--启用每日收获'), choices=['是', '否'], help='将每日任务困难演习作为收获的一部分来运行', gooey_options={'label_color': '#4B5F83'})
|
||||
|
||||
reward_oil = reward_parser.add_argument_group('石油物资', '', gooey_options={'label_color': '#931D03'})
|
||||
reward_oil.add_argument('--启用石油收获', default=default('--启用石油收获'), choices=['是', '否'], gooey_options={'label_color': '#4B5F83'})
|
||||
reward_oil.add_argument('--启用物资收获', default=default('--启用物资收获'), choices=['是', '否'], gooey_options={'label_color': '#4B5F83'})
|
||||
reward_general = reward_parser.add_argument_group('日常收获', '', gooey_options={'label_color': '#931D03'})
|
||||
reward_general.add_argument('--启用石油收获', default=default('--启用石油收获'), choices=['是', '否'], gooey_options={'label_color': '#4B5F83'})
|
||||
reward_general.add_argument('--启用物资收获', default=default('--启用物资收获'), choices=['是', '否'], gooey_options={'label_color': '#4B5F83'})
|
||||
reward_general.add_argument('--启用任务收获', default=default('--启用任务收获'), choices=['是', '否'], gooey_options={'label_color': '#4B5F83'})
|
||||
|
||||
reward_mission = reward_parser.add_argument_group('任务奖励', '', gooey_options={'label_color': '#931D03'})
|
||||
reward_mission.add_argument('--启用任务收获', default=default('--启用任务收获'), choices=['是', '否'], gooey_options={'label_color': '#4B5F83'})
|
||||
reward_dorm = reward_parser.add_argument_group('后宅设置', '', gooey_options={'label_color': '#931D03'})
|
||||
reward_dorm.add_argument('--启用后宅收获', default=default('--启用后宅收获'), choices=['是', '否'], help='后宅喂食', gooey_options={'label_color': '#4B5F83'})
|
||||
reward_dorm.add_argument('--启用后宅收集', default=default('--启用后宅收集'), choices=['是', '否'], help='后宅收爱心收家具币', gooey_options={'label_color': '#4B5F83'})
|
||||
reward_dorm.add_argument('--后宅收获间隔', default=default('--后宅收获间隔'), help='每隔多少分钟触发, 推荐使用时间区间, 比如"10, 40"\n后宅六船时, 使用六种食物分别需要间隔大于\n(14, 28, 42, 70, 139, 278)', gooey_options={'label_color': '#4B5F83'})
|
||||
reward_dorm.add_argument('--后宅喂食优先', default=default('--后宅喂食优先'), help='仿照科研过滤字符串', gooey_options={'label_color': '#4B5F83'})
|
||||
|
||||
reward_commission = reward_parser.add_argument_group('委托设置', '', gooey_options={'label_color': '#931D03'})
|
||||
reward_commission.add_argument('--启用委托收获', default=default('--启用委托收获'), choices=['是', '否'], gooey_options={'label_color': '#4B5F83'})
|
||||
|
@ -239,12 +239,17 @@ def main(ini_name=''):
|
||||
reward_condition.add_argument('--enable_daily_reward', default=default('--enable_daily_reward'), choices=['yes', 'no'],
|
||||
help='Run daily as a part of reward', gooey_options={'label_color': '#4B5F83'})
|
||||
|
||||
reward_oil = reward_parser.add_argument_group('Oil supplies', '', gooey_options={'label_color': '#931D03'})
|
||||
reward_oil.add_argument('--enable_oil_reward', default=default('--enable_oil_reward'), choices=['yes', 'no'], gooey_options={'label_color': '#4B5F83'})
|
||||
reward_oil.add_argument('--enable_coin_reward', default=default('--enable_coin_reward'), choices=['yes', 'no'], gooey_options={'label_color': '#4B5F83'})
|
||||
reward_general = reward_parser.add_argument_group('General', '', gooey_options={'label_color': '#931D03'})
|
||||
reward_general.add_argument('--enable_oil_reward', default=default('--enable_oil_reward'), choices=['yes', 'no'], gooey_options={'label_color': '#4B5F83'})
|
||||
reward_general.add_argument('--enable_coin_reward', default=default('--enable_coin_reward'), choices=['yes', 'no'], gooey_options={'label_color': '#4B5F83'})
|
||||
reward_general.add_argument('--enable_mission_reward', default=default('--enable_mission_reward'), choices=['yes', 'no'], gooey_options={'label_color': '#4B5F83'})
|
||||
|
||||
reward_mission = reward_parser.add_argument_group('mission rewards', '', gooey_options={'label_color': '#931D03'})
|
||||
reward_mission.add_argument('--enable_mission_reward', default=default('--enable_mission_reward'), choices=['yes', 'no'], gooey_options={'label_color': '#4B5F83'})
|
||||
reward_dorm = reward_parser.add_argument_group('Dorm', '', gooey_options={'label_color': '#931D03'})
|
||||
reward_dorm.add_argument('--enable_dorm_reward', default=default('--enable_dorm_reward'), choices=['yes', 'no'], help='Dorm feed', gooey_options={'label_color': '#4B5F83'})
|
||||
reward_dorm.add_argument('--enable_dorm_collect', default=default('--enable_dorm_collect'), choices=['yes', 'no'], help='Collect coins and loves', gooey_options={'label_color': '#4B5F83'})
|
||||
reward_dorm.add_argument('--dorm_interval', default=default('--dorm_interval'),
|
||||
help='How many minutes to trigger collection. Recommend to set a time range, such as "10, 40"\nIf 6 ships in dorm, to use 6 kind of food, interval needs to greater than (14, 28, 42, 70, 139, 278)', gooey_options={'label_color': '#4B5F83'})
|
||||
reward_dorm.add_argument('--dorm_feed_filter', default=default('--dorm_feed_filter'), help='Like research filter string', gooey_options={'label_color': '#4B5F83'})
|
||||
|
||||
reward_commission = reward_parser.add_argument_group('Commission settings', '', gooey_options={'label_color': '#931D03'})
|
||||
reward_commission.add_argument('--enable_commission_reward', default=default('--enable_commission_reward'), choices=['yes', 'no'], gooey_options={'label_color': '#4B5F83'})
|
||||
|
@ -239,12 +239,17 @@ def main(ini_name=''):
|
||||
reward_condition.add_argument('--enable_daily_reward', default=default('--enable_daily_reward'), choices=['yes', 'no'],
|
||||
help='Run daily as a part of reward', gooey_options={'label_color': '#4B5F83'})
|
||||
|
||||
reward_oil = reward_parser.add_argument_group('Oil supplies', '', gooey_options={'label_color': '#931D03'})
|
||||
reward_oil.add_argument('--enable_oil_reward', default=default('--enable_oil_reward'), choices=['yes', 'no'], gooey_options={'label_color': '#4B5F83'})
|
||||
reward_oil.add_argument('--enable_coin_reward', default=default('--enable_coin_reward'), choices=['yes', 'no'], gooey_options={'label_color': '#4B5F83'})
|
||||
reward_general = reward_parser.add_argument_group('General', '', gooey_options={'label_color': '#931D03'})
|
||||
reward_general.add_argument('--enable_oil_reward', default=default('--enable_oil_reward'), choices=['yes', 'no'], gooey_options={'label_color': '#4B5F83'})
|
||||
reward_general.add_argument('--enable_coin_reward', default=default('--enable_coin_reward'), choices=['yes', 'no'], gooey_options={'label_color': '#4B5F83'})
|
||||
reward_general.add_argument('--enable_mission_reward', default=default('--enable_mission_reward'), choices=['yes', 'no'], gooey_options={'label_color': '#4B5F83'})
|
||||
|
||||
reward_mission = reward_parser.add_argument_group('mission rewards', '', gooey_options={'label_color': '#931D03'})
|
||||
reward_mission.add_argument('--enable_mission_reward', default=default('--enable_mission_reward'), choices=['yes', 'no'], gooey_options={'label_color': '#4B5F83'})
|
||||
reward_dorm = reward_parser.add_argument_group('Dorm', '', gooey_options={'label_color': '#931D03'})
|
||||
reward_dorm.add_argument('--enable_dorm_reward', default=default('--enable_dorm_reward'), choices=['yes', 'no'], help='Dorm feed', gooey_options={'label_color': '#4B5F83'})
|
||||
reward_dorm.add_argument('--enable_dorm_collect', default=default('--enable_dorm_collect'), choices=['yes', 'no'], help='Collect coins and loves', gooey_options={'label_color': '#4B5F83'})
|
||||
reward_dorm.add_argument('--dorm_interval', default=default('--dorm_interval'),
|
||||
help='How many minutes to trigger collection. Recommend to set a time range, such as "10, 40"\nIf 6 ships in dorm, to use 6 kind of food, interval needs to greater than (14, 28, 42, 70, 139, 278)', gooey_options={'label_color': '#4B5F83'})
|
||||
reward_dorm.add_argument('--dorm_feed_filter', default=default('--dorm_feed_filter'), help='Like research filter string', gooey_options={'label_color': '#4B5F83'})
|
||||
|
||||
reward_commission = reward_parser.add_argument_group('Commission settings', '', gooey_options={'label_color': '#931D03'})
|
||||
reward_commission.add_argument('--enable_commission_reward', default=default('--enable_commission_reward'), choices=['yes', 'no'], gooey_options={'label_color': '#4B5F83'})
|
||||
|
@ -408,6 +408,13 @@ class AzurLaneConfig:
|
||||
|
||||
BUY_MEOWFFICER = 0 # 0 to 15.
|
||||
|
||||
ENABLE_DORM_COLLECT = True
|
||||
ENABLE_DORM_REWARD = True
|
||||
# When having 6 ships in dorm, to use 6 kind of food, need interval (in minutes) greater than:
|
||||
# (14, 28, 42, 70, 139, 278)
|
||||
DORM_INTERVAL = '278, 480' # str, such as '20', '10, 40'.
|
||||
DORM_FEED_FILTER = '20000 > 10000 > 5000 > 3000 > 2000 > 1000'
|
||||
|
||||
"""
|
||||
module.research
|
||||
"""
|
||||
@ -568,6 +575,7 @@ class AzurLaneConfig:
|
||||
self.REWARD_INTERVAL = option['reward_interval']
|
||||
self.REWARD_STOP_GAME_DURING_INTERVAL = to_bool(option['reward_stop_game_during_interval'])
|
||||
for attr in ['enable_reward', 'enable_oil_reward', 'enable_coin_reward', 'enable_mission_reward',
|
||||
'enable_dorm_reward', 'enable_dorm_collect',
|
||||
'enable_commission_reward', 'enable_tactical_reward', 'enable_daily_reward',
|
||||
'enable_research_reward']:
|
||||
self.__setattr__(attr.upper(), to_bool(option[attr]))
|
||||
@ -577,6 +585,8 @@ class AzurLaneConfig:
|
||||
self.COMMISSION_TIME_LIMIT = 0
|
||||
for attr in self.COMMISSION_PRIORITY.keys():
|
||||
self.COMMISSION_PRIORITY[attr] = int(option[attr])
|
||||
self.DORM_INTERVAL = option['dorm_interval']
|
||||
self.DORM_FEED_FILTER = option['dorm_feed_filter']
|
||||
self.TACTICAL_BOOK_TIER_MAX = int(option['tactical_book_tier_max'])
|
||||
self.TACTICAL_BOOK_TIER_MIN = int(option['tactical_book_tier_min'])
|
||||
self.TACTICAL_EXP_FIRST = to_bool(option['tactical_exp_first'])
|
||||
|
@ -111,6 +111,10 @@ dic_true_eng_to_eng = {
|
||||
'enable_mission_reward': 'enable_mission_reward',
|
||||
'enable_commission_reward': 'enable_commission_reward',
|
||||
'enable_tactical_reward': 'enable_tactical_reward',
|
||||
'enable_dorm_reward': 'enable_dorm_reward',
|
||||
'enable_dorm_collect': 'enable_dorm_collect',
|
||||
'dorm_interval': 'dorm_interval',
|
||||
'dorm_feed_filter': 'dorm_feed_filter',
|
||||
'commission_time_limit': 'commission_time_limit',
|
||||
'duration_shorter_than_2': 'duration_shorter_than_2',
|
||||
'duration_longer_than_6': 'duration_longer_than_6',
|
||||
@ -350,6 +354,10 @@ dic_chi_to_eng = {
|
||||
'启用任务收获': 'enable_mission_reward',
|
||||
'启用委托收获': 'enable_commission_reward',
|
||||
'启用战术学院收获': 'enable_tactical_reward',
|
||||
'启用后宅收获': 'enable_dorm_reward',
|
||||
'启用后宅收集': 'enable_dorm_collect',
|
||||
'后宅收获间隔': 'dorm_interval',
|
||||
'后宅喂食优先': 'dorm_feed_filter',
|
||||
'委托时间限制': 'commission_time_limit',
|
||||
'委托耗时小于2h': 'duration_shorter_than_2',
|
||||
'委托耗时超过6h': 'duration_longer_than_6',
|
||||
|
@ -15,6 +15,8 @@ COMMISSION_SCROLL_TOP = Button(area={'cn': (1254, 81, 1261, 88), 'en': (1254, 81
|
||||
COMMISSION_START = Button(area={'cn': (1028, 322, 1156, 383), 'en': (1031, 333, 1147, 383), 'jp': (1029, 328, 1155, 387)}, color={'cn': (229, 175, 113), 'en': (227, 169, 108), 'jp': (230, 177, 119)}, button={'cn': (1028, 322, 1156, 383), 'en': (1031, 333, 1147, 383), 'jp': (1029, 328, 1155, 387)}, file={'cn': './assets/cn/reward/COMMISSION_START.png', 'en': './assets/en/reward/COMMISSION_START.png', 'jp': './assets/jp/reward/COMMISSION_START.png'})
|
||||
COMMISSION_STOP_SCROLLING = Button(area={'cn': (115, 236, 179, 487), 'en': (115, 236, 179, 487), 'jp': (115, 236, 179, 487)}, color={'cn': (50, 55, 74), 'en': (50, 55, 74), 'jp': (50, 55, 74)}, button={'cn': (115, 236, 179, 487), 'en': (115, 236, 179, 487), 'jp': (115, 236, 179, 487)}, file={'cn': './assets/cn/reward/COMMISSION_STOP_SCROLLING.png', 'en': './assets/en/reward/COMMISSION_STOP_SCROLLING.png', 'jp': './assets/jp/reward/COMMISSION_STOP_SCROLLING.png'})
|
||||
COMMISSION_URGENT = Button(area={'cn': (35, 231, 68, 281), 'en': (28, 221, 76, 283), 'jp': (34, 266, 68, 279)}, color={'cn': (215, 188, 124), 'en': (169, 138, 95), 'jp': (216, 190, 111)}, button={'cn': (35, 231, 68, 281), 'en': (28, 221, 76, 283), 'jp': (34, 266, 68, 279)}, file={'cn': './assets/cn/reward/COMMISSION_URGENT.png', 'en': './assets/en/reward/COMMISSION_URGENT.png', 'jp': './assets/jp/reward/COMMISSION_URGENT.png'})
|
||||
DORM_FEED_CHECK = Button(area={'cn': (328, 247, 390, 279), 'en': (328, 247, 390, 279), 'jp': (328, 247, 390, 279)}, color={'cn': (173, 124, 121), 'en': (173, 124, 121), 'jp': (173, 124, 121)}, button={'cn': (328, 247, 390, 279), 'en': (328, 247, 390, 279), 'jp': (328, 247, 390, 279)}, file={'cn': './assets/cn/reward/DORM_FEED_CHECK.png', 'en': './assets/cn/reward/DORM_FEED_CHECK.png', 'jp': './assets/cn/reward/DORM_FEED_CHECK.png'})
|
||||
DORM_FEED_ENTER = Button(area={'cn': (64, 623, 127, 655), 'en': (64, 623, 127, 655), 'jp': (64, 623, 127, 655)}, color={'cn': (182, 142, 136), 'en': (182, 142, 136), 'jp': (182, 142, 136)}, button={'cn': (64, 623, 127, 655), 'en': (64, 623, 127, 655), 'jp': (64, 623, 127, 655)}, file={'cn': './assets/cn/reward/DORM_FEED_ENTER.png', 'en': './assets/cn/reward/DORM_FEED_ENTER.png', 'jp': './assets/cn/reward/DORM_FEED_ENTER.png'})
|
||||
EXP_INFO_S_REWARD = Button(area={'cn': (498, 140, 557, 154), 'en': (1138, 40, 1266, 145), 'jp': (498, 140, 557, 154)}, color={'cn': (233, 241, 127), 'en': (89, 115, 159), 'jp': (233, 241, 127)}, button={'cn': (498, 140, 557, 154), 'en': (1138, 40, 1266, 145), 'jp': (498, 140, 557, 154)}, file={'cn': './assets/cn/reward/EXP_INFO_S_REWARD.png', 'en': './assets/en/reward/EXP_INFO_S_REWARD.png', 'jp': './assets/jp/reward/EXP_INFO_S_REWARD.png'})
|
||||
MEOWFFICER_BUY = Button(area={'cn': (864, 461, 957, 493), 'en': (864, 460, 957, 492), 'jp': (864, 461, 957, 493)}, color={'cn': (241, 217, 105), 'en': (231, 207, 105), 'jp': (241, 217, 105)}, button={'cn': (864, 461, 957, 493), 'en': (864, 460, 957, 492), 'jp': (864, 461, 957, 493)}, file={'cn': './assets/cn/reward/MEOWFFICER_BUY.png', 'en': './assets/en/reward/MEOWFFICER_BUY.png', 'jp': './assets/cn/reward/MEOWFFICER_BUY.png'})
|
||||
MEOWFFICER_BUY_CONFIRM = Button(area={'cn': (741, 434, 827, 468), 'en': (747, 438, 821, 463), 'jp': (741, 434, 827, 468)}, color={'cn': (239, 216, 107), 'en': (222, 197, 97), 'jp': (239, 216, 107)}, button={'cn': (741, 434, 827, 468), 'en': (747, 438, 821, 463), 'jp': (741, 434, 827, 468)}, file={'cn': './assets/cn/reward/MEOWFFICER_BUY_CONFIRM.png', 'en': './assets/en/reward/MEOWFFICER_BUY_CONFIRM.png', 'jp': './assets/cn/reward/MEOWFFICER_BUY_CONFIRM.png'})
|
||||
@ -25,6 +27,7 @@ MEOWFFICER_BUY_SKIP = Button(area={'cn': (594, 462, 687, 494), 'en': (594, 462,
|
||||
MISSION_MULTI = Button(area={'cn': (1041, 8, 1101, 39), 'en': (1041, 8, 1101, 39), 'jp': (1042, 7, 1100, 34)}, color={'cn': (226, 192, 142), 'en': (221, 179, 96), 'jp': (222, 182, 117)}, button={'cn': (1041, 8, 1101, 39), 'en': (1041, 8, 1101, 39), 'jp': (1042, 7, 1100, 34)}, file={'cn': './assets/cn/reward/MISSION_MULTI.png', 'en': './assets/en/reward/MISSION_MULTI.png', 'jp': './assets/jp/reward/MISSION_MULTI.png'})
|
||||
MISSION_NOTICE = Button(area={'cn': (940, 670, 945, 681), 'en': (940, 670, 945, 681), 'jp': (940, 670, 945, 681)}, color={'cn': (183, 83, 66), 'en': (183, 83, 66), 'jp': (183, 83, 66)}, button={'cn': (940, 670, 945, 681), 'en': (940, 670, 945, 681), 'jp': (940, 670, 945, 681)}, file={'cn': './assets/cn/reward/MISSION_NOTICE.png', 'en': './assets/en/reward/MISSION_NOTICE.png', 'jp': './assets/jp/reward/MISSION_NOTICE.png'})
|
||||
MISSION_SINGLE = Button(area={'cn': (1093, 118, 1179, 177), 'en': (1093, 118, 1179, 177), 'jp': (1102, 130, 1167, 158)}, color={'cn': (115, 155, 218), 'en': (106, 147, 215), 'jp': (136, 176, 229)}, button={'cn': (1093, 118, 1179, 177), 'en': (1093, 118, 1179, 177), 'jp': (1102, 130, 1167, 158)}, file={'cn': './assets/cn/reward/MISSION_SINGLE.png', 'en': './assets/en/reward/MISSION_SINGLE.png', 'jp': './assets/jp/reward/MISSION_SINGLE.png'})
|
||||
OCR_DORM_FILL = Button(area={'cn': (653, 255, 793, 279), 'en': (653, 255, 793, 279), 'jp': (653, 255, 793, 279)}, color={'cn': (156, 152, 149), 'en': (156, 152, 149), 'jp': (156, 152, 149)}, button={'cn': (653, 255, 793, 279), 'en': (653, 255, 793, 279), 'jp': (653, 255, 793, 279)}, file={'cn': './assets/cn/reward/OCR_DORM_FILL.png', 'en': './assets/cn/reward/OCR_DORM_FILL.png', 'jp': './assets/cn/reward/OCR_DORM_FILL.png'})
|
||||
OCR_MEOWFFICER = Button(area={'cn': (1032, 670, 1076, 694), 'en': (1032, 670, 1076, 694), 'jp': (1032, 670, 1076, 694)}, color={'cn': (220, 206, 196), 'en': (220, 206, 196), 'jp': (220, 206, 196)}, button={'cn': (1032, 670, 1076, 694), 'en': (1032, 670, 1076, 694), 'jp': (1032, 670, 1076, 694)}, file={'cn': './assets/cn/reward/OCR_MEOWFFICER.png', 'en': './assets/en/reward/OCR_MEOWFFICER.png', 'jp': './assets/cn/reward/OCR_MEOWFFICER.png'})
|
||||
OCR_MEOWFFICER_CHOOSE = Button(area={'cn': (858, 280, 918, 305), 'en': (858, 280, 918, 305), 'jp': (858, 280, 918, 305)}, color={'cn': (243, 240, 237), 'en': (243, 240, 237), 'jp': (243, 240, 237)}, button={'cn': (858, 280, 918, 305), 'en': (858, 280, 918, 305), 'jp': (858, 280, 918, 305)}, file={'cn': './assets/cn/reward/OCR_MEOWFFICER_CHOOSE.png', 'en': './assets/en/reward/OCR_MEOWFFICER_CHOOSE.png', 'jp': './assets/cn/reward/OCR_MEOWFFICER_CHOOSE.png'})
|
||||
OCR_MEOWFFICER_COINS = Button(area={'cn': (1161, 20, 1261, 48), 'en': (1161, 20, 1261, 48), 'jp': (1161, 20, 1261, 48)}, color={'cn': (200, 198, 192), 'en': (200, 198, 192), 'jp': (200, 198, 192)}, button={'cn': (1161, 20, 1261, 48), 'en': (1161, 20, 1261, 48), 'jp': (1161, 20, 1261, 48)}, file={'cn': './assets/cn/reward/OCR_MEOWFFICER_COINS.png', 'en': './assets/en/reward/OCR_MEOWFFICER_COINS.png', 'jp': './assets/cn/reward/OCR_MEOWFFICER_COINS.png'})
|
||||
|
237
module/reward/dorm.py
Normal file
@ -0,0 +1,237 @@
|
||||
import re
|
||||
from datetime import datetime, timedelta
|
||||
|
||||
from module.base.button import ButtonGrid
|
||||
from module.base.decorator import cached_property
|
||||
from module.base.filter import Filter
|
||||
from module.base.mask import Mask
|
||||
from module.base.timer import Timer
|
||||
from module.base.utils import *
|
||||
from module.logger import logger
|
||||
from module.map_detection.utils import Points
|
||||
from module.ocr.ocr import Digit, DigitCounter
|
||||
from module.reward.assets import *
|
||||
from module.template.assets import TEMPLATE_DORM_COIN, TEMPLATE_DORM_LOVE
|
||||
from module.ui.assets import DORM_CHECK
|
||||
from module.ui.page import page_dorm
|
||||
from module.ui.ui import UI
|
||||
|
||||
MASK_DORM = Mask(file='./assets/mask/MASK_DORM.png')
|
||||
DORM_CAMERA_SWIPE = (300, 250)
|
||||
DORM_CAMERA_RANDOM = (-20, -20, 20, 20)
|
||||
RECORD = ('RewardRecord', 'dorm')
|
||||
FOOD = ButtonGrid(origin=(295, 375), delta=(156, 0), button_shape=(118, 79), grid_shape=(6, 1), name='FOOD')
|
||||
FOOD_AMOUNT = ButtonGrid(
|
||||
origin=(343, 411), delta=(156, 0), button_shape=(70, 33), grid_shape=(6, 1), name='FOOD_AMOUNT')
|
||||
OCR_FOOD = Digit(FOOD_AMOUNT.buttons(), letter=(255, 255, 255), threshold=128, name='OCR_DORM_FOOD')
|
||||
OCR_FILL = DigitCounter(OCR_DORM_FILL, letter=(255, 247, 247), threshold=128, name='OCR_DORM_FILL')
|
||||
|
||||
|
||||
class Food:
|
||||
def __init__(self, feed, amount):
|
||||
self.feed = feed
|
||||
self.amount = amount
|
||||
|
||||
|
||||
FOOD_FEED_AMOUNT = [1000, 2000, 3000, 5000, 10000, 20000]
|
||||
FOOD_FILTER = Filter(regex=re.compile('(\d+)'), attr=['feed'], preset=[])
|
||||
|
||||
|
||||
class RewardDorm(UI):
|
||||
def _dorm_receive_click(self):
|
||||
"""
|
||||
Click coins and loves in dorm.
|
||||
|
||||
Returns:
|
||||
int: Receive count.
|
||||
|
||||
Pages:
|
||||
in: page_dorm
|
||||
out: page_dorm, with info_bar
|
||||
"""
|
||||
image = MASK_DORM.apply(np.array(self.device.image))
|
||||
love_points = Points(TEMPLATE_DORM_LOVE.match_multi(image), config=self.config).group()
|
||||
coin_points = Points(TEMPLATE_DORM_COIN.match_multi(image), config=self.config).group()
|
||||
logger.info(f'Dorm loves: {len(love_points)}, Dorm coins: {len(coin_points)}')
|
||||
|
||||
count = 0
|
||||
for point in love_points:
|
||||
button = tuple(np.append(point, point + TEMPLATE_DORM_LOVE.size))
|
||||
button = Button(area=button, color=(), button=button, name='DORM_LOVE')
|
||||
count += 1
|
||||
self.device.click(button)
|
||||
self.device.sleep((0.5, 0.8))
|
||||
for point in coin_points:
|
||||
button = tuple(np.append(point, point + TEMPLATE_DORM_LOVE.size))
|
||||
button = Button(area=button, color=(), button=button, name='DORM_COIN')
|
||||
count += 1
|
||||
self.device.click(button)
|
||||
self.device.sleep((0.5, 0.8))
|
||||
|
||||
return count
|
||||
|
||||
def _dorm_receive(self):
|
||||
"""
|
||||
Click all coins and loves on current screen.
|
||||
Zoom-out dorm to detect coins and loves, because swipes in dorm may treat as dragging ships.
|
||||
Coordinates here doesn't matter too much.
|
||||
|
||||
Pages:
|
||||
in: page_dorm, without info_bar
|
||||
out: page_dorm, without info_bar
|
||||
"""
|
||||
for _ in range(2):
|
||||
logger.info('Dorm zoom out')
|
||||
# Left hand down
|
||||
x, y = random_rectangle_point((33, 228, 234, 469))
|
||||
self.device.minitouch_builder.down(x, y, contact_id=1).commit()
|
||||
self.device.minitouch_send()
|
||||
# Right hand swipe
|
||||
p1, p2 = random_rectangle_vector((-750, 500), box=(247, 26, 1045, 594), padding=0)
|
||||
self.device._drag_minitouch(p1, p2, point_random=(-50, -50, 50, 50))
|
||||
# Left hand up
|
||||
self.device.minitouch_builder.up(contact_id=1).commit()
|
||||
self.device.minitouch_send()
|
||||
|
||||
# Collect
|
||||
for n in range(3):
|
||||
self.device.screenshot()
|
||||
if self._dorm_receive_click():
|
||||
self.ensure_no_info_bar()
|
||||
continue
|
||||
else:
|
||||
break
|
||||
|
||||
def _dorm_has_food(self, button):
|
||||
return np.min(rgb2gray(np.array(self.image_area(button)))) < 127
|
||||
|
||||
def _dorm_feed_click(self, button, count):
|
||||
"""
|
||||
Args:
|
||||
button (Button): Food button.
|
||||
count (int): Food use count.
|
||||
|
||||
Pages:
|
||||
in: DORM_FEED_CHECK
|
||||
"""
|
||||
logger.info(f'Dorm feed {button} x {count}')
|
||||
if count <= 3:
|
||||
for _ in range(count):
|
||||
self.device.click(button)
|
||||
self.device.sleep((0.5, 0.8))
|
||||
|
||||
else:
|
||||
# Long tap to feed. This requires minitouch.
|
||||
timeout = Timer(count // 5 + 5).start()
|
||||
x, y = random_rectangle_point(button.button)
|
||||
self.device.minitouch_builder.down(x, y).commit()
|
||||
self.device.minitouch_send()
|
||||
|
||||
while 1:
|
||||
self.device.minitouch_builder.move(x, y).commit().wait(10)
|
||||
self.device.minitouch_send()
|
||||
self.device.screenshot()
|
||||
|
||||
if not self._dorm_has_food(button) \
|
||||
or self.handle_info_bar() \
|
||||
or self.handle_popup_cancel('dorm_feed'):
|
||||
break
|
||||
if timeout.reached():
|
||||
logger.warning('Wait dorm feed timeout')
|
||||
break
|
||||
|
||||
self.device.minitouch_builder.up().commit()
|
||||
self.device.minitouch_send()
|
||||
|
||||
def _dorm_feed_once(self):
|
||||
"""
|
||||
Returns:
|
||||
bool: If executed.
|
||||
|
||||
Pages:
|
||||
in: DORM_FEED_CHECK
|
||||
"""
|
||||
self.device.screenshot()
|
||||
self.handle_info_bar()
|
||||
|
||||
has_food = [self._dorm_has_food(button) for button in FOOD.buttons()]
|
||||
amount = OCR_FOOD.ocr(self.device.image)
|
||||
amount = [a if hf else 0 for a, hf in zip(amount, has_food)]
|
||||
food = [Food(feed=f, amount=a) for f, a in zip(FOOD_FEED_AMOUNT, amount)]
|
||||
_, fill, _ = OCR_FILL.ocr(self.device.image)
|
||||
logger.info(f'Dorm food: {[f.amount for f in food]}, to fill: {fill}')
|
||||
|
||||
FOOD_FILTER.load(self.config.DORM_FEED_FILTER)
|
||||
for index in FOOD_FILTER.apply(food):
|
||||
selected = food[index]
|
||||
if selected.amount > 0 and fill > selected.feed:
|
||||
self._dorm_feed_click(button=FOOD[index, 0], count=fill // selected.feed)
|
||||
return True
|
||||
|
||||
return False
|
||||
|
||||
def _dorm_feed(self):
|
||||
"""
|
||||
Returns:
|
||||
int: Executed count.
|
||||
|
||||
Pages:
|
||||
in: DORM_FEED_CHECK
|
||||
"""
|
||||
logger.hr('Dorm feed')
|
||||
|
||||
for n in range(10):
|
||||
if not self._dorm_feed_once():
|
||||
logger.info('Dorm feed finished')
|
||||
return n
|
||||
|
||||
logger.warning('Dorm feed run count reached')
|
||||
return 10
|
||||
|
||||
def dorm_run(self):
|
||||
"""
|
||||
Pages:
|
||||
in: Any page
|
||||
out: page_main
|
||||
"""
|
||||
self.ui_ensure(page_dorm)
|
||||
|
||||
if self.config.ENABLE_DORM_COLLECT:
|
||||
self._dorm_receive()
|
||||
|
||||
self.ui_click(click_button=DORM_FEED_ENTER, appear_button=DORM_CHECK, check_button=DORM_FEED_CHECK,
|
||||
skip_first_screenshot=True)
|
||||
self._dorm_feed()
|
||||
self.ui_click(click_button=DORM_FEED_ENTER, appear_button=DORM_FEED_CHECK, check_button=DORM_CHECK,
|
||||
skip_first_screenshot=True)
|
||||
|
||||
self.ui_goto_main()
|
||||
|
||||
@cached_property
|
||||
def dorm_interval(self):
|
||||
return int(ensure_time(self.config.DORM_INTERVAL, precision=3) * 60)
|
||||
|
||||
def dorm_interval_reset(self):
|
||||
""" Call this method after dorm reward executed """
|
||||
del self.__dict__['dorm_interval']
|
||||
|
||||
def handle_dorm(self):
|
||||
"""
|
||||
Returns:
|
||||
bool: If executed.
|
||||
"""
|
||||
if not self.config.ENABLE_DORM_REWARD:
|
||||
return False
|
||||
|
||||
record = datetime.strptime(self.config.config.get(*RECORD), self.config.TIME_FORMAT)
|
||||
update = record + timedelta(seconds=self.dorm_interval)
|
||||
attr = f'{RECORD[0]}_{RECORD[1]}'
|
||||
logger.attr(f'{attr}', f'Record time: {record}')
|
||||
logger.attr(f'{attr}', f'Next update: {update}')
|
||||
if datetime.now() < update:
|
||||
return False
|
||||
|
||||
self.dorm_run()
|
||||
self.dorm_interval_reset()
|
||||
self.config.record_save(RECORD)
|
||||
return True
|
@ -9,13 +9,14 @@ from module.logger import logger
|
||||
from module.research.research import RewardResearch
|
||||
from module.reward.assets import *
|
||||
from module.reward.commission import RewardCommission
|
||||
from module.reward.dorm import RewardDorm
|
||||
from module.reward.meowfficer import RewardMeowfficer
|
||||
from module.reward.tactical_class import RewardTacticalClass
|
||||
from module.ui.page import *
|
||||
from module.update import Update
|
||||
|
||||
|
||||
class Reward(RewardCommission, RewardTacticalClass, RewardResearch, RewardMeowfficer, LoginHandler, Update):
|
||||
class Reward(RewardCommission, RewardTacticalClass, RewardResearch, RewardDorm, RewardMeowfficer, LoginHandler, Update):
|
||||
@cached_property
|
||||
def reward_interval(self):
|
||||
"""
|
||||
@ -66,6 +67,7 @@ class Reward(RewardCommission, RewardTacticalClass, RewardResearch, RewardMeowff
|
||||
|
||||
self.ui_goto(page_main, skip_first_screenshot=True)
|
||||
|
||||
self.handle_dorm()
|
||||
self.handle_meowfficer()
|
||||
self._reward_mission()
|
||||
|
||||
|
@ -8,6 +8,8 @@ TEMPLATE_AMBUSH_EVADE_FAILED = Template(file={'cn': './assets/cn/template/TEMPLA
|
||||
TEMPLATE_AMBUSH_EVADE_SUCCESS = Template(file={'cn': './assets/cn/template/TEMPLATE_AMBUSH_EVADE_SUCCESS.png', 'en': './assets/en/template/TEMPLATE_AMBUSH_EVADE_SUCCESS.png', 'jp': './assets/jp/template/TEMPLATE_AMBUSH_EVADE_SUCCESS.png'})
|
||||
TEMPLATE_CAUGHT_BY_SIREN = Template(file={'cn': './assets/cn/template/TEMPLATE_CAUGHT_BY_SIREN.png', 'en': './assets/en/template/TEMPLATE_CAUGHT_BY_SIREN.png', 'jp': './assets/jp/template/TEMPLATE_CAUGHT_BY_SIREN.png'})
|
||||
TEMPLATE_COMBAT_LOADING = Template(file={'cn': './assets/cn/template/TEMPLATE_COMBAT_LOADING.png', 'en': './assets/en/template/TEMPLATE_COMBAT_LOADING.png', 'jp': './assets/jp/template/TEMPLATE_COMBAT_LOADING.png'})
|
||||
TEMPLATE_DORM_COIN = Template(file={'cn': './assets/cn/template/TEMPLATE_DORM_COIN.gif', 'en': './assets/en/template/TEMPLATE_DORM_COIN.gif', 'jp': './assets/jp/template/TEMPLATE_DORM_COIN.gif'})
|
||||
TEMPLATE_DORM_LOVE = Template(file={'cn': './assets/cn/template/TEMPLATE_DORM_LOVE.gif', 'en': './assets/en/template/TEMPLATE_DORM_LOVE.gif', 'jp': './assets/jp/template/TEMPLATE_DORM_LOVE.gif'})
|
||||
TEMPLATE_ENEMY_BOSS = Template(file={'cn': './assets/cn/template/TEMPLATE_ENEMY_BOSS.png', 'en': './assets/en/template/TEMPLATE_ENEMY_BOSS.png', 'jp': './assets/jp/template/TEMPLATE_ENEMY_BOSS.png'})
|
||||
TEMPLATE_ENEMY_Carrier = Template(file={'cn': './assets/cn/template/TEMPLATE_ENEMY_Carrier.png', 'en': './assets/en/template/TEMPLATE_ENEMY_Carrier.png', 'jp': './assets/jp/template/TEMPLATE_ENEMY_Carrier.png'})
|
||||
TEMPLATE_ENEMY_L = Template(file={'cn': './assets/cn/template/TEMPLATE_ENEMY_L.png', 'en': './assets/en/template/TEMPLATE_ENEMY_L.png', 'jp': './assets/jp/template/TEMPLATE_ENEMY_L.png'})
|
||||
|