mirror of
https://github.com/Lost-MSth/Arcaea-server.git
synced 2026-02-13 11:47:32 +08:00
[Enhance] Missions & ETR
- Add support for missions - PTT mechanism: Change first play protection to new best protection - Adapt to the new difficulty ETR - Uncap DORO*C - Incomplete support for "pick_ticket" - Fix requirements: cryptography >= 35.0.0 Note: This is an intermediate test version, only for Arcaea 5.4.0c. Next version will adapt to 5.4.0.
This commit is contained in:
@@ -89,7 +89,7 @@ class UserItem(Item):
|
||||
|
||||
|
||||
class NormalItem(UserItem):
|
||||
def __init__(self, c) -> None:
|
||||
def __init__(self, c=None) -> None:
|
||||
super().__init__()
|
||||
self.c = c
|
||||
|
||||
@@ -115,7 +115,7 @@ class NormalItem(UserItem):
|
||||
|
||||
|
||||
class PositiveItem(UserItem):
|
||||
def __init__(self, c) -> None:
|
||||
def __init__(self, c=None) -> None:
|
||||
super().__init__()
|
||||
self.c = c
|
||||
|
||||
@@ -142,7 +142,7 @@ class PositiveItem(UserItem):
|
||||
class ItemCore(PositiveItem):
|
||||
item_type = 'core'
|
||||
|
||||
def __init__(self, c, core_type: str = '', amount: int = 0) -> None:
|
||||
def __init__(self, c=None, core_type: str = '', amount: int = 0) -> None:
|
||||
super().__init__(c)
|
||||
self.is_available = True
|
||||
self.item_id = core_type
|
||||
@@ -220,10 +220,12 @@ class Memory(UserItem):
|
||||
class Fragment(UserItem):
|
||||
item_type = 'fragment'
|
||||
|
||||
def __init__(self, c) -> None:
|
||||
def __init__(self, c=None, amount=0) -> None:
|
||||
super().__init__()
|
||||
self.c = c
|
||||
self.is_available = True
|
||||
self.item_id = self.item_type
|
||||
self.amount = amount
|
||||
|
||||
def user_claim_item(self, user):
|
||||
pass
|
||||
@@ -238,12 +240,24 @@ class Anni5tix(PositiveItem):
|
||||
def __init__(self, c) -> None:
|
||||
super().__init__(c)
|
||||
self.is_available = True
|
||||
self.item_id = self.item_type
|
||||
self.amount = 1
|
||||
|
||||
|
||||
class PickTicket(PositiveItem):
|
||||
item_type = 'pick_ticket'
|
||||
|
||||
def __init__(self, c=None) -> None:
|
||||
super().__init__(c)
|
||||
self.is_available = True
|
||||
self.item_id = self.item_type
|
||||
self.amount = 1
|
||||
|
||||
|
||||
class WorldSong(NormalItem):
|
||||
item_type = 'world_song'
|
||||
|
||||
def __init__(self, c) -> None:
|
||||
def __init__(self, c=None) -> None:
|
||||
super().__init__(c)
|
||||
self.is_available = True
|
||||
|
||||
@@ -293,8 +307,10 @@ class ProgBoost(UserItem):
|
||||
class Stamina6(UserItem):
|
||||
item_type = 'stamina6'
|
||||
|
||||
def __init__(self, c) -> None:
|
||||
def __init__(self, c=None) -> None:
|
||||
super().__init__(c)
|
||||
self.item_id = 'stamina6'
|
||||
self.amount = 1
|
||||
|
||||
def user_claim_item(self, user):
|
||||
'''
|
||||
@@ -307,6 +323,23 @@ class Stamina6(UserItem):
|
||||
user.update_user_one_column('world_mode_locked_end_ts', -1)
|
||||
|
||||
|
||||
class ItemStamina(UserItem):
|
||||
item_type = 'stamina'
|
||||
|
||||
def __init__(self, c=None, amount=1) -> None:
|
||||
super().__init__(c)
|
||||
self.item_id = 'stamina'
|
||||
self.amount = amount
|
||||
|
||||
def user_claim_item(self, user):
|
||||
'''
|
||||
新手任务奖励体力
|
||||
'''
|
||||
user.select_user_about_stamina()
|
||||
user.stamina.stamina += self.amount
|
||||
user.stamina.update()
|
||||
|
||||
|
||||
class ItemFactory:
|
||||
def __init__(self, c=None) -> None:
|
||||
self.c = c
|
||||
@@ -324,6 +357,8 @@ class ItemFactory:
|
||||
return Memory(self.c)
|
||||
elif item_type == 'anni5tix':
|
||||
return Anni5tix(self.c)
|
||||
elif item_type == 'pick_ticket':
|
||||
return PickTicket(self.c)
|
||||
elif item_type == 'world_song':
|
||||
return WorldSong(self.c)
|
||||
elif item_type == 'world_unlock':
|
||||
|
||||
Reference in New Issue
Block a user