From 09ea3e2c375672a86dcb16878ae241bba4d25804 Mon Sep 17 00:00:00 2001 From: xtaodada Date: Wed, 13 Mar 2024 21:17:41 +0800 Subject: [PATCH] :sparkles: Support query novice wish pool data --- metadata/pool/pool.py | 3 +++ metadata/pool/pool_100.py | 1 + modules/gacha_log/log.py | 6 +++--- plugins/genshin/wish_log.py | 2 +- resources/genshin/wish_log/wish_log.css | 10 +++++++++- 5 files changed, 17 insertions(+), 5 deletions(-) create mode 100644 metadata/pool/pool_100.py diff --git a/metadata/pool/pool.py b/metadata/pool/pool.py index 53778b9..8b27a15 100644 --- a/metadata/pool/pool.py +++ b/metadata/pool/pool.py @@ -1,3 +1,4 @@ +from metadata.pool.pool_100 import POOL_100 from metadata.pool.pool_200 import POOL_200 from metadata.pool.pool_301 import POOL_301 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): + if pool_type == 100: + return POOL_100 if pool_type == 200: return POOL_200 if pool_type in [301, 400]: diff --git a/metadata/pool/pool_100.py b/metadata/pool/pool_100.py new file mode 100644 index 0000000..45de441 --- /dev/null +++ b/metadata/pool/pool_100.py @@ -0,0 +1 @@ +POOL_100 = [{"five": ["新手池"], "four": [], "from": "2020-09-15 06:00:00", "name": "新手池", "to": "2050-09-15 17:59:59"}] diff --git a/modules/gacha_log/log.py b/modules/gacha_log/log.py index 6cb8831..4809c02 100644 --- a/modules/gacha_log/log.py +++ b/modules/gacha_log/log.py @@ -336,7 +336,7 @@ class GachaLog: for item in data: count += 1 if item.rank_type == "5": - if item.item_type == "角色" and pool_name in {"角色祈愿", "常驻祈愿", "集录祈愿"}: + if item.item_type == "角色" and pool_name in {"角色祈愿", "常驻祈愿", "新手祈愿", "集录祈愿"}: data = { "name": item.name, "icon": (await assets.avatar(roleToId(item.name)).icon()).as_uri(), @@ -347,7 +347,7 @@ class GachaLog: "time": item.time, } result.append(FiveStarItem.construct(**data)) - elif item.item_type == "武器" and pool_name in {"武器祈愿", "常驻祈愿", "集录祈愿"}: + elif item.item_type == "武器" and pool_name in {"武器祈愿", "常驻祈愿", "新手祈愿", "集录祈愿"}: data = { "name": item.name, "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_four, no_four_star = await self.get_all_4_star_items(data, assets) 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) pool_name = self.count_fortune(pool_name, summon_data) elif pool == BannerType.WEAPON: diff --git a/plugins/genshin/wish_log.py b/plugins/genshin/wish_log.py index 5547900..a92a111 100644 --- a/plugins/genshin/wish_log.py +++ b/plugins/genshin/wish_log.py @@ -381,7 +381,7 @@ class WishLogPlugin(Plugin.Conversation): def gen_button(user_id: int, uid: int, info: "GachaLogInfo") -> List[List[InlineKeyboardButton]]: buttons = [] pools = [] - skip_pools = ["新手祈愿"] + skip_pools = [] for k, v in info.item_list.items(): if k in skip_pools: continue diff --git a/resources/genshin/wish_log/wish_log.css b/resources/genshin/wish_log/wish_log.css index 54bc4e3..e0ddf15 100644 --- a/resources/genshin/wish_log/wish_log.css +++ b/resources/genshin/wish_log/wish_log.css @@ -210,10 +210,18 @@ body { background: #d3bc8d; } +.label_100 { + background-color: #757cc8; +} + .label_301 { background-color: rgb(235 106 75); } +.label_400 { + background-color: rgb(235 106 75); +} + .label_302 { background-color: #e69449; } @@ -223,7 +231,7 @@ body { } .label_500 { - background-color: #757cc8; + background-color: rgb(100 200 75); } .label {