[Enhance][Bug fix] Support skill_maya & World mode value display bug

- Add support for the skill 'skill_maya'
- Fix a bug that some characters' skill cannot display proper values in world mode progression
- Fix a bug that 'skill_mithra' results in adding `prog` value instead of world mode progress
- For Arcaea 4.7.0
This commit is contained in:
Lost-MSth
2023-08-18 16:45:27 +08:00
parent 41409dee27
commit 04c6d1a0e0
12 changed files with 119 additions and 45 deletions

View File

@@ -217,6 +217,8 @@ class UserCharacter(Character):
self.character_id = character_id
self.user = user
self.skill_flag: bool = None
@property
def skill_id_displayed(self) -> str:
'''对外显示的技能id'''
@@ -226,6 +228,12 @@ class UserCharacter(Character):
return self.skill.skill_id
return None
@property
def skill_state(self) -> str:
if self.skill_id_displayed == 'skill_maya':
return 'add_random' if self.skill_flag else 'remove_random'
return None
def select_character_uncap_condition(self, user=None):
# parameter: user - User类或子类的实例
# 获取此角色的觉醒信息
@@ -255,20 +263,22 @@ class UserCharacter(Character):
if y is None:
raise NoData('The character of the user does not exist.')
self.name = y[7]
self.char_type = y[22]
self.name = y[8]
self.char_type = y[23]
self.is_uncapped = y[4] == 1
self.is_uncapped_override = y[5] == 1
self.level.level = y[2]
self.level.exp = y[3]
self.level.max_level = y[8]
self.frag.set_parameter(y[9], y[12], y[15])
self.prog.set_parameter(y[10], y[13], y[16])
self.overdrive.set_parameter(y[11], y[14], y[17])
self.skill.skill_id = y[18]
self.skill.skill_id_uncap = y[21]
self.skill.skill_unlock_level = y[19]
self.skill.skill_requires_uncap = y[20] == 1
self.level.max_level = y[9]
self.frag.set_parameter(y[10], y[13], y[16])
self.prog.set_parameter(y[11], y[14], y[17])
self.overdrive.set_parameter(y[12], y[15], y[18])
self.skill.skill_id = y[19]
self.skill.skill_id_uncap = y[22]
self.skill.skill_unlock_level = y[20]
self.skill.skill_requires_uncap = y[21] == 1
self.skill_flag = y[6] == 1
if self.character_id in (21, 46):
self.voice = [0, 1, 2, 3, 100, 1000, 1001]
@@ -302,6 +312,11 @@ class UserCharacter(Character):
r['fatalis_is_limited'] = False # emmmmmmm
if self.character_id in [1, 6, 7, 17, 18, 24, 32, 35, 52]:
r['base_character_id'] = 1
x = self.skill_state
if x:
r['skill_state'] = x
return r
def change_uncap_override(self, user=None):
@@ -409,6 +424,12 @@ class UserCharacter(Character):
core.user_claim_item(self.user)
self.upgrade(self.user, - core.amount * Constant.CORE_EXP)
def change_skill_state(self) -> None:
'''翻转技能状态,目前为 skill_miya 专用'''
self.skill_flag = not self.skill_flag
self.c.execute(f'''update {self.database_table_name} set skill_flag = ? where user_id = ? and character_id = ?''', (
1 if self.skill_flag else 0, self.user.user_id, self.character_id))
class UserCharacterList:
'''

View File

@@ -1,6 +1,6 @@
from .config_manager import Config
ARCAEA_SERVER_VERSION = 'v2.11.2.2'
ARCAEA_SERVER_VERSION = 'v2.11.2.3'
ARCAEA_LOG_DATBASE_VERSION = 'v1.1'

View File

@@ -195,7 +195,7 @@ class ItemCharacter(UserItem):
'''select exists(select * from user_char where user_id=? and character_id=?)''', (user.user_id, self.item_id))
if self.c.fetchone() == (0,):
self.c.execute(
'''insert into user_char values(?,?,1,0,0,0)''', (user.user_id, self.item_id))
'''insert into user_char values(?,?,1,0,0,0,0)''', (user.user_id, self.item_id))
class Memory(UserItem):

View File

@@ -387,7 +387,7 @@ class DatabaseMigrator:
c.execute('''delete from user_char_full''')
for i in x:
exp = 25000 if i[1] == 30 else 10000
c.executemany('''insert into user_char_full values(?,?,?,?,?,?)''', [
c.executemany('''insert into user_char_full values(?,?,?,?,?,?,0)''', [
(j[0], i[0], i[1], exp, i[2], 0) for j in y])
def update_database(self) -> None:

View File

@@ -127,9 +127,9 @@ class UserRegister(User):
def _insert_user_char(self):
# 为用户添加初始角色
self.c.execute('''insert into user_char values(?,?,?,?,?,?)''',
self.c.execute('''insert into user_char values(?,?,?,?,?,?,0)''',
(self.user_id, 0, 1, 0, 0, 0))
self.c.execute('''insert into user_char values(?,?,?,?,?,?)''',
self.c.execute('''insert into user_char values(?,?,?,?,?,?,0)''',
(self.user_id, 1, 1, 0, 0, 0))
self.c.execute(
'''select character_id, max_level, is_uncapped from character''')
@@ -137,7 +137,7 @@ class UserRegister(User):
if x:
for i in x:
exp = 25000 if i[1] == 30 else 10000
self.c.execute('''insert into user_char_full values(?,?,?,?,?,?)''',
self.c.execute('''insert into user_char_full values(?,?,?,?,?,?,0)''',
(self.user_id, i[0], i[1], exp, i[2], 0))
def register(self):

View File

@@ -500,10 +500,13 @@ class WorldPlay:
r['char_stats']['prog_tempest'] = self.prog_tempest
if self.character_bonus_progress is not None:
# 猜的,为了让客户端正确显示,当然结果是没问题的
# r['base_progress'] += self.character_bonus_progress # 肯定不是这样的
# 猜的,为了让客户端正确显示
r['progress'] -= self.character_bonus_progress
r['character_bonus_progress'] = self.character_bonus_progress
if self.character_used.skill_id_displayed == 'skill_maya':
r['char_stats']['skill_state'] = self.character_used.skill_state
if self.user_play.beyond_gauge == 0:
r["user_map"]["steps"] = [
x.to_dict() for x in arcmap.steps_for_climbing]
@@ -654,7 +657,7 @@ class WorldPlay:
def before_calculate(self) -> None:
factory_dict = {'skill_vita': self._skill_vita, 'skill_mika': self._skill_mika, 'skill_ilith_ivy': self._skill_ilith_ivy,
'skill_mithra': self._skill_mithra, 'ilith_awakened_skill': self._ilith_awakened_skill, 'skill_hikari_vanessa': self._skill_hikari_vanessa}
'ilith_awakened_skill': self._ilith_awakened_skill, 'skill_hikari_vanessa': self._skill_hikari_vanessa}
if self.user_play.beyond_gauge == 0 and self.character_used.character_id == 35 and self.character_used.skill_id_displayed:
self._special_tempest()
@@ -663,7 +666,7 @@ class WorldPlay:
def after_climb(self) -> None:
factory_dict = {'eto_uncap': self._eto_uncap, 'ayu_uncap': self._ayu_uncap,
'luna_uncap': self._luna_uncap, 'skill_fatalis': self._skill_fatalis, 'skill_amane': self._skill_amane}
'luna_uncap': self._luna_uncap, 'skill_fatalis': self._skill_fatalis, 'skill_amane': self._skill_amane, 'skill_maya': self._skill_maya, 'skill_mithra': self._skill_mithra}
if self.character_used.skill_id_displayed in factory_dict:
factory_dict[self.character_used.skill_id_displayed]()
@@ -704,7 +707,7 @@ class WorldPlay:
if fragment_flag:
self.character_bonus_progress = Constant.ETO_UNCAP_BONUS_PROGRESS
self.step_value += self.character_bonus_progress * self.step_times
self.step_value += self.character_bonus_progress
self.user.current_map.reclimb(self.step_value)
@@ -713,7 +716,7 @@ class WorldPlay:
x: 'Step' = self.user.current_map.steps_for_climbing[0]
if x.restrict_id and x.restrict_type:
self.character_bonus_progress = Constant.LUNA_UNCAP_BONUS_PROGRESS
self.step_value += self.character_bonus_progress * self.step_times
self.step_value += self.character_bonus_progress
self.user.current_map.reclimb(self.step_value)
@@ -723,9 +726,9 @@ class WorldPlay:
self.character_bonus_progress = Constant.AYU_UNCAP_BONUS_PROGRESS if random(
) >= 0.5 else -Constant.AYU_UNCAP_BONUS_PROGRESS
self.step_value += self.character_bonus_progress * self.step_times
self.step_value += self.character_bonus_progress
if self.step_value < 0:
self.character_bonus_progress += self.step_value / self.step_times
self.character_bonus_progress += self.step_value
self.step_value = 0
self.user.current_map.reclimb(self.step_value)
@@ -744,7 +747,7 @@ class WorldPlay:
'''
x: 'Step' = self.user.current_map.steps_for_climbing[0]
if ('randomsong' in x.step_type or 'speedlimit' in x.step_type) and self.user_play.song_grade < 5:
self.character_bonus_progress = -1 * self.step_value / 2 / self.step_times
self.character_bonus_progress = -self.step_value / 2
self.step_value = self.step_value / 2
self.user.current_map.reclimb(self.step_value)
@@ -767,10 +770,12 @@ class WorldPlay:
def _skill_mithra(self) -> None:
'''
mithra 技能,每 150 combo 增加世界模式进度+1,直接理解成 prog 值增加
mithra 技能,每 150 combo 增加世界模式进度+1
'''
if self.user_play.combo_interval_bonus:
self.prog_skill_increase = self.user_play.combo_interval_bonus
self.character_bonus_progress = self.user_play.combo_interval_bonus
self.step_value += self.character_bonus_progress
self.user.current_map.reclimb(self.step_value)
def _skill_ilith_ivy(self) -> None:
'''
@@ -793,3 +798,13 @@ class WorldPlay:
self.user_play.lowest_health // 20]
self.over_skill_increase = -x.count('2') * 10
self.prog_skill_increase = -x.count('1') * 10
def _skill_maya(self) -> None:
'''
maya 技能skill_flag 为 1 时,世界模式进度翻倍
'''
if self.character_used.skill_flag:
self.character_bonus_progress = self.step_value
self.step_value += self.character_bonus_progress
self.user.current_map.reclimb(self.step_value)
self.character_used.change_skill_state()