[Enhance] Skill of Mithra

- Add support for the skill of Mithra
This commit is contained in:
Lost-MSth
2023-03-23 23:17:02 +08:00
parent 1672d337ff
commit f92d8a9642
14 changed files with 86 additions and 35 deletions

View File

@@ -12,7 +12,7 @@ class Config:
SONG_FILE_HASH_PRE_CALCULATE = True
GAME_API_PREFIX = '/join/21'
GAME_API_PREFIX = '/pollen/22'
ALLOW_APPVERSION = [] # list[str]

View File

@@ -1,6 +1,6 @@
from .config_manager import Config
ARCAEA_SERVER_VERSION = 'v2.11.0.1'
ARCAEA_SERVER_VERSION = 'v2.11.0.2'
class Constant:

View File

@@ -48,9 +48,10 @@ class DatabaseInit:
def character_init(self) -> None:
'''初始化搭档信息'''
uncapped_characters = self.init_data.char_core.keys()
for i in range(0, len(self.init_data.char)):
skill_requires_uncap = 1 if i == 2 else 0
if i in [0, 1, 2, 4, 13, 26, 27, 28, 29, 36, 21, 42, 43, 11, 12, 19, 5, 10]:
if i in uncapped_characters:
max_level = 30
uncapable = 1
else:

View File

@@ -82,6 +82,10 @@ class Score:
def song_state(self) -> int:
return self.get_song_state(self.clear_type)
@property
def all_note_count(self) -> int:
return self.perfect_count + self.near_count + self.miss_count
@property
def is_valid(self) -> bool:
'''分数有效性检查'''
@@ -90,7 +94,7 @@ class Score:
if self.song.difficulty not in (0, 1, 2, 3):
return False
all_note = self.perfect_count + self.near_count + self.miss_count
all_note = self.all_note_count
if all_note == 0:
return False
@@ -216,6 +220,8 @@ class UserPlay(UserScore):
self.course_play_state: int = None
self.course_play: 'CoursePlay' = None
self.combo_interval_bonus: int = None # 不能给 None 以外的默认值
def to_dict(self) -> dict:
# 不能super
if self.is_world_mode is None or self.course_play_state is None:
@@ -249,10 +255,15 @@ class UserPlay(UserScore):
if songfile_hash and songfile_hash != self.song_hash:
return False
x = self.song_token + self.song_hash + self.song.song_id + str(self.song.difficulty) + str(self.score) + str(self.shiny_perfect_count) + str(
self.perfect_count) + str(self.near_count) + str(self.miss_count) + str(self.health) + str(self.modifier) + str(self.clear_type)
y = str(self.user.user_id) + self.song_hash
x = f'''{self.song_token}{self.song_hash}{self.song.song_id}{self.song.difficulty}{self.score}{self.shiny_perfect_count}{self.perfect_count}{self.near_count}{self.miss_count}{self.health}{self.modifier}{self.clear_type}'''
if self.combo_interval_bonus is not None:
if self.combo_interval_bonus < 0 or self.combo_interval_bonus > self.all_note_count / 150:
return False
x = x + str(self.combo_interval_bonus)
y = f'{self.user.user_id}{self.song_hash}'
checksum = md5(x+md5(y))
if checksum != self.submission_hash:
return False

View File

@@ -658,6 +658,8 @@ class WorldPlay:
self._special_tempest()
elif self.character_used.skill_id_displayed == 'ilith_awakened_skill':
self._ilith_awakened_skill()
elif self.character_used.skill_id_displayed == 'skill_mithra':
self._skill_mithra()
else:
if self.character_used.skill_id_displayed == 'skill_vita':
self._skill_vita()
@@ -767,3 +769,10 @@ class WorldPlay:
self.character_used.level)
self.prog_skill_increase = self.character_used.prog.get_value(
self.character_used.level)
def _skill_mithra(self) -> None:
'''
mithra 技能,每 150 combo 增加世界模式进度+1直接理解成 prog 值增加
'''
if self.user_play.combo_interval_bonus:
self.prog_skill_increase = self.user_play.combo_interval_bonus