mirror of
https://github.com/Lost-MSth/Arcaea-server.git
synced 2026-02-09 09:17:26 +08:00
[Enhance] Support 'skill_hikari_vanessa'
- Add support for the skill 'skill_hikari_vanessa' - For Arcaea 4.6.0
This commit is contained in:
@@ -33,26 +33,30 @@ def score_token_world(user_id):
|
||||
fragment_multiply = int(d('fragment_multiply', 100))
|
||||
prog_boost_multiply = int(d('prog_boost_multiply', 0))
|
||||
beyond_boost_gauge_use = int(d('beyond_boost_gauge_use', 0))
|
||||
skill_ilith_ivy_flag = None
|
||||
if d('skill_id') == 'skill_ilith_ivy' and d('is_skill_sealed') == 'false':
|
||||
# 处理 ivy 技能
|
||||
skill_cytusii_flag = None
|
||||
skill_id = d('skill_id')
|
||||
|
||||
if (skill_id == 'skill_ilith_ivy' or skill_id == 'skill_hikari_vanessa') and d('is_skill_sealed') == 'false':
|
||||
# 处理 ivy 技能或者 vanessa 技能
|
||||
# TODO: 需要重构整个 user_play,世界模式 / 课题模式,所以现在临时 work 一下
|
||||
skill_ilith_ivy_flag = ''.join([str(randint(0, 2)) for _ in range(5)])
|
||||
skill_cytusii_flag = ''.join([str(randint(0, 2)) for _ in range(5)])
|
||||
|
||||
with Connect() as c:
|
||||
x = UserPlay(c, UserOnline(c, user_id))
|
||||
x.song.set_chart(request.args['song_id'], int(
|
||||
request.args['difficulty']))
|
||||
x.set_play_state_for_world(
|
||||
stamina_multiply, fragment_multiply, prog_boost_multiply, beyond_boost_gauge_use, skill_ilith_ivy_flag)
|
||||
stamina_multiply, fragment_multiply, prog_boost_multiply, beyond_boost_gauge_use, skill_cytusii_flag)
|
||||
|
||||
r = {
|
||||
"stamina": x.user.stamina.stamina,
|
||||
"max_stamina_ts": x.user.stamina.max_stamina_ts,
|
||||
"token": x.song_token,
|
||||
}
|
||||
if skill_ilith_ivy_flag:
|
||||
if skill_cytusii_flag and skill_id:
|
||||
r['play_parameters'] = {
|
||||
'skill_ilith_ivy': list(map(lambda x: Constant.WORLD_VALUE_NAME_ENUM[int(x)], skill_ilith_ivy_flag))
|
||||
skill_id: list(
|
||||
map(lambda x: Constant.WORLD_VALUE_NAME_ENUM[int(x)], skill_cytusii_flag))
|
||||
}
|
||||
return success_return(r)
|
||||
|
||||
@@ -112,6 +116,7 @@ def song_score_post(user_id):
|
||||
if 'combo_interval_bonus' in request.form:
|
||||
x.combo_interval_bonus = int(request.form['combo_interval_bonus'])
|
||||
x.highest_health = request.form.get("highest_health", type=int)
|
||||
x.lowest_health = request.form.get("lowest_health", type=int)
|
||||
if not x.is_valid:
|
||||
raise InputError('Invalid score.', 107)
|
||||
x.upload_score()
|
||||
|
||||
Reference in New Issue
Block a user