diff --git a/metadata/shortname.py b/metadata/shortname.py index cbe529fb..18bd222f 100644 --- a/metadata/shortname.py +++ b/metadata/shortname.py @@ -641,6 +641,9 @@ weapons = { "护摩之杖": ["护摩", "护摩枪", "护膜", "胡桃专武"], "千岩长枪": ["千岩枪"], "千岩古剑": ["千岩剑", "千岩大剑"], + "西风长枪": ["西风枪"], + "西风猎弓": ["西风弓"], + "西风秘典": ["西风书"], "暗巷闪光": ["暗巷剑", "暗巷小剑", "暗巷"], "暗巷猎手": ["暗巷弓"], "暗巷的酒与诗": ["暗巷法器", "暗巷书"], diff --git a/modules/wiki/weapon.py b/modules/wiki/weapon.py index b48e5b65..1623f6dc 100644 --- a/modules/wiki/weapon.py +++ b/modules/wiki/weapon.py @@ -99,7 +99,7 @@ class Weapon(WikiModel): affix = WeaponAffix( name=get_table_text(7), description=[i.find_all("td")[1].text for i in tables[3].find_all("tr")[1:]] ) - description = get_table_text(-1) if len(tables) < 11 else get_table_text(9) + description = get_table_text(9) if story_table := find_table("quotes"): story = story_table[0].text.strip() else: diff --git a/plugins/genshin/weapon.py b/plugins/genshin/weapon.py index 70c333d4..edfa983f 100644 --- a/plugins/genshin/weapon.py +++ b/plugins/genshin/weapon.py @@ -71,6 +71,7 @@ class WeaponPlugin(Plugin): bonus = str(round(float(bonus))) _template_data = { "weapon_name": _weapon_data.name, + "weapon_rarity": _weapon_data.rarity, "weapon_info_type_img": await self.download_resource(_weapon_data.weapon_type.icon_url()), "progression_secondary_stat_value": bonus, "progression_secondary_stat_name": _weapon_data.attribute.type.value, @@ -85,10 +86,12 @@ class WeaponPlugin(Plugin): ], "special_ability_name": _weapon_data.affix.name, "special_ability_info": _weapon_data.affix.description[0], + "weapon_description": _weapon_data.description, } else: _template_data = { "weapon_name": _weapon_data.name, + "weapon_rarity": _weapon_data.rarity, "weapon_info_type_img": await self.download_resource(_weapon_data.weapon_type.icon_url()), "progression_secondary_stat_value": " ", "progression_secondary_stat_name": "无其它属性加成", @@ -102,7 +105,8 @@ class WeaponPlugin(Plugin): for mid in _weapon_data.ascension[-3:] ], "special_ability_name": "", - "special_ability_info": _weapon_data.description, + "special_ability_info": "", + "weapon_description": _weapon_data.description, } return _template_data diff --git a/resources/genshin/weapon/example.html b/resources/genshin/weapon/example.html index 301e5e47..ec6880b2 100644 --- a/resources/genshin/weapon/example.html +++ b/resources/genshin/weapon/example.html @@ -5,12 +5,26 @@ weapon +

测试

+
+ star + star + star +
@@ -61,6 +75,10 @@ 这是个测试描述这是个测试描述这是个测试描述这是个测试描述这是个测试描述这是个测试描述 这是个测试描述这是个测试描述这是个测试描述这是个测试描述这是个测试描述这是个测试描述
+
+ 这是个武器介绍这是个武器介绍这是个武器介绍这是个武器介绍这是个武器介绍这是个武器介绍 + 这是个武器介绍这是个武器介绍这是个武器介绍这是个武器介绍这是个武器介绍这是个武器介绍 +
diff --git a/resources/genshin/weapon/weapon.html b/resources/genshin/weapon/weapon.html index e9d5ca3f..7a116eb9 100644 --- a/resources/genshin/weapon/weapon.html +++ b/resources/genshin/weapon/weapon.html @@ -6,12 +6,26 @@ +

{{weapon_name}}

+
+ {% for _ in range(weapon_rarity) %} + star + {% endfor %} +
@@ -57,6 +71,15 @@
{{special_ability_info}}
+ {% if weapon_rarity > 2 %} +
+ {{weapon_description}} +
+ {% else %} +
+ {{weapon_description}} +
+ {% endif %}