Skip to content

Commit 71a086f

Browse files
committed
Add: check leveling in cl1 daily
1 parent b4ba9e5 commit 71a086f

File tree

18 files changed

+437
-0
lines changed

18 files changed

+437
-0
lines changed

assets/cn/awaken/OCR_SHIP_EXP.png

2.75 KB
Loading

assets/cn/os/FLEET_FLAGSHIP.png

2.84 KB
Loading

config/template.json

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1870,6 +1870,11 @@
18701870
"Fleet": 1,
18711871
"Submarine": false
18721872
},
1873+
"OpsiCheckLeveling": {
1874+
"TargetLevel": 0,
1875+
"LastRun": "2020-01-01 00:00:00",
1876+
"DelayAfterFull": false
1877+
},
18731878
"Storage": {
18741879
"Storage": {}
18751880
}
@@ -1890,6 +1895,11 @@
18901895
"Fleet": 1,
18911896
"Submarine": false
18921897
},
1898+
"OpsiCheckLeveling": {
1899+
"TargetLevel": 0,
1900+
"LastRun": "2020-01-01 00:00:00",
1901+
"DelayAfterFull": false
1902+
},
18931903
"Storage": {
18941904
"Storage": {}
18951905
}

dev_tools/ship_exp_extract.py

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
from dev_tools.utils import LuaLoader
2+
3+
4+
class ShipEXP:
5+
def __init__(self):
6+
self.ship_exp = [0] * 125 # Initialize a list for levels 0 to 125
7+
data = LOADER.load('sharecfg/ship_level.lua')
8+
total_exp = 0
9+
for index, exp in data.items():
10+
if not isinstance(index, int) or index >= 124:
11+
continue
12+
total_exp += exp['exp']
13+
self.ship_exp[exp['level']] = total_exp
14+
15+
def encode(self):
16+
lines = []
17+
lines.append('# This file is auto-generated by dev_tools/ship_exp_extract.py.')
18+
lines.append('# Do not edit this file manually.')
19+
lines.append('')
20+
lines.append('LIST_SHIP_EXP = [')
21+
for exp in self.ship_exp:
22+
lines.append(f' {exp},')
23+
lines.append(']')
24+
return lines
25+
26+
def write(self, file):
27+
print(f'writing {file}')
28+
with open(file, 'w', encoding='utf-8') as f:
29+
for text in self.encode():
30+
f.write(text + '\n')
31+
32+
33+
"""
34+
This is an auto-tool to extract accumulative ship leveling exp for operation siren leveling check.
35+
36+
Git clone https://github.com/AzurLaneTools/AzurLaneLuaScripts, to get the decrypted scripts.
37+
Arguments:
38+
FILE: Path to repository, such as 'xxx/AzurLaneLuaScripts'
39+
SAVE: File to save, 'module/os/ship_exp.py'
40+
"""
41+
FOLDER = '../AzurLaneLuaScripts/'
42+
SAVE = 'module/os/ship_exp_data.py'
43+
44+
LOADER = LuaLoader(FOLDER)
45+
ShipEXP().write(SAVE)

module/awaken/assets.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,5 +12,6 @@
1212
COST_CHIP = Button(area={'cn': (610, 375, 670, 435), 'en': (610, 375, 670, 435), 'jp': (610, 375, 670, 435), 'tw': (610, 375, 670, 435)}, color={'cn': (157, 188, 190), 'en': (157, 188, 190), 'jp': (157, 188, 190), 'tw': (157, 188, 190)}, button={'cn': (610, 375, 670, 435), 'en': (610, 375, 670, 435), 'jp': (610, 375, 670, 435), 'tw': (610, 375, 670, 435)}, file={'cn': './assets/cn/awaken/COST_CHIP.png', 'en': './assets/cn/awaken/COST_CHIP.png', 'jp': './assets/cn/awaken/COST_CHIP.png', 'tw': './assets/cn/awaken/COST_CHIP.png'})
1313
COST_COIN = Button(area={'cn': (499, 373, 559, 433), 'en': (499, 373, 559, 433), 'jp': (499, 373, 559, 433), 'tw': (499, 373, 559, 433)}, color={'cn': (219, 180, 83), 'en': (219, 180, 83), 'jp': (219, 180, 83), 'tw': (219, 180, 83)}, button={'cn': (499, 373, 559, 433), 'en': (499, 373, 559, 433), 'jp': (499, 373, 559, 433), 'tw': (499, 373, 559, 433)}, file={'cn': './assets/cn/awaken/COST_COIN.png', 'en': './assets/cn/awaken/COST_COIN.png', 'jp': './assets/cn/awaken/COST_COIN.png', 'tw': './assets/cn/awaken/COST_COIN.png'})
1414
LEVEL_UP = Button(area={'cn': (804, 282, 897, 304), 'en': (864, 286, 910, 302), 'jp': (807, 284, 893, 303), 'tw': (805, 282, 893, 304)}, color={'cn': (141, 167, 216), 'en': (130, 158, 213), 'jp': (141, 171, 208), 'tw': (147, 179, 219)}, button={'cn': (804, 282, 897, 304), 'en': (864, 286, 910, 302), 'jp': (807, 284, 893, 303), 'tw': (805, 282, 893, 304)}, file={'cn': './assets/cn/awaken/LEVEL_UP.png', 'en': './assets/en/awaken/LEVEL_UP.png', 'jp': './assets/jp/awaken/LEVEL_UP.png', 'tw': './assets/tw/awaken/LEVEL_UP.png'})
15+
OCR_SHIP_EXP = Button(area={'cn': (1102, 276, 1250, 306), 'en': (1102, 276, 1250, 306), 'jp': (1102, 276, 1250, 306), 'tw': (1102, 276, 1250, 306)}, color={'cn': (255, 255, 255), 'en': (255, 255, 255), 'jp': (255, 255, 255), 'tw': (255, 255, 255)}, button={'cn': (1102, 276, 1250, 306), 'en': (1102, 276, 1250, 306), 'jp': (1102, 276, 1250, 306), 'tw': (1102, 276, 1250, 306)}, file={'cn': './assets/cn/awaken/OCR_SHIP_EXP.png', 'en': './assets/cn/awaken/OCR_SHIP_EXP.png', 'jp': './assets/cn/awaken/OCR_SHIP_EXP.png', 'tw': './assets/cn/awaken/OCR_SHIP_EXP.png'})
1516
OCR_SHIP_LEVEL = Button(area={'cn': (757, 283, 799, 319), 'en': (757, 283, 799, 319), 'jp': (746, 279, 798, 317), 'tw': (757, 283, 799, 319)}, color={'cn': (115, 130, 142), 'en': (115, 130, 142), 'jp': (122, 116, 116), 'tw': (115, 130, 142)}, button={'cn': (757, 283, 799, 319), 'en': (757, 283, 799, 319), 'jp': (746, 279, 798, 317), 'tw': (757, 283, 799, 319)}, file={'cn': './assets/cn/awaken/OCR_SHIP_LEVEL.png', 'en': './assets/cn/awaken/OCR_SHIP_LEVEL.png', 'jp': './assets/jp/awaken/OCR_SHIP_LEVEL.png', 'tw': './assets/cn/awaken/OCR_SHIP_LEVEL.png'})
1617
SHIP_LEVEL_CHECK = Button(area={'cn': (706, 298, 742, 315), 'en': (706, 298, 742, 315), 'jp': (703, 293, 734, 314), 'tw': (706, 298, 742, 315)}, color={'cn': (171, 162, 193), 'en': (171, 162, 193), 'jp': (125, 119, 116), 'tw': (171, 162, 193)}, button={'cn': (706, 298, 742, 315), 'en': (706, 298, 742, 315), 'jp': (703, 293, 734, 314), 'tw': (706, 298, 742, 315)}, file={'cn': './assets/cn/awaken/SHIP_LEVEL_CHECK.png', 'en': './assets/cn/awaken/SHIP_LEVEL_CHECK.png', 'jp': './assets/jp/awaken/SHIP_LEVEL_CHECK.png', 'tw': './assets/cn/awaken/SHIP_LEVEL_CHECK.png'})

module/campaign/os_run.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ def opsi_daily(self):
5252
def opsi_meowfficer_farming(self):
5353
try:
5454
self.load_campaign()
55+
self.campaign.os_check_leveling()
5556
self.campaign.os_meowfficer_farming()
5657
except ActionPointLimit:
5758
if get_os_reset_remain() > 0:
@@ -67,6 +68,7 @@ def opsi_meowfficer_farming(self):
6768
def opsi_hazard1_leveling(self):
6869
try:
6970
self.load_campaign()
71+
self.campaign.os_check_leveling()
7072
self.campaign.os_hazard1_leveling()
7173
except ActionPointLimit:
7274
self.config.task_delay(server_update=True)

module/config/argument/args.json

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9066,6 +9066,21 @@
90669066
"value": false
90679067
}
90689068
},
9069+
"OpsiCheckLeveling": {
9070+
"TargetLevel": {
9071+
"type": "input",
9072+
"value": 0
9073+
},
9074+
"LastRun": {
9075+
"type": "datetime",
9076+
"value": "2020-01-01 00:00:00",
9077+
"validate": "datetime"
9078+
},
9079+
"DelayAfterFull": {
9080+
"type": "checkbox",
9081+
"value": false
9082+
}
9083+
},
90699084
"Storage": {
90709085
"Storage": {
90719086
"type": "storage",
@@ -9139,6 +9154,21 @@
91399154
"display": "hide"
91409155
}
91419156
},
9157+
"OpsiCheckLeveling": {
9158+
"TargetLevel": {
9159+
"type": "input",
9160+
"value": 0
9161+
},
9162+
"LastRun": {
9163+
"type": "datetime",
9164+
"value": "2020-01-01 00:00:00",
9165+
"validate": "datetime"
9166+
},
9167+
"DelayAfterFull": {
9168+
"type": "checkbox",
9169+
"value": false
9170+
}
9171+
},
91429172
"Storage": {
91439173
"Storage": {
91449174
"type": "storage",

module/config/argument/argument.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -734,6 +734,10 @@ OpsiHazard1Leveling:
734734
TargetZone:
735735
value: 0
736736
option: [ 0, 44, 22 ]
737+
OpsiCheckLeveling:
738+
TargetLevel: 0
739+
LastRun: 2020-01-01 00:00:00
740+
DelayAfterFull: false
737741

738742
# ==================== Tools ====================
739743

module/config/argument/task.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -319,10 +319,12 @@ Opsi:
319319
- Scheduler
320320
- OpsiMeowfficerFarming
321321
- OpsiFleet
322+
- OpsiCheckLeveling
322323
OpsiHazard1Leveling:
323324
- Scheduler
324325
- OpsiHazard1Leveling
325326
- OpsiFleet
327+
- OpsiCheckLeveling
326328
OpsiCrossMonth:
327329
- Scheduler
328330

module/config/config_generated.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -436,6 +436,11 @@ class GeneratedConfig:
436436
# Group `OpsiHazard1Leveling`
437437
OpsiHazard1Leveling_TargetZone = 0 # 0, 44, 22
438438

439+
# Group `OpsiCheckLeveling`
440+
OpsiCheckLeveling_TargetLevel = 0
441+
OpsiCheckLeveling_LastRun = datetime.datetime(2020, 1, 1, 0, 0)
442+
OpsiCheckLeveling_DelayAfterFull = False
443+
439444
# Group `Daemon`
440445
Daemon_EnterMap = True
441446

0 commit comments

Comments
 (0)