[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:
Lost-MSth
2024-11-25 15:29:11 +08:00
parent a6c26dedfe
commit 3f5281582c
12 changed files with 251 additions and 45 deletions

View File

@@ -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):