mirror of
https://github.com/LmeSzinc/StarRailCopilot.git
synced 2024-11-16 06:25:24 +00:00
Add: Echo of War settings
This commit is contained in:
parent
5cf1f19491
commit
0ab9fc2c2e
@ -59,9 +59,22 @@
|
||||
"DungeonStorage": {
|
||||
"TrailblazePower": {},
|
||||
"DungeonDouble": {},
|
||||
"EchoOfWar": {},
|
||||
"SimulatedUniverse": {}
|
||||
}
|
||||
},
|
||||
"Weekly": {
|
||||
"Scheduler": {
|
||||
"Enable": true,
|
||||
"NextRun": "2020-01-01 00:00:00",
|
||||
"Command": "Weekly",
|
||||
"ServerUpdate": "04:00"
|
||||
},
|
||||
"Weekly": {
|
||||
"Name": "Echo_of_War_Divine_Seed",
|
||||
"Team": 1
|
||||
}
|
||||
},
|
||||
"DailyQuest": {
|
||||
"Scheduler": {
|
||||
"Enable": true,
|
||||
|
@ -393,6 +393,14 @@
|
||||
"display": "hide",
|
||||
"stored": "StoredDungeonDouble"
|
||||
},
|
||||
"EchoOfWar": {
|
||||
"type": "stored",
|
||||
"value": {},
|
||||
"display": "hide",
|
||||
"stored": "StoredEchoOfWar",
|
||||
"order": 4,
|
||||
"color": "#85e7f2"
|
||||
},
|
||||
"SimulatedUniverse": {
|
||||
"type": "stored",
|
||||
"value": {},
|
||||
@ -403,6 +411,57 @@
|
||||
}
|
||||
}
|
||||
},
|
||||
"Weekly": {
|
||||
"Scheduler": {
|
||||
"Enable": {
|
||||
"type": "checkbox",
|
||||
"value": true,
|
||||
"option": [
|
||||
true,
|
||||
false
|
||||
]
|
||||
},
|
||||
"NextRun": {
|
||||
"type": "datetime",
|
||||
"value": "2020-01-01 00:00:00",
|
||||
"validate": "datetime"
|
||||
},
|
||||
"Command": {
|
||||
"type": "input",
|
||||
"value": "Weekly",
|
||||
"display": "hide"
|
||||
},
|
||||
"ServerUpdate": {
|
||||
"type": "input",
|
||||
"value": "04:00",
|
||||
"display": "hide"
|
||||
}
|
||||
},
|
||||
"Weekly": {
|
||||
"Name": {
|
||||
"type": "select",
|
||||
"value": "Echo_of_War_Divine_Seed",
|
||||
"options": [],
|
||||
"option": [
|
||||
"Echo_of_War_Destruction_Beginning",
|
||||
"Echo_of_War_End_of_the_Eternal_Freeze",
|
||||
"Echo_of_War_Divine_Seed"
|
||||
]
|
||||
},
|
||||
"Team": {
|
||||
"type": "select",
|
||||
"value": 1,
|
||||
"option": [
|
||||
1,
|
||||
2,
|
||||
3,
|
||||
4,
|
||||
5,
|
||||
6
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
"DailyQuest": {
|
||||
"Scheduler": {
|
||||
"Enable": {
|
||||
|
@ -118,11 +118,24 @@ DungeonStorage:
|
||||
color: "#eb8efe"
|
||||
DungeonDouble:
|
||||
stored: StoredDungeonDouble
|
||||
EchoOfWar:
|
||||
stored: StoredEchoOfWar
|
||||
order: 4
|
||||
color: "#85e7f2"
|
||||
SimulatedUniverse:
|
||||
stored: StoredSimulatedUniverse
|
||||
order: 6
|
||||
color: "#8fb5fe"
|
||||
|
||||
Weekly:
|
||||
Name:
|
||||
# Dungeon names will be injected in config updater
|
||||
value: Echo_of_War_Divine_Seed
|
||||
options: []
|
||||
Team:
|
||||
value: 1
|
||||
option: [ 1, 2, 3, 4, 5, 6 ]
|
||||
|
||||
AchievableQuest:
|
||||
# Quests will be injected in config updater
|
||||
# Complete_1_Daily_Mission:
|
||||
|
@ -10,6 +10,9 @@
|
||||
Dungeon:
|
||||
Scheduler:
|
||||
Enable: true
|
||||
Weekly:
|
||||
Scheduler:
|
||||
Enable: true
|
||||
DailyQuest:
|
||||
Scheduler:
|
||||
Enable: true
|
||||
|
@ -12,6 +12,7 @@
|
||||
"page": "setting",
|
||||
"tasks": [
|
||||
"Dungeon",
|
||||
"Weekly",
|
||||
"DailyQuest",
|
||||
"BattlePass",
|
||||
"Assignment",
|
||||
|
@ -38,6 +38,19 @@
|
||||
"order": 3,
|
||||
"color": "#79dbc4"
|
||||
},
|
||||
"EchoOfWar": {
|
||||
"name": "EchoOfWar",
|
||||
"path": "Dungeon.DungeonStorage.EchoOfWar",
|
||||
"i18n": "DungeonStorage.EchoOfWar.name",
|
||||
"stored": "StoredEchoOfWar",
|
||||
"attrs": {
|
||||
"time": "2020-01-01 00:00:00",
|
||||
"total": 3,
|
||||
"value": 0
|
||||
},
|
||||
"order": 4,
|
||||
"color": "#85e7f2"
|
||||
},
|
||||
"BattlePassLevel": {
|
||||
"name": "BattlePassLevel",
|
||||
"path": "BattlePass.BattlePassStorage.BattlePassLevel",
|
||||
|
@ -28,6 +28,9 @@ Daily:
|
||||
- DungeonDaily
|
||||
- DungeonSupport
|
||||
- DungeonStorage
|
||||
Weekly:
|
||||
- Scheduler
|
||||
- Weekly
|
||||
DailyQuest:
|
||||
- Scheduler
|
||||
- AchievableQuest
|
||||
|
@ -58,8 +58,13 @@ class GeneratedConfig:
|
||||
# Group `DungeonStorage`
|
||||
DungeonStorage_TrailblazePower = {}
|
||||
DungeonStorage_DungeonDouble = {}
|
||||
DungeonStorage_EchoOfWar = {}
|
||||
DungeonStorage_SimulatedUniverse = {}
|
||||
|
||||
# Group `Weekly`
|
||||
Weekly_Name = 'Echo_of_War_Divine_Seed' # Echo_of_War_Destruction_Beginning, Echo_of_War_End_of_the_Eternal_Freeze, Echo_of_War_Divine_Seed
|
||||
Weekly_Team = 1 # 1, 2, 3, 4, 5, 6
|
||||
|
||||
# Group `AchievableQuest`
|
||||
AchievableQuest_Complete_1_Daily_Mission = 'achievable' # achievable, not_set, not_supported
|
||||
AchievableQuest_Clear_Calyx_Golden_1_times = 'achievable' # achievable, not_set, not_supported
|
||||
|
@ -11,7 +11,7 @@ class ManualConfig:
|
||||
SCHEDULER_PRIORITY = """
|
||||
Restart
|
||||
> BattlePass > DailyQuest > Assignment > DataUpdate
|
||||
> Dungeon
|
||||
> Weekly > Dungeon
|
||||
"""
|
||||
|
||||
"""
|
||||
|
@ -86,6 +86,9 @@ class ConfigGenerator:
|
||||
option_add(
|
||||
keys='DungeonDaily.CavernOfCorrosion.option',
|
||||
options=[dungeon.name for dungeon in DungeonList.instances.values() if dungeon.is_Cavern_of_Corrosion])
|
||||
option_add(
|
||||
keys='Weekly.Name.option',
|
||||
options=[dungeon.name for dungeon in DungeonList.instances.values() if dungeon.is_Echo_of_War])
|
||||
# Insert characters
|
||||
from tasks.character.keywords import CharacterList
|
||||
unsupported_characters = []
|
||||
@ -352,9 +355,9 @@ class ConfigGenerator:
|
||||
# deep_set(new, keys=path, value=f'[{prefix}] {_list[index]}')
|
||||
|
||||
# Dungeon names
|
||||
from tasks.dungeon.keywords import DungeonList
|
||||
if lang not in ['zh-CN', 'zh-TW', 'en-US', 'es-ES']:
|
||||
ingame_lang = gui_lang_to_ingame_lang(lang)
|
||||
from tasks.dungeon.keywords import DungeonList
|
||||
dailies = deep_get(self.argument, keys='Dungeon.Name.option')
|
||||
for dungeon in DungeonList.instances.values():
|
||||
if dungeon.name in dailies:
|
||||
@ -399,6 +402,15 @@ class ConfigGenerator:
|
||||
value = deep_get(new, keys=['AchievableQuest', copy_from, option])
|
||||
deep_set(new, keys=['AchievableQuest', quest.name, option], value=value)
|
||||
|
||||
# Echo of War
|
||||
from tasks.map.keywords import MapWorld
|
||||
dungeons = [d for d in DungeonList.instances.values() if d.is_Echo_of_War]
|
||||
for world, dungeon in zip(MapWorld.instances.values(), dungeons):
|
||||
world_name = world.__getattribute__(ingame_lang)
|
||||
dungeon_name = dungeon.__getattribute__(ingame_lang)
|
||||
value = f'{dungeon_name} ({world_name})'
|
||||
deep_set(new, keys=['Weekly', 'Name', dungeon.name], value=value)
|
||||
|
||||
# GUI i18n
|
||||
for path, _ in deep_iter(self.gui, depth=2):
|
||||
group, key = path
|
||||
|
@ -26,6 +26,10 @@
|
||||
"name": "Dungeon",
|
||||
"help": ""
|
||||
},
|
||||
"Weekly": {
|
||||
"name": "Echo of War",
|
||||
"help": ""
|
||||
},
|
||||
"DailyQuest": {
|
||||
"name": "Daily Quest",
|
||||
"help": ""
|
||||
@ -394,9 +398,36 @@
|
||||
"name": "Dungeon Double",
|
||||
"help": ""
|
||||
},
|
||||
"SimulatedUniverse": {
|
||||
"name": "Sim.Uni.",
|
||||
"EchoOfWar": {
|
||||
"name": "Echo.",
|
||||
"help": ""
|
||||
},
|
||||
"SimulatedUniverse": {
|
||||
"name": "Sim.Univ.",
|
||||
"help": ""
|
||||
}
|
||||
},
|
||||
"Weekly": {
|
||||
"_info": {
|
||||
"name": "Echo of War Settings",
|
||||
"help": "Echo of War is still able to challenge if limit is reached. Consume no trailblaze power, get no reward, but complete daily quests."
|
||||
},
|
||||
"Name": {
|
||||
"name": "Dungeon Name",
|
||||
"help": "",
|
||||
"Echo_of_War_Destruction_Beginning": "Destruction's Beginning (Herta Space Station)",
|
||||
"Echo_of_War_End_of_the_Eternal_Freeze": "End of the Eternal Freeze (Jarilo-VI)",
|
||||
"Echo_of_War_Divine_Seed": "Divine Seed (The Xianzhou Luofu)"
|
||||
},
|
||||
"Team": {
|
||||
"name": "Dungeon Team",
|
||||
"help": "",
|
||||
"1": "1",
|
||||
"2": "2",
|
||||
"3": "3",
|
||||
"4": "4",
|
||||
"5": "5",
|
||||
"6": "6"
|
||||
}
|
||||
},
|
||||
"AchievableQuest": {
|
||||
|
@ -26,6 +26,10 @@
|
||||
"name": "Mazmorra",
|
||||
"help": ""
|
||||
},
|
||||
"Weekly": {
|
||||
"name": "Ecos de la guerra",
|
||||
"help": ""
|
||||
},
|
||||
"DailyQuest": {
|
||||
"name": "Misión diaria",
|
||||
"help": ""
|
||||
@ -387,18 +391,45 @@
|
||||
"help": "DungeonStorage._info.help"
|
||||
},
|
||||
"TrailblazePower": {
|
||||
"name": "Poder trazacaminos",
|
||||
"name": "Poder",
|
||||
"help": ""
|
||||
},
|
||||
"DungeonDouble": {
|
||||
"name": "Mazmorra x2",
|
||||
"help": ""
|
||||
},
|
||||
"EchoOfWar": {
|
||||
"name": "Ecos.",
|
||||
"help": ""
|
||||
},
|
||||
"SimulatedUniverse": {
|
||||
"name": "Univ.Sim.",
|
||||
"help": ""
|
||||
}
|
||||
},
|
||||
"Weekly": {
|
||||
"_info": {
|
||||
"name": "Ajustes de Ecos de la guerra",
|
||||
"help": ""
|
||||
},
|
||||
"Name": {
|
||||
"name": "Nombre de la Mazmorra",
|
||||
"help": "",
|
||||
"Echo_of_War_Destruction_Beginning": "El principio de la Destrucción (Estación Espacial Herta)",
|
||||
"Echo_of_War_End_of_the_Eternal_Freeze": "El fin del Hielo Eterno (Jarilo-VI)",
|
||||
"Echo_of_War_Divine_Seed": "Semilla divina (El Luofu de Xianzhou)"
|
||||
},
|
||||
"Team": {
|
||||
"name": "Equipo de mazmorra",
|
||||
"help": "",
|
||||
"1": "1",
|
||||
"2": "2",
|
||||
"3": "3",
|
||||
"4": "4",
|
||||
"5": "5",
|
||||
"6": "6"
|
||||
}
|
||||
},
|
||||
"AchievableQuest": {
|
||||
"_info": {
|
||||
"name": "Misiones completables",
|
||||
|
@ -26,6 +26,10 @@
|
||||
"name": "Task.Dungeon.name",
|
||||
"help": "Task.Dungeon.help"
|
||||
},
|
||||
"Weekly": {
|
||||
"name": "Task.Weekly.name",
|
||||
"help": "Task.Weekly.help"
|
||||
},
|
||||
"DailyQuest": {
|
||||
"name": "Task.DailyQuest.name",
|
||||
"help": "Task.DailyQuest.help"
|
||||
@ -394,11 +398,38 @@
|
||||
"name": "DungeonStorage.DungeonDouble.name",
|
||||
"help": "DungeonStorage.DungeonDouble.help"
|
||||
},
|
||||
"EchoOfWar": {
|
||||
"name": "DungeonStorage.EchoOfWar.name",
|
||||
"help": "DungeonStorage.EchoOfWar.help"
|
||||
},
|
||||
"SimulatedUniverse": {
|
||||
"name": "DungeonStorage.SimulatedUniverse.name",
|
||||
"help": "DungeonStorage.SimulatedUniverse.help"
|
||||
}
|
||||
},
|
||||
"Weekly": {
|
||||
"_info": {
|
||||
"name": "Weekly._info.name",
|
||||
"help": "Weekly._info.help"
|
||||
},
|
||||
"Name": {
|
||||
"name": "Weekly.Name.name",
|
||||
"help": "Weekly.Name.help",
|
||||
"Echo_of_War_Destruction_Beginning": "歴戦余韻・壊滅の始まり (宇宙ステーション「ヘルタ」)",
|
||||
"Echo_of_War_End_of_the_Eternal_Freeze": "歴戦余韻・寒波の幕切れ (ヤリーロ-VI)",
|
||||
"Echo_of_War_Divine_Seed": "歴戦余韻・不死の神実 (仙舟「羅浮」)"
|
||||
},
|
||||
"Team": {
|
||||
"name": "Weekly.Team.name",
|
||||
"help": "Weekly.Team.help",
|
||||
"1": "1",
|
||||
"2": "2",
|
||||
"3": "3",
|
||||
"4": "4",
|
||||
"5": "5",
|
||||
"6": "6"
|
||||
}
|
||||
},
|
||||
"AchievableQuest": {
|
||||
"_info": {
|
||||
"name": "AchievableQuest._info.name",
|
||||
|
@ -26,6 +26,10 @@
|
||||
"name": "每日副本",
|
||||
"help": ""
|
||||
},
|
||||
"Weekly": {
|
||||
"name": "历战余响",
|
||||
"help": ""
|
||||
},
|
||||
"DailyQuest": {
|
||||
"name": "每日任务",
|
||||
"help": ""
|
||||
@ -394,11 +398,38 @@
|
||||
"name": "副本双倍",
|
||||
"help": ""
|
||||
},
|
||||
"EchoOfWar": {
|
||||
"name": "历战余响",
|
||||
"help": ""
|
||||
},
|
||||
"SimulatedUniverse": {
|
||||
"name": "模拟宇宙",
|
||||
"help": ""
|
||||
}
|
||||
},
|
||||
"Weekly": {
|
||||
"_info": {
|
||||
"name": "历战余响设置",
|
||||
"help": "历战余响每周次数耗尽后仍然可以继续挑战,不消耗体力不获得奖励但是可以完成每日任务"
|
||||
},
|
||||
"Name": {
|
||||
"name": "副本名称",
|
||||
"help": "",
|
||||
"Echo_of_War_Destruction_Beginning": "毁灭的开端•历战余响 (空间站「黑塔」)",
|
||||
"Echo_of_War_End_of_the_Eternal_Freeze": "寒潮的落幕•历战余响 (雅利洛-Ⅵ)",
|
||||
"Echo_of_War_Divine_Seed": "不死的神实•历战余响 (仙舟「罗浮」)"
|
||||
},
|
||||
"Team": {
|
||||
"name": "打本队伍",
|
||||
"help": "",
|
||||
"1": "1",
|
||||
"2": "2",
|
||||
"3": "3",
|
||||
"4": "4",
|
||||
"5": "5",
|
||||
"6": "6"
|
||||
}
|
||||
},
|
||||
"AchievableQuest": {
|
||||
"_info": {
|
||||
"name": "可完成的任务",
|
||||
|
@ -26,6 +26,10 @@
|
||||
"name": "每日副本",
|
||||
"help": ""
|
||||
},
|
||||
"Weekly": {
|
||||
"name": "歷戰餘響",
|
||||
"help": ""
|
||||
},
|
||||
"DailyQuest": {
|
||||
"name": "每日任務",
|
||||
"help": ""
|
||||
@ -394,11 +398,38 @@
|
||||
"name": "副本雙倍",
|
||||
"help": ""
|
||||
},
|
||||
"EchoOfWar": {
|
||||
"name": "歷戰餘響",
|
||||
"help": ""
|
||||
},
|
||||
"SimulatedUniverse": {
|
||||
"name": "模擬宇宙",
|
||||
"help": ""
|
||||
}
|
||||
},
|
||||
"Weekly": {
|
||||
"_info": {
|
||||
"name": "歷戰餘響設定",
|
||||
"help": "歷戰餘響每週次數耗儘後仍可繼續挑戰,不消耗體力不獲得獎勵但是可以完成每日任務"
|
||||
},
|
||||
"Name": {
|
||||
"name": "副本名稱",
|
||||
"help": "",
|
||||
"Echo_of_War_Destruction_Beginning": "毀滅的開端•歷戰餘響 (太空站「黑塔」)",
|
||||
"Echo_of_War_End_of_the_Eternal_Freeze": "寒潮的落幕•歷戰餘響 (雅利洛-Ⅵ)",
|
||||
"Echo_of_War_Divine_Seed": "不死的神實•歷戰餘響 (仙舟「羅浮」)"
|
||||
},
|
||||
"Team": {
|
||||
"name": "打本隊伍",
|
||||
"help": "",
|
||||
"1": "1",
|
||||
"2": "2",
|
||||
"3": "3",
|
||||
"4": "4",
|
||||
"5": "5",
|
||||
"6": "6"
|
||||
}
|
||||
},
|
||||
"AchievableQuest": {
|
||||
"_info": {
|
||||
"name": "可完成的任務",
|
||||
|
@ -2,7 +2,7 @@ from datetime import datetime
|
||||
from functools import cached_property as functools_cached_property
|
||||
|
||||
from module.base.decorator import cached_property
|
||||
from module.config.utils import DEFAULT_TIME, deep_get, get_server_last_update
|
||||
from module.config.utils import DEFAULT_TIME, deep_get, get_server_last_monday_update, get_server_last_update
|
||||
from module.exception import ScriptError
|
||||
|
||||
|
||||
@ -120,6 +120,15 @@ class StoredExpiredAt0400(StoredBase):
|
||||
return expired
|
||||
|
||||
|
||||
class StoredExpiredAtMonday0400(StoredBase):
|
||||
def is_expired(self):
|
||||
from module.logger import logger
|
||||
self.show()
|
||||
expired = self.time < get_server_last_monday_update('04:00')
|
||||
logger.attr(f'{self._name} expired', expired)
|
||||
return expired
|
||||
|
||||
|
||||
class StoredInt(StoredBase):
|
||||
value = 0
|
||||
|
||||
@ -245,6 +254,10 @@ class StoredDungeonDouble(StoredExpiredAt0400):
|
||||
relic = 0
|
||||
|
||||
|
||||
class StoredEchoOfWar(StoredCounter, StoredExpiredAtMonday0400):
|
||||
FIXED_TOTAL = 3
|
||||
|
||||
|
||||
class StoredBattlePassLevel(StoredCounter):
|
||||
FIXED_TOTAL = 50
|
||||
|
||||
|
@ -7,7 +7,9 @@ from module.config.stored.classes import (
|
||||
StoredDaily,
|
||||
StoredDailyActivity,
|
||||
StoredDungeonDouble,
|
||||
StoredEchoOfWar,
|
||||
StoredExpiredAt0400,
|
||||
StoredExpiredAtMonday0400,
|
||||
StoredInt,
|
||||
StoredSimulatedUniverse,
|
||||
StoredTrailblazePower,
|
||||
@ -20,6 +22,7 @@ from module.config.stored.classes import (
|
||||
class StoredGenerated:
|
||||
TrailblazePower = StoredTrailblazePower("Dungeon.DungeonStorage.TrailblazePower")
|
||||
DungeonDouble = StoredDungeonDouble("Dungeon.DungeonStorage.DungeonDouble")
|
||||
EchoOfWar = StoredEchoOfWar("Dungeon.DungeonStorage.EchoOfWar")
|
||||
SimulatedUniverse = StoredSimulatedUniverse("Dungeon.DungeonStorage.SimulatedUniverse")
|
||||
DailyActivity = StoredDailyActivity("DailyQuest.DailyStorage.DailyActivity")
|
||||
DailyQuest = StoredDaily("DailyQuest.DailyStorage.DailyQuest")
|
||||
|
@ -535,6 +535,34 @@ def get_server_last_update(daily_trigger):
|
||||
return update
|
||||
|
||||
|
||||
def get_server_last_monday_update(daily_trigger):
|
||||
"""
|
||||
Args:
|
||||
daily_trigger (list[str], str): [ "00:00", "12:00", "18:00",]
|
||||
|
||||
Returns:
|
||||
datetime.datetime
|
||||
"""
|
||||
update = get_server_next_update(daily_trigger)
|
||||
diff = update.weekday()
|
||||
update = update - timedelta(days=diff)
|
||||
return update
|
||||
|
||||
|
||||
def get_server_next_monday_update(daily_trigger):
|
||||
"""
|
||||
Args:
|
||||
daily_trigger (list[str], str): [ "00:00", "12:00", "18:00",]
|
||||
|
||||
Returns:
|
||||
datetime.datetime
|
||||
"""
|
||||
update = get_server_next_update(daily_trigger)
|
||||
diff = (7 - update.weekday()) % 7
|
||||
update = update + timedelta(days=diff)
|
||||
return update
|
||||
|
||||
|
||||
def nearest_future(future, interval=120):
|
||||
"""
|
||||
Get the neatest future time.
|
||||
|
Loading…
Reference in New Issue
Block a user