Add: Able to attack chapter CD for event daily bonus

This commit is contained in:
LmeSzinc 2020-07-18 23:37:51 +08:00
parent 6f8eba803d
commit e423fa08eb
8 changed files with 22 additions and 4 deletions

View File

@ -117,6 +117,7 @@ enable_exercise = yes
enable_event_ab = no
enable_raid_daily = no
event_name_ab = event_20200326_cn
event_ab_chapter = chapter_ab
daily_mission_1 = daily_gun
daily_mission_2 = index_1
daily_mission_4 = index_1

View File

@ -302,8 +302,10 @@ def main(ini_name=''):
exercise.add_argument('--演习低血量确认时长', default=default('--演习低血量确认时长'), help='HP低于阈值后, 过一定时长才会撤退\n推荐 1.0 ~ 3.0')
exercise.add_argument('--演习快速换装', default=default('--演习快速换装'), help='打之前换装备, 打完后卸装备, 不需要就填0\n逗号分割, 例如 3, 1, 0, 1, 1, 0')
# 每日活动图三倍PT
event_bonus = daily_parser.add_argument_group('活动设置', '')
event_bonus.add_argument('--活动名称ab', default=event_latest, choices=event_folder, help='例如 event_20200326_cn')
event_bonus.add_argument('--活动奖励章节', default=default('--活动奖励章节'), choices=['AB图', 'ABCD图'], help='有额外PT奖励章节')
# 共斗每日设置
raid_bonus = daily_parser.add_argument_group('共斗设置', '')

View File

@ -303,8 +303,10 @@ def main(ini_name=''):
exercise.add_argument('--exercise_low_hp_confirm', default=default('--exercise_low_hp_confirm'), help='After HP is below the threshold, it will retreat after a certain period of time \nRecommended 1.0 ~ 3.0')
exercise.add_argument('--exercise_equipment', default=default('--exercise_equipment'), help='Change equipment before playing, unload equipment after playing, do not need to fill in 0 \ncomma, such as 3, 1, 0, 1, 1, 0')
# event_daily_ab
event_bonus = daily_parser.add_argument_group('Event Daily Bonus', 'bonus for first clear each day')
event_bonus.add_argument('--event_name_ab', default=event_latest, choices=event_folder, help='There a dropdown menu with many options')
event_bonus.add_argument('--event_ab_chapter', default=default('--event_ab_chapter'), choices=['chapter_ab', 'chapter_abcd'], help='Chapter with PT bonus')
# Raid daily
raid_bonus = daily_parser.add_argument_group('Raid settings', '')

View File

@ -302,8 +302,10 @@ def main(ini_name=''):
exercise.add_argument('--exercise_low_hp_confirm', default=default('--exercise_low_hp_confirm'), help='After HP is below the threshold, it will retreat after a certain period of time \nRecommended 1.0 ~ 3.0')
exercise.add_argument('--exercise_equipment', default=default('--exercise_equipment'), help='Change equipment before playing, unload equipment after playing, do not need to fill in 0 \ncomma, such as 3, 1, 0, 1, 1, 0')
# event_daily_ab
event_bonus = daily_parser.add_argument_group('Event Daily Bonus', 'bonus for first clear each day')
event_bonus.add_argument('--event_name_ab', default=event_latest, choices=event_folder, help='There a dropdown menu with many options')
event_bonus.add_argument('--event_ab_chapter', default=default('--event_ab_chapter'), choices=['chapter_ab', 'chapter_abcd'], help='Chapter with PT bonus')
# Raid daily
raid_bonus = daily_parser.add_argument_group('Raid settings', '')

View File

@ -136,7 +136,8 @@ class AzurLaneConfig:
EVENT_NAME = ''
CAMPAIGN_EVENT = ''
EVENT_NAME_AB = ''
ENABLE_EVENT_NAME_AB = True
ENABLE_EVENT_AB = True
EVENT_AB_CHAPTER = 'chapter_ab' # chapter_ab, chapter_abcd
"""
module.combat.emotion
@ -592,8 +593,9 @@ class AzurLaneConfig:
self.EXERCISE_FLEET_EQUIPMENT = to_list(option['exercise_equipment'])
# Event bonus
# option = config['Event_daily_ab']
self.ENABLE_EVENT_NAME_AB = to_bool(option['enable_event_ab'])
self.ENABLE_EVENT_AB = to_bool(option['enable_event_ab'])
self.EVENT_NAME_AB = option['event_name_ab']
self.EVENT_AB_CHAPTER = option['event_ab_chapter']
# Raid daily
self.ENABLE_RAID_DAILY = to_bool(option['enable_raid_daily'])
self.RAID_DAILY_NAME = option['raid_daily_name']

View File

@ -144,6 +144,7 @@ dic_true_eng_to_eng = {
'enable_hard_campaign': 'enable_hard_campaign',
'enable_exercise': 'enable_exercise',
'enable_event_ab': 'enable_event_ab',
'event_ab_chapter': 'event_ab_chapter',
'enable_raid_daily': 'enable_raid_daily',
'tactical_training': 'daily_mission_1',
'fierce_assault': 'daily_mission_2',
@ -226,6 +227,8 @@ dic_true_eng_to_eng = {
'normal': 'normal',
'hard': 'hard',
'easy': 'easy',
'chapter_ab': 'chapter_ab',
'chapter_abcd': 'chapter_abcd',
# Research filter preset
'customized': 'customized',
@ -393,6 +396,7 @@ dic_chi_to_eng = {
'sp地图': 'sp_stage',
'活动名称': 'event_name',
'活动名称ab': 'event_name_ab',
'活动奖励章节': 'event_ab_chapter',
'共斗名称': 'raid_name',
'共斗难度': 'raid_mode',
'共斗使用挑战券': 'raid_use_ticket',
@ -449,6 +453,8 @@ dic_chi_to_eng = {
'普通': 'normal',
'困难': 'hard',
'简单': 'easy',
'AB图': 'chapter_ab',
'ABCD图': 'chapter_abcd',
# Research filter preset
'自定义': 'customized',

View File

@ -4,7 +4,7 @@ from module.campaign.run import CampaignRun
from module.logger import logger
RECORD_SINCE = (0,)
CAMPAIGN_NAME = ['a1', 'a2', 'a3', 'a4', 'b1', 'b2', 'b3', 'b4']
CAMPAIGN_NAME = ['a1', 'a2', 'a3', 'a4', 'b1', 'b2', 'b3', 'b4', 'c1', 'c2', 'c3', 'c4', 'd1', 'd2', 'd3', 'd4']
class CampaignAB(CampaignRun):
@ -17,6 +17,7 @@ class CampaignAB(CampaignRun):
def run_event_daily(self):
existing = [file[:-3] for file in os.listdir(f'./campaign/{self.config.EVENT_NAME_AB}') if file[-3:] == '.py']
chapter = self.config.EVENT_AB_CHAPTER.split('_')[1]
self.reward_backup_daily_reward_settings()
for name in existing:
@ -28,6 +29,8 @@ class CampaignAB(CampaignRun):
for name in CAMPAIGN_NAME:
if name not in existing:
continue
if name[0] not in chapter:
continue
self.run(name=name, folder=self.config.EVENT_NAME_AB)
self.reward_recover_daily_reward_settings()

View File

@ -193,7 +193,7 @@ class Reward(RewardCommission, RewardTacticalClass, RewardResearch, LoginHandler
az.record_save()
count += 1
if self.config.ENABLE_EVENT_NAME_AB:
if self.config.ENABLE_EVENT_AB:
from module.event.campaign_ab import CampaignAB
az = CampaignAB(self.config, device=self.device)
az.run_event_daily()