Support query novice wish pool data

This commit is contained in:
xtaodada 2024-03-13 21:17:41 +08:00
parent c1ada7cffd
commit 09ea3e2c37
Signed by: xtaodada
GPG Key ID: 4CBB3F4FA8C85659
5 changed files with 17 additions and 5 deletions

View File

@ -1,3 +1,4 @@
from metadata.pool.pool_100 import POOL_100
from metadata.pool.pool_200 import POOL_200 from metadata.pool.pool_200 import POOL_200
from metadata.pool.pool_301 import POOL_301 from metadata.pool.pool_301 import POOL_301
from metadata.pool.pool_302 import POOL_302 from metadata.pool.pool_302 import POOL_302
@ -5,6 +6,8 @@ from metadata.pool.pool_500 import POOL_500
def get_pool_by_id(pool_type): def get_pool_by_id(pool_type):
if pool_type == 100:
return POOL_100
if pool_type == 200: if pool_type == 200:
return POOL_200 return POOL_200
if pool_type in [301, 400]: if pool_type in [301, 400]:

View File

@ -0,0 +1 @@
POOL_100 = [{"five": ["新手池"], "four": [], "from": "2020-09-15 06:00:00", "name": "新手池", "to": "2050-09-15 17:59:59"}]

View File

@ -336,7 +336,7 @@ class GachaLog:
for item in data: for item in data:
count += 1 count += 1
if item.rank_type == "5": if item.rank_type == "5":
if item.item_type == "角色" and pool_name in {"角色祈愿", "常驻祈愿", "集录祈愿"}: if item.item_type == "角色" and pool_name in {"角色祈愿", "常驻祈愿", "新手祈愿", "集录祈愿"}:
data = { data = {
"name": item.name, "name": item.name,
"icon": (await assets.avatar(roleToId(item.name)).icon()).as_uri(), "icon": (await assets.avatar(roleToId(item.name)).icon()).as_uri(),
@ -347,7 +347,7 @@ class GachaLog:
"time": item.time, "time": item.time,
} }
result.append(FiveStarItem.construct(**data)) result.append(FiveStarItem.construct(**data))
elif item.item_type == "武器" and pool_name in {"武器祈愿", "常驻祈愿", "集录祈愿"}: elif item.item_type == "武器" and pool_name in {"武器祈愿", "常驻祈愿", "新手祈愿", "集录祈愿"}:
data = { data = {
"name": item.name, "name": item.name,
"icon": (await assets.weapon(weaponToId(item.name)).icon()).as_uri(), "icon": (await assets.weapon(weaponToId(item.name)).icon()).as_uri(),
@ -575,7 +575,7 @@ class GachaLog:
all_five, no_five_star = await self.get_all_5_star_items(data, assets, pool_name) all_five, no_five_star = await self.get_all_5_star_items(data, assets, pool_name)
all_four, no_four_star = await self.get_all_4_star_items(data, assets) all_four, no_four_star = await self.get_all_4_star_items(data, assets)
summon_data = None summon_data = None
if pool in [BannerType.CHARACTER1, BannerType.CHARACTER2]: if pool in [BannerType.CHARACTER1, BannerType.CHARACTER2, BannerType.NOVICE]:
summon_data = self.get_301_pool_data(total, all_five, no_five_star, no_four_star) summon_data = self.get_301_pool_data(total, all_five, no_five_star, no_four_star)
pool_name = self.count_fortune(pool_name, summon_data) pool_name = self.count_fortune(pool_name, summon_data)
elif pool == BannerType.WEAPON: elif pool == BannerType.WEAPON:

View File

@ -381,7 +381,7 @@ class WishLogPlugin(Plugin.Conversation):
def gen_button(user_id: int, uid: int, info: "GachaLogInfo") -> List[List[InlineKeyboardButton]]: def gen_button(user_id: int, uid: int, info: "GachaLogInfo") -> List[List[InlineKeyboardButton]]:
buttons = [] buttons = []
pools = [] pools = []
skip_pools = ["新手祈愿"] skip_pools = []
for k, v in info.item_list.items(): for k, v in info.item_list.items():
if k in skip_pools: if k in skip_pools:
continue continue

View File

@ -210,10 +210,18 @@ body {
background: #d3bc8d; background: #d3bc8d;
} }
.label_100 {
background-color: #757cc8;
}
.label_301 { .label_301 {
background-color: rgb(235 106 75); background-color: rgb(235 106 75);
} }
.label_400 {
background-color: rgb(235 106 75);
}
.label_302 { .label_302 {
background-color: #e69449; background-color: #e69449;
} }
@ -223,7 +231,7 @@ body {
} }
.label_500 { .label_500 {
background-color: #757cc8; background-color: rgb(100 200 75);
} }
.label { .label {