mirror of
https://github.com/Lost-MSth/Arcaea-server.git
synced 2026-02-09 09:17:26 +08:00
[Enhance] New skills
- For Arcaea 6.0.3 - Add support for `skill_chinatsu` and `skill_intruder`. - Add support for the invasion toggle (toggle intruder's skill states). Note that the invasion toggle in 4 states, which is different from the official server.
This commit is contained in:
@@ -326,6 +326,8 @@ class UserInfo(User):
|
||||
self.current_map: 'Map' = None
|
||||
self.stamina: 'UserStamina' = None
|
||||
|
||||
self.insight_state: int = None
|
||||
|
||||
self.__cores: list = None
|
||||
self.__packs: list = None
|
||||
self.__singles: list = None
|
||||
@@ -336,6 +338,12 @@ class UserInfo(User):
|
||||
self.curr_available_maps: list = None
|
||||
self.__course_banners: list = None
|
||||
|
||||
@property
|
||||
def is_insight_enabled(self) -> bool:
|
||||
if self.insight_state is None:
|
||||
self.select_user_one_column('insight_state', 4, int)
|
||||
return self.insight_state == 3 or self.insight_state == 5
|
||||
|
||||
@property
|
||||
def cores(self) -> list:
|
||||
if self.__cores is None:
|
||||
@@ -547,6 +555,7 @@ class UserInfo(User):
|
||||
# 'custom_banner': 'online_banner_2024_06',
|
||||
# 'subscription_multiplier': 114,
|
||||
# 'memory_boost_ticket': 5,
|
||||
'insight_state': self.insight_state, # 0~2 不可选,3 技能激活,4 未激活,5 激活可选,6 未激活可选
|
||||
}
|
||||
|
||||
def from_list(self, x: list) -> 'UserInfo':
|
||||
@@ -591,6 +600,8 @@ class UserInfo(User):
|
||||
|
||||
self.mp_notification_enabled = x[37] == 1
|
||||
|
||||
self.insight_state = x[38]
|
||||
|
||||
return self
|
||||
|
||||
def select_user(self) -> None:
|
||||
@@ -795,6 +806,19 @@ class UserOnline(UserInfo):
|
||||
self.c.execute('''update user set favorite_character = :a where user_id = :b''',
|
||||
{'a': self.favorite_character.character_id, 'b': self.user_id})
|
||||
|
||||
def toggle_invasion(self) -> None:
|
||||
self.c.execute(
|
||||
'''select insight_state from user where user_id = ?''', (self.user_id,))
|
||||
x = self.c.fetchone()
|
||||
if not x:
|
||||
raise NoData('No user.', 108, -3)
|
||||
self.insight_state = x[0]
|
||||
rq = Constant.INSIGHT_TOGGLE_STATES
|
||||
self.insight_state = rq[(rq.index(self.insight_state) + 1) % len(rq)]
|
||||
|
||||
self.c.execute(
|
||||
'''update user set insight_state = ? where user_id = ?''', (self.insight_state, self.user_id))
|
||||
|
||||
|
||||
class UserChanger(UserInfo, UserRegister):
|
||||
|
||||
|
||||
Reference in New Issue
Block a user