1
0
mirror of https://gitee.com/sui-feng-cb/AzurLaneAutoScript1 synced 2026-03-22 05:53:44 +08:00

Opt: Remove OpsiAshBeacon.AshAttack since it should always be True

This commit is contained in:
LmeSzinc
2023-02-17 23:50:01 +08:00
parent 7261235cc4
commit f5f093c67f
19 changed files with 70 additions and 107 deletions

View File

@@ -7843,9 +7843,13 @@
}
},
"OpsiAshBeacon": {
"AshAttack": {
"type": "checkbox",
"value": true
"AttackMode": {
"type": "select",
"value": "current",
"option": [
"current",
"current_dossier"
]
},
"OneHitMode": {
"type": "checkbox",
@@ -7860,12 +7864,6 @@
"value": true
}
},
"OpsiDossierBeacon": {
"Enable": {
"type": "checkbox",
"value": true
}
},
"Storage": {
"Storage": {
"type": "storage",

View File

@@ -570,12 +570,12 @@ OpsiGeneral:
AkashiShopFilter: |-
ActionPoint > PurpleCoins
OpsiAshBeacon:
AshAttack: true
AttackMode:
value: current
option: [ current, current_dossier ]
OneHitMode: true
RequestAssist: true
EnsureFullyCollected: true
OpsiDossierBeacon:
Enable: true
OpsiFleetFilter:
Filter: |-
Fleet-4 > CallSubmarine > Fleet-2 > Fleet-3 > Fleet-1

View File

@@ -276,10 +276,7 @@ class AzurLaneConfig(ConfigUpdater, ManualConfig, GeneratedConfig, ConfigWatcher
deep_set(self.data, keys=f"{task}.Scheduler.NextRun", value=now)
for task in ["Commission", "Research", "Reward"]:
enable = deep_get(
self.data, keys=f"{task}.Scheduler.Enable", default=None
)
if enable is not None and not enable:
if not self.is_task_enabled(task):
self.modified[f"{task}.Scheduler.Enable"] = True
force_enable = list
@@ -551,9 +548,7 @@ class AzurLaneConfig(ConfigUpdater, ManualConfig, GeneratedConfig, ConfigWatcher
if deep_get(self.data, keys=f"{task}.Scheduler.NextRun", default=None) is None:
raise ScriptError(f"Task to call: `{task}` does not exist in user config")
if force_call or deep_get(
self.data, keys=f"{task}.Scheduler.Enable", default=False
):
if force_call or self.is_task_enabled(task):
logger.info(f"Task call: {task}")
self.modified[f"{task}.Scheduler.NextRun"] = datetime.now().replace(
microsecond=0
@@ -610,6 +605,9 @@ class AzurLaneConfig(ConfigUpdater, ManualConfig, GeneratedConfig, ConfigWatcher
if self.task_switched():
self.task_stop(message=message)
def is_task_enabled(self, task):
return bool(self.cross_get(keys=[task, 'Scheduler', 'Enable'], default=False))
@property
def campaign_name(self):
"""

View File

@@ -350,14 +350,11 @@ class GeneratedConfig:
OpsiGeneral_AkashiShopFilter = 'ActionPoint > PurpleCoins'
# Group `OpsiAshBeacon`
OpsiAshBeacon_AshAttack = True
OpsiAshBeacon_AttackMode = 'current' # current, current_dossier
OpsiAshBeacon_OneHitMode = True
OpsiAshBeacon_RequestAssist = True
OpsiAshBeacon_EnsureFullyCollected = True
# Group `OpsiDossierBeacon`
OpsiDossierBeacon_Enable = True
# Group `OpsiFleetFilter`
OpsiFleetFilter_Filter = 'Fleet-4 > CallSubmarine > Fleet-2 > Fleet-3 > Fleet-1'

View File

@@ -5,9 +5,9 @@ from cached_property import cached_property
from deploy.utils import DEPLOY_TEMPLATE, poor_yaml_read, poor_yaml_write
from module.base.timer import timer
from module.config.redirect_utils.shop_filter import bp_redirect
from module.config.redirect_utils.utils import upload_redirect, api_redirect
from module.config.redirect_utils.os_handler import action_point_redirect
from module.config.redirect_utils.shop_filter import bp_redirect
from module.config.redirect_utils.utils import *
from module.config.server import to_server, to_package, VALID_PACKAGE, VALID_CHANNEL_PACKAGE, VALID_SERVER_LIST
from module.config.utils import *
@@ -492,7 +492,8 @@ class ConfigUpdater:
('DataKey.Scheduler.Enable', 'Freebies.DataKey.Collect'),
('DataKey.DataKey.ForceGet', 'Freebies.DataKey.ForceCollect'),
('SupplyPack.SupplyPack.WeeklyFreeSupplyPack', 'Freebies.SupplyPack.Collect'),
('Commission.Commission.CommissionFilter', 'Commission.Commission.CustomFilter')
('Commission.Commission.CommissionFilter', 'Commission.Commission.CustomFilter'),
('OpsiAshBeacon.OpsiDossierBeacon.Enable', 'OpsiAshBeacon.OpsiAshBeacon.AttackMode', dossier_redirect)
]
@cached_property

View File

@@ -2047,33 +2047,25 @@
"name": "Ash Beacon Settings",
"help": ""
},
"AshAttack": {
"name": "Enable Ash Attack",
"help": "When data beacon is full; attack until ash has been completed"
"AttackMode": {
"name": "META Attack",
"help": "",
"current": "Current",
"current_dossier": "Current + Dossier"
},
"OneHitMode": {
"name": "One Hit Mode",
"help": "Strike each beacon only once, then call for support every half hour thereafter\nNot effective in dossier beacons"
"help": "Strike each beacon only once, then call for support every half hour thereafter\nNot effective in META dossiers"
},
"RequestAssist": {
"name": "Request Assists",
"help": "Before the attack, request assists from friends, guild and world"
"help": "Before the attack, request assists from friends, guild and world\nNot effective in META dossiers"
},
"EnsureFullyCollected": {
"name": "Ensure 200 Beacon Data Fully Collected",
"help": "Ignore AP limit setting temporarily before ash beacon fully collected. \"Meowfficer Farming\" must be enabled"
}
},
"OpsiDossierBeacon": {
"_info": {
"name": "Dossier Beacon Settings",
"help": ""
},
"Enable": {
"name": "Enable Dossier Beacon Attack",
"help": ""
}
},
"OpsiFleetFilter": {
"_info": {
"name": "Fleet Settings",

View File

@@ -2047,9 +2047,11 @@
"name": "OpsiAshBeacon._info.name",
"help": "OpsiAshBeacon._info.help"
},
"AshAttack": {
"name": "OpsiAshBeacon.AshAttack.name",
"help": "OpsiAshBeacon.AshAttack.help"
"AttackMode": {
"name": "OpsiAshBeacon.AttackMode.name",
"help": "OpsiAshBeacon.AttackMode.help",
"current": "current",
"current_dossier": "current_dossier"
},
"OneHitMode": {
"name": "OpsiAshBeacon.OneHitMode.name",
@@ -2064,16 +2066,6 @@
"help": "OpsiAshBeacon.EnsureFullyCollected.help"
}
},
"OpsiDossierBeacon": {
"_info": {
"name": "OpsiDossierBeacon._info.name",
"help": "OpsiDossierBeacon._info.help"
},
"Enable": {
"name": "OpsiDossierBeacon.Enable.name",
"help": "OpsiDossierBeacon.Enable.help"
}
},
"OpsiFleetFilter": {
"_info": {
"name": "OpsiFleetFilter._info.name",
@@ -2409,4 +2401,4 @@
"Clear": "消除"
}
}
}
}

View File

@@ -2047,9 +2047,11 @@
"name": "余烬信标",
"help": ""
},
"AshAttack": {
"name": "余烬信标",
"help": "信标数据满了之后打余烬信标,一直打直到打完"
"AttackMode": {
"name": "余烬信标",
"help": "",
"current": "当期",
"current_dossier": "当期 + 档案"
},
"OneHitMode": {
"name": "一击即走",
@@ -2057,23 +2059,13 @@
},
"RequestAssist": {
"name": "呼叫支援",
"help": "打信标之前,从好友、舰队、世界呼叫支援"
"help": "打信标之前,从好友、舰队、世界呼叫支援\n在档案信标中不生效"
},
"EnsureFullyCollected": {
"name": "保证收集满每日200信标数据",
"help": "在收集满为前,暂时无视保留行动力设置,需要同时开启 \"短猫相接\""
}
},
"OpsiDossierBeacon": {
"_info": {
"name": "档案信标",
"help": ""
},
"Enable": {
"name": "打档案信标",
"help": ""
}
},
"OpsiFleetFilter": {
"_info": {
"name": "舰队设置",

View File

@@ -2047,9 +2047,11 @@
"name": "餘燼信標",
"help": ""
},
"AshAttack": {
"name": "餘燼信標",
"help": "信標數據滿了之後打餘燼信標,一直打直到打完"
"AttackMode": {
"name": "餘燼信標",
"help": "",
"current": "當期",
"current_dossier": "當期 + 檔案"
},
"OneHitMode": {
"name": "一擊即走",
@@ -2057,23 +2059,13 @@
},
"RequestAssist": {
"name": "呼叫支援",
"help": "打信標之前,從好友、艦隊、世界呼叫支援"
"help": "打信標之前,從好友、艦隊、世界呼叫支援\n在檔案信標中不生效"
},
"EnsureFullyCollected": {
"name": "保證收集滿每日200信標數據",
"help": "在收集滿為前,暫時無視保留行動力設置,需要同時開啟 \"短貓相接\""
}
},
"OpsiDossierBeacon": {
"_info": {
"name": "檔案信標",
"help": ""
},
"Enable": {
"name": "打檔案信標",
"help": ""
}
},
"OpsiFleetFilter": {
"_info": {
"name": "艦隊設置",

View File

@@ -31,3 +31,13 @@ def api_redirect(value):
return 'cn_gz_reverse_proxy'
else:
return 'default'
def dossier_redirect(value):
"""
OpsiDossierBeacon -> AttackMode
"""
if value:
return 'current_dossier'
else:
return 'current'