mirror of
https://github.com/baiqwerdvd/StarRailUID.git
synced 2025-05-06 19:53:44 +08:00
Merge branch 'master' of https://github.com/qwerdvd/StarRailUID
This commit is contained in:
commit
6d1d4e656f
@ -1,6 +1,5 @@
|
||||
"""Mihomo.me api 包装
|
||||
"""
|
||||
from .models import MihomoData as MihomoData
|
||||
from .requests import get_char_card_info as get_char_card_info
|
||||
|
||||
__all__ = ["requests", "MihomoData"]
|
||||
|
@ -1,6 +1,6 @@
|
||||
from __future__ import annotations
|
||||
|
||||
from typing import TypedDict, Union
|
||||
from typing import Union, TypedDict
|
||||
|
||||
|
||||
class MihomoData(TypedDict):
|
||||
|
@ -1,4 +1,4 @@
|
||||
from typing import Any, Dict, List, TypedDict, Union
|
||||
from typing import Any, Dict, List, Union, TypedDict
|
||||
|
||||
################
|
||||
# 抽卡记录相关 #
|
||||
|
@ -1,8 +1,8 @@
|
||||
import re
|
||||
|
||||
from gsuid_core.sv import SV
|
||||
from gsuid_core.bot import Bot
|
||||
from gsuid_core.models import Event
|
||||
from gsuid_core.sv import SV
|
||||
from gsuid_core.utils.error_reply import UID_HINT
|
||||
|
||||
from ..utils.convert import get_uid
|
||||
|
@ -1,17 +1,18 @@
|
||||
from pathlib import Path
|
||||
from typing import Optional, Union
|
||||
from typing import Union, Optional
|
||||
|
||||
from PIL import Image, ImageDraw
|
||||
|
||||
from gsuid_core.logger import logger
|
||||
from gsuid_core.utils.error_reply import get_error
|
||||
from gsuid_core.utils.image.image_tools import (
|
||||
draw_pic_with_ring,
|
||||
get_qq_avatar,
|
||||
draw_pic_with_ring,
|
||||
)
|
||||
|
||||
from ..sruid_utils.api.mys.models import AbyssAvatar
|
||||
from .utils import get_icon
|
||||
from ..utils.convert import GsCookie
|
||||
from ..utils.image.convert import convert_img
|
||||
from ..sruid_utils.api.mys.models import AbyssAvatar
|
||||
from ..utils.fonts.starrail_fonts import (
|
||||
sr_font_22,
|
||||
sr_font_28,
|
||||
@ -19,8 +20,6 @@ from ..utils.fonts.starrail_fonts import (
|
||||
sr_font_34,
|
||||
sr_font_42,
|
||||
)
|
||||
from ..utils.image.convert import convert_img
|
||||
from .utils import get_icon
|
||||
|
||||
abyss_list = {
|
||||
'1': '琥珀恩赐其一',
|
||||
|
@ -2,9 +2,8 @@ from io import BytesIO
|
||||
from pathlib import Path
|
||||
from typing import TypeVar
|
||||
|
||||
from aiohttp import ClientSession
|
||||
from PIL import Image
|
||||
|
||||
from aiohttp import ClientSession
|
||||
from gsuid_core.data_store import get_res_path
|
||||
|
||||
T = TypeVar("T")
|
||||
|
@ -3,24 +3,24 @@ from pathlib import Path
|
||||
from typing import Tuple, cast
|
||||
|
||||
from PIL import Image
|
||||
|
||||
from gsuid_core.sv import SV
|
||||
from gsuid_core.bot import Bot
|
||||
from gsuid_core.models import Event
|
||||
from gsuid_core.sv import SV
|
||||
|
||||
from .to_card import api_to_card
|
||||
from ..utils.convert import get_uid
|
||||
from ..utils.sr_prefix import PREFIX
|
||||
from ..utils.error_reply import UID_HINT
|
||||
from ..utils.image.convert import convert_img
|
||||
from ..utils.resource.RESOURCE_PATH import TEMP_PATH
|
||||
from ..utils.sr_prefix import PREFIX
|
||||
from .draw_char_img import cal, draw_char_info_img, get_char_data
|
||||
from .to_card import api_to_card
|
||||
from .draw_char_img import cal, get_char_data, draw_char_info_img
|
||||
|
||||
sv_char_info_config = SV('sr面板设置', pm=2)
|
||||
sv_get_char_info = SV('sr面板查询', priority=10)
|
||||
sv_get_sr_original_pic = SV('sr查看面板原图', priority=5)
|
||||
sv_char_damage_cal = SV('sr伤害计算')
|
||||
|
||||
|
||||
@sv_char_damage_cal.on_prefix(f'{PREFIX}伤害计算')
|
||||
async def send_damage_msg(bot: Bot, ev: Event):
|
||||
msg = ''.join(re.findall('[\u4e00-\u9fa5 ]', ev.text))
|
||||
|
@ -1,19 +1,35 @@
|
||||
import re
|
||||
import json
|
||||
import math
|
||||
import re
|
||||
from pathlib import Path
|
||||
from typing import Dict, Union
|
||||
|
||||
from mpmath import mp, nstr
|
||||
from PIL import Image, ImageDraw
|
||||
|
||||
from gsuid_core.logger import logger
|
||||
from gsuid_core.utils.image.convert import convert_img
|
||||
from gsuid_core.utils.image.image_tools import draw_text_by_line
|
||||
|
||||
from .to_data import api_to_dict
|
||||
from .effect.Role import RoleInstance
|
||||
from .mono.Character import Character
|
||||
from ..utils.error_reply import CHAR_HINT
|
||||
from ..utils.excel.read_excel import light_cone_ranks
|
||||
from ..utils.fonts.first_world import fw_font_28
|
||||
from ..utils.excel.read_excel import light_cone_ranks
|
||||
from ..utils.map.name_covert import name_to_avatar_id, alias_to_char_name
|
||||
from ..utils.map.SR_MAP_PATH import (
|
||||
RelicId2Rarity,
|
||||
AvatarRelicScore,
|
||||
avatarId2Name,
|
||||
avatarId2DamageType,
|
||||
)
|
||||
from ..utils.resource.RESOURCE_PATH import (
|
||||
RELIC_PATH,
|
||||
SKILL_PATH,
|
||||
PLAYER_PATH,
|
||||
WEAPON_PATH,
|
||||
CHAR_PORTRAIT_PATH,
|
||||
)
|
||||
from ..utils.fonts.starrail_fonts import (
|
||||
sr_font_20,
|
||||
sr_font_23,
|
||||
@ -23,23 +39,6 @@ from ..utils.fonts.starrail_fonts import (
|
||||
sr_font_34,
|
||||
sr_font_38,
|
||||
)
|
||||
from ..utils.map.name_covert import alias_to_char_name, name_to_avatar_id
|
||||
from ..utils.map.SR_MAP_PATH import (
|
||||
AvatarRelicScore,
|
||||
RelicId2Rarity,
|
||||
avatarId2DamageType,
|
||||
avatarId2Name,
|
||||
)
|
||||
from ..utils.resource.RESOURCE_PATH import (
|
||||
CHAR_PORTRAIT_PATH,
|
||||
PLAYER_PATH,
|
||||
RELIC_PATH,
|
||||
SKILL_PATH,
|
||||
WEAPON_PATH,
|
||||
)
|
||||
from .effect.Role import RoleInstance
|
||||
from .mono.Character import Character
|
||||
from .to_data import api_to_dict
|
||||
|
||||
Excel_path = Path(__file__).parent / 'effect'
|
||||
with Path.open(Excel_path / 'Excel' / 'seele.json', encoding='utf-8') as f:
|
||||
@ -722,7 +721,13 @@ async def cal(char_data: Dict):
|
||||
skill_info_list = []
|
||||
if char.char_id in [1102, 1204, 1107, 1213, 1006]:
|
||||
if char.char_id == 1213:
|
||||
for skill_type in ['Normal', 'Normal1', 'Normal2', 'Normal3', 'Ultra']:
|
||||
for skill_type in [
|
||||
'Normal',
|
||||
'Normal1',
|
||||
'Normal2',
|
||||
'Normal3',
|
||||
'Ultra',
|
||||
]:
|
||||
role = RoleInstance(char)
|
||||
im_tmp = await role.cal_damage(skill_type)
|
||||
skill_info_list.append(im_tmp)
|
||||
|
@ -1,14 +1,10 @@
|
||||
from typing import List
|
||||
|
||||
from mpmath import mp
|
||||
|
||||
from gsuid_core.logger import logger
|
||||
|
||||
from ..Base.AvatarBase import BaseAvatar, BaseAvatarBuff
|
||||
from ..Base.model import (
|
||||
DamageInstanceAvatar,
|
||||
DamageInstanceSkill,
|
||||
)
|
||||
from ..Base.model import DamageInstanceSkill, DamageInstanceAvatar
|
||||
|
||||
mp.dps = 14
|
||||
|
||||
@ -16,7 +12,9 @@ mp.dps = 14
|
||||
class Seele(BaseAvatar):
|
||||
Buff: BaseAvatarBuff
|
||||
|
||||
def __init__(self, char: DamageInstanceAvatar, skills: List[DamageInstanceSkill]):
|
||||
def __init__(
|
||||
self, char: DamageInstanceAvatar, skills: List[DamageInstanceSkill]
|
||||
):
|
||||
super().__init__(char=char, skills=skills)
|
||||
self.eidolon_attribute = {}
|
||||
self.extra_ability_attribute = {}
|
||||
@ -36,14 +34,17 @@ class Seele(BaseAvatar):
|
||||
|
||||
def extra_ability(self):
|
||||
# 额外能力 割裂 抗性穿透提高20
|
||||
self.extra_ability_attribute[
|
||||
'QuantumResistancePenetration'
|
||||
] = mp.mpf(0.2)
|
||||
self.extra_ability_attribute['QuantumResistancePenetration'] = mp.mpf(
|
||||
0.2
|
||||
)
|
||||
|
||||
|
||||
class JingYuan(BaseAvatar):
|
||||
Buff: BaseAvatarBuff
|
||||
|
||||
def __init__(self, char: DamageInstanceAvatar, skills: List[DamageInstanceSkill]):
|
||||
def __init__(
|
||||
self, char: DamageInstanceAvatar, skills: List[DamageInstanceSkill]
|
||||
):
|
||||
super().__init__(char=char, skills=skills)
|
||||
self.eidolon_attribute = {}
|
||||
self.extra_ability_attribute = {}
|
||||
@ -64,18 +65,17 @@ class JingYuan(BaseAvatar):
|
||||
def extra_ability(self):
|
||||
logger.info('额外能力')
|
||||
logger.info('【神君】下回合的攻击段数大于等于6段,则其下回合的暴击伤害提高25%。')
|
||||
self.extra_ability_attribute[
|
||||
'CriticalDamageBase'
|
||||
] = mp.mpf(0.25)
|
||||
self.extra_ability_attribute['CriticalDamageBase'] = mp.mpf(0.25)
|
||||
logger.info('施放战技后,暴击率提升10%')
|
||||
self.extra_ability_attribute[
|
||||
'CriticalChanceBase'
|
||||
] = mp.mpf(0.1)
|
||||
self.extra_ability_attribute['CriticalChanceBase'] = mp.mpf(0.1)
|
||||
|
||||
|
||||
class Clara(BaseAvatar):
|
||||
Buff: BaseAvatarBuff
|
||||
|
||||
def __init__(self, char: DamageInstanceAvatar, skills: List[DamageInstanceSkill]):
|
||||
def __init__(
|
||||
self, char: DamageInstanceAvatar, skills: List[DamageInstanceSkill]
|
||||
):
|
||||
super().__init__(char=char, skills=skills)
|
||||
self.eidolon_attribute = {}
|
||||
self.extra_ability_attribute = {}
|
||||
@ -92,17 +92,16 @@ class Clara(BaseAvatar):
|
||||
def extra_ability(self):
|
||||
logger.info('额外能力')
|
||||
logger.info('史瓦罗的反击造成的伤害提高30%')
|
||||
self.extra_ability_attribute[
|
||||
'TalentDmgAdd'
|
||||
] = mp.mpf(0.3)
|
||||
self.extra_ability_attribute[
|
||||
'UltraDmgAdd'
|
||||
] = mp.mpf(0.3)
|
||||
self.extra_ability_attribute['TalentDmgAdd'] = mp.mpf(0.3)
|
||||
self.extra_ability_attribute['UltraDmgAdd'] = mp.mpf(0.3)
|
||||
|
||||
|
||||
class Danhengil(BaseAvatar):
|
||||
Buff: BaseAvatarBuff
|
||||
|
||||
def __init__(self, char: DamageInstanceAvatar, skills: List[DamageInstanceSkill]):
|
||||
def __init__(
|
||||
self, char: DamageInstanceAvatar, skills: List[DamageInstanceSkill]
|
||||
):
|
||||
super().__init__(char=char, skills=skills)
|
||||
self.eidolon_attribute = {}
|
||||
self.extra_ability_attribute = {}
|
||||
@ -125,14 +124,15 @@ class Danhengil(BaseAvatar):
|
||||
def extra_ability(self):
|
||||
logger.info('额外能力')
|
||||
logger.info('对拥有虚数属性弱点的敌方目标造成伤害时,暴击伤害提高24%。')
|
||||
self.extra_ability_attribute[
|
||||
'CriticalDamageBase'
|
||||
] = mp.mpf(0.24)
|
||||
self.extra_ability_attribute['CriticalDamageBase'] = mp.mpf(0.24)
|
||||
|
||||
|
||||
class Silverwolf(BaseAvatar):
|
||||
Buff: BaseAvatarBuff
|
||||
|
||||
def __init__(self, char: DamageInstanceAvatar, skills: List[DamageInstanceSkill]):
|
||||
def __init__(
|
||||
self, char: DamageInstanceAvatar, skills: List[DamageInstanceSkill]
|
||||
):
|
||||
super().__init__(char=char, skills=skills)
|
||||
self.eidolon_attribute = {}
|
||||
self.extra_ability_attribute = {}
|
||||
@ -144,30 +144,29 @@ class Silverwolf(BaseAvatar):
|
||||
|
||||
def eidolons(self):
|
||||
if self.avatar_rank >= 6:
|
||||
self.extra_ability_attribute[
|
||||
'AllDamageAddedRatio'
|
||||
] = mp.mpf(1)
|
||||
self.extra_ability_attribute['AllDamageAddedRatio'] = mp.mpf(1)
|
||||
|
||||
def extra_ability(self):
|
||||
logger.info('额外能力')
|
||||
logger.info('战技降抗')
|
||||
logger.info('战技使目标全属性抗性降低的效果额外降低3%')
|
||||
enemy_status_resistance = self.BPSkill_d() + 0.03
|
||||
self.extra_ability_attribute[
|
||||
'QuantumResistancePenetration'
|
||||
] = mp.mpf(enemy_status_resistance)
|
||||
self.extra_ability_attribute['QuantumResistancePenetration'] = mp.mpf(
|
||||
enemy_status_resistance
|
||||
)
|
||||
logger.info('终结技降防')
|
||||
ultra_defence = self.Ultra_d()
|
||||
logger.info('天赋降防')
|
||||
talent_defence = self.Talent()
|
||||
ignore_defence = ultra_defence + talent_defence
|
||||
self.extra_ability_attribute[
|
||||
'ignore_defence'
|
||||
] = mp.mpf(ignore_defence)
|
||||
self.extra_ability_attribute['ignore_defence'] = mp.mpf(ignore_defence)
|
||||
|
||||
|
||||
class Avatar:
|
||||
@classmethod
|
||||
def create(cls, char: DamageInstanceAvatar, skills: List[DamageInstanceSkill]):
|
||||
def create(
|
||||
cls, char: DamageInstanceAvatar, skills: List[DamageInstanceSkill]
|
||||
):
|
||||
if char.id_ == 1006:
|
||||
return Silverwolf(char, skills)
|
||||
if char.id_ == 1213:
|
||||
|
@ -1,13 +1,13 @@
|
||||
import json
|
||||
from abc import abstractmethod
|
||||
from pathlib import Path
|
||||
from typing import List
|
||||
from pathlib import Path
|
||||
from abc import abstractmethod
|
||||
|
||||
from mpmath import mp
|
||||
|
||||
from ....utils.excel.read_excel import AvatarPromotion
|
||||
from .model import DamageInstanceAvatar, DamageInstanceSkill
|
||||
from .SkillBase import BaseSkills
|
||||
from ....utils.excel.read_excel import AvatarPromotion
|
||||
from .model import DamageInstanceSkill, DamageInstanceAvatar
|
||||
|
||||
path = Path(__file__).parent.parent
|
||||
with Path.open(path / 'Excel' / 'seele.json', encoding='utf-8') as f:
|
||||
@ -18,7 +18,9 @@ mp.dps = 14
|
||||
|
||||
class BaseAvatarBuff:
|
||||
@classmethod
|
||||
def create(cls, char: DamageInstanceAvatar, skills: List[DamageInstanceSkill]):
|
||||
def create(
|
||||
cls, char: DamageInstanceAvatar, skills: List[DamageInstanceSkill]
|
||||
):
|
||||
cls.extra_ability_id = []
|
||||
if char.extra_ability:
|
||||
for extra_ability in char.extra_ability:
|
||||
@ -39,7 +41,9 @@ class BaseAvatarBuff:
|
||||
|
||||
|
||||
class BaseAvatar:
|
||||
def __init__(self, char: DamageInstanceAvatar, skills: List[DamageInstanceSkill]):
|
||||
def __init__(
|
||||
self, char: DamageInstanceAvatar, skills: List[DamageInstanceSkill]
|
||||
):
|
||||
self.Skill = BaseSkills.create(char=char, skills=skills)
|
||||
self.Buff = BaseAvatarBuff.create(char=char, skills=skills)
|
||||
self.avatar_id = char.id_
|
||||
@ -125,7 +129,9 @@ class BaseAvatar:
|
||||
|
||||
def Talent(self):
|
||||
return mp.mpf(
|
||||
skill_dict[str(self.avatar_id)]['Talent'][self.Skill.Talent_.level - 1]
|
||||
skill_dict[str(self.avatar_id)]['Talent'][
|
||||
self.Skill.Talent_.level - 1
|
||||
]
|
||||
)
|
||||
|
||||
def BPSkill_d(self):
|
||||
@ -145,7 +151,9 @@ class BaseAvatar:
|
||||
def Talent_add(self):
|
||||
if self.avatar_id in [1102]:
|
||||
return mp.mpf(
|
||||
skill_dict[str(self.avatar_id)]['Talent'][self.Skill.Talent_.level - 1]
|
||||
skill_dict[str(self.avatar_id)]['Talent'][
|
||||
self.Skill.Talent_.level - 1
|
||||
]
|
||||
)
|
||||
else:
|
||||
return mp.mpf(0)
|
||||
|
@ -1,12 +1,11 @@
|
||||
from abc import abstractmethod
|
||||
from typing import Dict
|
||||
from abc import abstractmethod
|
||||
|
||||
from mpmath import mp
|
||||
|
||||
from gsuid_core.logger import logger
|
||||
|
||||
from ....utils.map.SR_MAP_PATH import RelicSetSkill
|
||||
from .model import DamageInstanceRelic
|
||||
from ....utils.map.SR_MAP_PATH import RelicSetSkill
|
||||
|
||||
mp.dps = 14
|
||||
|
||||
@ -22,10 +21,7 @@ class SingleRelic:
|
||||
|
||||
def get_attribute_(self):
|
||||
# MainAffix
|
||||
if (
|
||||
self.raw_relic.MainAffix.Property
|
||||
in self.relic_attribute_bonus
|
||||
):
|
||||
if self.raw_relic.MainAffix.Property in self.relic_attribute_bonus:
|
||||
self.relic_attribute_bonus[
|
||||
self.raw_relic.MainAffix.Property
|
||||
] += mp.mpf(self.raw_relic.MainAffix.Value)
|
||||
|
@ -1,10 +1,10 @@
|
||||
import json
|
||||
from pathlib import Path
|
||||
from typing import List
|
||||
from pathlib import Path
|
||||
|
||||
from mpmath import mp
|
||||
|
||||
from .model import DamageInstanceAvatar, DamageInstanceSkill
|
||||
from .model import DamageInstanceSkill, DamageInstanceAvatar
|
||||
|
||||
mp.dps = 14
|
||||
|
||||
@ -28,7 +28,9 @@ class BaseSkills:
|
||||
Talent_: SingleSkill
|
||||
|
||||
@classmethod
|
||||
def create(cls, char: DamageInstanceAvatar, skills: List[DamageInstanceSkill]):
|
||||
def create(
|
||||
cls, char: DamageInstanceAvatar, skills: List[DamageInstanceSkill]
|
||||
):
|
||||
for skill in skills:
|
||||
skill_attack_type = skill.skillAttackType
|
||||
if skill_attack_type == 'Normal':
|
||||
|
@ -1,11 +1,11 @@
|
||||
from abc import abstractmethod
|
||||
from typing import Dict
|
||||
from abc import abstractmethod
|
||||
|
||||
from mpmath import mp
|
||||
|
||||
from .model import DamageInstanceWeapon
|
||||
from ....utils.excel.read_excel import EquipmentPromotion
|
||||
from ....utils.map.SR_MAP_PATH import EquipmentID2AbilityProperty
|
||||
from .model import DamageInstanceWeapon
|
||||
|
||||
mp.dps = 14
|
||||
|
||||
|
@ -218,6 +218,64 @@
|
||||
0.50000000044703484
|
||||
]
|
||||
}
|
||||
},
|
||||
"21001": {
|
||||
"Param": {
|
||||
"AllDamageAddedRatio": [
|
||||
0.12000000022351742,
|
||||
0.1500000002793968,
|
||||
0.1800000003352761,
|
||||
0.210000003911555,
|
||||
0.24000000044703484
|
||||
]
|
||||
}
|
||||
},
|
||||
"21022": {
|
||||
"Param": {
|
||||
"AllDamageAddedRatio": [
|
||||
0.16000000022351742,
|
||||
0.2050000002793968,
|
||||
0.2400000003352761,
|
||||
0.2850000003911555,
|
||||
0.32000000044703484
|
||||
]
|
||||
}
|
||||
},
|
||||
"21015": {
|
||||
"Param": {
|
||||
"ignore_defence": [
|
||||
0.12000000022351742,
|
||||
0.1300000002793968,
|
||||
0.1400000003352761,
|
||||
0.1500000003911555,
|
||||
0.16000000044703484
|
||||
]
|
||||
}
|
||||
},
|
||||
"23004": {
|
||||
"Param": {
|
||||
"AllDamageAddedRatio": [
|
||||
0.2400000000745058,
|
||||
0.28000000009313226,
|
||||
0.32000000011175871,
|
||||
0.36000000013038516,
|
||||
0.4000000001490116
|
||||
],
|
||||
"A2_StatusProbability": [
|
||||
0.18000000022351742,
|
||||
0.2100000002793968,
|
||||
0.2400000003352761,
|
||||
0.2700000003911555,
|
||||
0.30000000044703484
|
||||
],
|
||||
"A2_AttackAddedRatio": [
|
||||
0.2400000000745058,
|
||||
0.28000000009313226,
|
||||
0.32000000011175871,
|
||||
0.36000000013038516,
|
||||
0.4000000001490116
|
||||
]
|
||||
}
|
||||
},
|
||||
"23007": {
|
||||
"Param": {
|
||||
@ -236,6 +294,24 @@
|
||||
0.20000000044703484
|
||||
]
|
||||
}
|
||||
},
|
||||
"23006": {
|
||||
"Param": {
|
||||
"SpeedAddedRatio": [
|
||||
0.04800000022351742,
|
||||
0.0560000002793968,
|
||||
0.0640000003352761,
|
||||
0.0720000003911555,
|
||||
0.0800000044703484
|
||||
],
|
||||
"AllDamageAddedRatio": [
|
||||
0.2400000000745058,
|
||||
0.28000000009313226,
|
||||
0.32000000011175871,
|
||||
0.36000000013038516,
|
||||
0.4000000001490116
|
||||
]
|
||||
}
|
||||
},
|
||||
"21020": {
|
||||
"Param": {
|
||||
|
@ -1,12 +1,12 @@
|
||||
from collections import Counter
|
||||
from typing import Dict, List
|
||||
from collections import Counter
|
||||
|
||||
from gsuid_core.logger import logger
|
||||
from mpmath import mp
|
||||
from gsuid_core.logger import logger
|
||||
|
||||
from ..Base.model import DamageInstanceRelic
|
||||
from ..Base.RelicBase import BaseRelicSetSkill, SingleRelic
|
||||
from ..utils import merge_attribute
|
||||
from ..Base.model import DamageInstanceRelic
|
||||
from ..Base.RelicBase import SingleRelic, BaseRelicSetSkill
|
||||
|
||||
|
||||
class Relic101(BaseRelicSetSkill):
|
||||
@ -173,6 +173,7 @@ class Relic108(BaseRelicSetSkill):
|
||||
)
|
||||
return attribute_bonus
|
||||
|
||||
|
||||
class Relic109(BaseRelicSetSkill):
|
||||
def __init__(self, set_id: int, count: int):
|
||||
super().__init__(set_id, count)
|
||||
@ -193,6 +194,7 @@ class Relic109(BaseRelicSetSkill):
|
||||
)
|
||||
return attribute_bonus
|
||||
|
||||
|
||||
class Relic110(BaseRelicSetSkill):
|
||||
def __init__(self, set_id: int, count: int):
|
||||
super().__init__(set_id, count)
|
||||
@ -259,6 +261,49 @@ class Relic112(BaseRelicSetSkill):
|
||||
return attribute_bonus
|
||||
|
||||
|
||||
class Relic113(BaseRelicSetSkill):
|
||||
def __init__(self, set_id: int, count: int):
|
||||
super().__init__(set_id, count)
|
||||
self._count = count
|
||||
|
||||
async def check(self, base_attr: Dict, attribute_bonus: Dict):
|
||||
'''
|
||||
当装备者受到攻击或被我方目标消耗生命值后,暴击率提高8%,持续2回合,该效果最多叠加2层。
|
||||
'''
|
||||
logger.info('Relic113 check success')
|
||||
return True
|
||||
|
||||
async def set_skill_ability(self, base_attr: Dict, attribute_bonus: Dict):
|
||||
if self.pieces4 and await self.check(base_attr, attribute_bonus):
|
||||
logger.info('当装备者受到攻击或被我方目标消耗生命值后')
|
||||
critical_chance_base = attribute_bonus.get('CriticalChanceBase', 0)
|
||||
attribute_bonus['CriticalChanceBase'] = (
|
||||
critical_chance_base + mp.mpf(0.08000000009313226) * 2
|
||||
)
|
||||
return attribute_bonus
|
||||
|
||||
|
||||
class Relic114(BaseRelicSetSkill):
|
||||
def __init__(self, set_id: int, count: int):
|
||||
super().__init__(set_id, count)
|
||||
self._count = count
|
||||
|
||||
async def check(self, base_attr: Dict, attribute_bonus: Dict):
|
||||
'''
|
||||
当装备者对我方目标施放终结技时,我方全体速度提高12%,持续1回合,该效果无法叠加。
|
||||
'''
|
||||
logger.info('Relic114 check success')
|
||||
return True
|
||||
|
||||
async def set_skill_ability(self, base_attr: Dict, attribute_bonus: Dict):
|
||||
if self.pieces4 and await self.check(base_attr, attribute_bonus):
|
||||
speed_added_ratio = attribute_bonus.get('SpeedAddedRatio', 0)
|
||||
attribute_bonus['SpeedAddedRatio'] = speed_added_ratio + mp.mpf(
|
||||
0.12000000011175871
|
||||
)
|
||||
return attribute_bonus
|
||||
|
||||
|
||||
class Relic301(BaseRelicSetSkill):
|
||||
def __init__(self, set_id: int, count: int):
|
||||
super().__init__(set_id, count)
|
||||
@ -334,7 +379,7 @@ class Relic304(BaseRelicSetSkill):
|
||||
备者的效果命中大于等于50%
|
||||
'''
|
||||
merged_attr = await merge_attribute(base_attr, attribute_bonus)
|
||||
if merged_attr['StatusProbability'] >= mp.mpf(0.5000000004656613):
|
||||
if merged_attr['StatusResistanceBase'] >= mp.mpf(0.5000000004656613):
|
||||
logger.info('Relic306 check success')
|
||||
return True
|
||||
return None
|
||||
@ -440,6 +485,7 @@ class Relic308(BaseRelicSetSkill):
|
||||
logger.info('ModifyActionDelay')
|
||||
return attribute_bonus
|
||||
|
||||
|
||||
class Relic309(BaseRelicSetSkill):
|
||||
def __init__(self, set_id: int, count: int):
|
||||
super().__init__(set_id, count)
|
||||
@ -466,6 +512,30 @@ class Relic309(BaseRelicSetSkill):
|
||||
)
|
||||
return attribute_bonus
|
||||
|
||||
|
||||
class Relic310(BaseRelicSetSkill):
|
||||
def __init__(self, set_id: int, count: int):
|
||||
super().__init__(set_id, count)
|
||||
|
||||
async def check(self, base_attr: Dict, attribute_bonus: Dict):
|
||||
'''
|
||||
当装备者的效果抵抗大于等于30%时,我方全体暴击伤害提高10%。
|
||||
'''
|
||||
merged_attr = await merge_attribute(base_attr, attribute_bonus)
|
||||
if merged_attr['StatusResistanceBase'] >= mp.mpf(0.3):
|
||||
logger.info('Relic310 check success')
|
||||
return True
|
||||
return None
|
||||
|
||||
async def set_skill_ability(self, base_attr: Dict, attribute_bonus: Dict):
|
||||
if self.pieces2 and await self.check(base_attr, attribute_bonus):
|
||||
critical_damage_base = attribute_bonus.get('CriticalDamageBase', 0)
|
||||
attribute_bonus[
|
||||
'CriticalDamageBase'
|
||||
] = critical_damage_base + mp.mpf(0.10000000018626451)
|
||||
return attribute_bonus
|
||||
|
||||
|
||||
class RelicSet:
|
||||
HEAD: SingleRelic
|
||||
HAND: SingleRelic
|
||||
@ -543,6 +613,10 @@ class RelicSet:
|
||||
cls.SetSkill.append(Relic111(set_id, count))
|
||||
elif set_id == 112:
|
||||
cls.SetSkill.append(Relic112(set_id, count))
|
||||
elif set_id == 113:
|
||||
cls.SetSkill.append(Relic113(set_id, count))
|
||||
elif set_id == 114:
|
||||
cls.SetSkill.append(Relic114(set_id, count))
|
||||
elif set_id == 301:
|
||||
cls.SetSkill.append(Relic301(set_id, count))
|
||||
elif set_id == 302:
|
||||
@ -561,5 +635,7 @@ class RelicSet:
|
||||
cls.SetSkill.append(Relic308(set_id, count))
|
||||
elif set_id == 309:
|
||||
cls.SetSkill.append(Relic309(set_id, count))
|
||||
elif set_id == 310:
|
||||
cls.SetSkill.append(Relic310(set_id, count))
|
||||
else:
|
||||
raise Exception(f'Unknow SetId: {set_id}')
|
||||
|
@ -1,12 +1,12 @@
|
||||
from gsuid_core.logger import logger
|
||||
from mpmath import mp
|
||||
from gsuid_core.logger import logger
|
||||
|
||||
from ..mono.Character import Character
|
||||
from .Avatar.Avatar import Avatar
|
||||
from .Weapon.Weapon import Weapon
|
||||
from .utils import merge_attribute
|
||||
from ..mono.Character import Character
|
||||
from .Base.model import DamageInstance
|
||||
from .Relic.Relic import RelicSet, SingleRelic
|
||||
from .utils import merge_attribute
|
||||
from .Weapon.Weapon import Weapon
|
||||
|
||||
mp.dps = 14
|
||||
|
||||
@ -115,44 +115,22 @@ class RoleInstance:
|
||||
raise Exception('attribute_bonus is None')
|
||||
for attribute in self.weapon.__dict__['weapon_attribute']:
|
||||
if attribute in self.attribute_bonus:
|
||||
self.attribute_bonus[
|
||||
attribute
|
||||
] += self.weapon.__dict__['weapon_attribute'][attribute]
|
||||
self.attribute_bonus[attribute] += self.weapon.__dict__[
|
||||
'weapon_attribute'
|
||||
][attribute]
|
||||
else:
|
||||
self.attribute_bonus[
|
||||
attribute
|
||||
] = self.weapon.__dict__['weapon_attribute'][attribute]
|
||||
self.attribute_bonus[attribute] = self.weapon.__dict__[
|
||||
'weapon_attribute'
|
||||
][attribute]
|
||||
|
||||
async def cal_damage(self, skill_type):
|
||||
logger.info('base_attr')
|
||||
logger.info(self.base_attr)
|
||||
logger.info('attribute_bonus')
|
||||
logger.info(self.attribute_bonus)
|
||||
# 检查武器战斗生效的buff
|
||||
logger.info('检查武器战斗生效的buff')
|
||||
Ultra_Use = self.avatar.Ultra_Use()
|
||||
logger.info('Ultra_Use')
|
||||
logger.info(Ultra_Use)
|
||||
if self.attribute_bonus is None:
|
||||
raise Exception('attribute_bonus is None')
|
||||
self.attribute_bonus = await self.weapon.weapon_ability(
|
||||
Ultra_Use, self.base_attr, self.attribute_bonus
|
||||
)
|
||||
logger.info(self.attribute_bonus)
|
||||
logger.info('检查遗器套装战斗生效的buff')
|
||||
for set_skill in self.relic_set.SetSkill:
|
||||
self.attribute_bonus = await set_skill.set_skill_ability(
|
||||
self.base_attr, self.attribute_bonus
|
||||
)
|
||||
if self.attribute_bonus is None:
|
||||
raise Exception('attribute_bonus is None')
|
||||
merged_attr = await merge_attribute(
|
||||
self.base_attr, self.attribute_bonus
|
||||
)
|
||||
|
||||
skill_info = self.avatar.Skill_Info(skill_type)
|
||||
|
||||
# 技能区
|
||||
skill_info = self.avatar.Skill_Info(skill_type)
|
||||
if skill_type == 'Normal':
|
||||
skill_multiplier = self.avatar.Normal()
|
||||
elif skill_type == 'BPSkill':
|
||||
@ -160,7 +138,10 @@ class RoleInstance:
|
||||
elif skill_type == 'Ultra':
|
||||
if self.raw_data.avatar.id_ == 1107:
|
||||
skill_multiplier = self.avatar.Talent() + self.avatar.Ultra()
|
||||
elif self.raw_data.avatar.id_ == 1006 and self.raw_data.avatar.rank >= 4:
|
||||
elif (
|
||||
self.raw_data.avatar.id_ == 1006
|
||||
and self.raw_data.avatar.rank >= 4
|
||||
):
|
||||
skill_multiplier = self.avatar.Ultra() + 1
|
||||
else:
|
||||
skill_multiplier = self.avatar.Ultra()
|
||||
@ -175,7 +156,53 @@ class RoleInstance:
|
||||
|
||||
logger.info(f'技能区总: {skill_multiplier}')
|
||||
|
||||
skill_info_list = []
|
||||
# 检查武器战斗生效的buff
|
||||
logger.info('检查武器战斗生效的buff')
|
||||
Ultra_Use = self.avatar.Ultra_Use()
|
||||
logger.info('Ultra_Use')
|
||||
logger.info(Ultra_Use)
|
||||
if self.attribute_bonus is None:
|
||||
raise Exception('attribute_bonus is None')
|
||||
self.attribute_bonus = await self.weapon.weapon_ability(
|
||||
Ultra_Use, self.base_attr, self.attribute_bonus
|
||||
)
|
||||
logger.info(self.attribute_bonus)
|
||||
|
||||
# 检查是否有对某一个技能的属性加成
|
||||
logger.info('检查是否有对某一个技能的属性加成')
|
||||
for attr in self.attribute_bonus:
|
||||
# 攻击加成
|
||||
if attr.__contains__('AttackAddedRatio'):
|
||||
attr_name = attr.split('AttackAddedRatio')[0]
|
||||
if attr_name == skill_type:
|
||||
attack_added_ratio = self.attribute_bonus.get(
|
||||
'AttackAddedRatio', 0
|
||||
)
|
||||
self.attribute_bonus[
|
||||
'AttackAddedRatio'
|
||||
] = attack_added_ratio + mp.mpf(self.attribute_bonus[attr])
|
||||
# 效果命中加成
|
||||
if attr.__contains__('StatusProbabilityBase'):
|
||||
attr_name = attr.split('StatusProbabilityBase')[0]
|
||||
if attr_name == skill_type:
|
||||
status_probability = self.attribute_bonus.get(
|
||||
'StatusProbabilityBase', 0
|
||||
)
|
||||
self.attribute_bonus[
|
||||
'StatusProbabilityBase'
|
||||
] = status_probability + mp.mpf(self.attribute_bonus[attr])
|
||||
logger.info(self.attribute_bonus)
|
||||
logger.info('检查遗器套装战斗生效的buff')
|
||||
for set_skill in self.relic_set.SetSkill:
|
||||
self.attribute_bonus = await set_skill.set_skill_ability(
|
||||
self.base_attr, self.attribute_bonus
|
||||
)
|
||||
if self.attribute_bonus is None:
|
||||
raise Exception('attribute_bonus is None')
|
||||
merged_attr = await merge_attribute(
|
||||
self.base_attr, self.attribute_bonus
|
||||
)
|
||||
|
||||
# 技能类型为攻击
|
||||
if skill_info[0] == 'attack':
|
||||
skill_multiplier = skill_multiplier / skill_info[2]
|
||||
@ -199,7 +226,9 @@ class RoleInstance:
|
||||
Normal_Penetration = merged_attr.get(
|
||||
'Normal_ImaginaryResistancePenetration', 0
|
||||
)
|
||||
resistance_area = resistance_area - (0 - Normal_Penetration)
|
||||
resistance_area = resistance_area - (
|
||||
0 - Normal_Penetration
|
||||
)
|
||||
logger.info(f'抗性区: {resistance_area}')
|
||||
|
||||
# 防御区
|
||||
@ -211,7 +240,9 @@ class RoleInstance:
|
||||
ignore_defence = 1 - merged_attr[attr]
|
||||
break
|
||||
logger.info(f'ignore_defence {ignore_defence}')
|
||||
enemy_defence = (self.avatar.avatar_level * 10 + 200) * ignore_defence
|
||||
enemy_defence = (
|
||||
self.avatar.avatar_level * 10 + 200
|
||||
) * ignore_defence
|
||||
defence_multiplier = (self.avatar.avatar_level * 10 + 200) / (
|
||||
self.avatar.avatar_level * 10 + 200 + enemy_defence
|
||||
)
|
||||
@ -236,7 +267,10 @@ class RoleInstance:
|
||||
for attr in merged_attr:
|
||||
if attr.__contains__('AddedRatio'):
|
||||
attr_name = attr.split('AddedRatio')[0]
|
||||
if attr_name == self.avatar.avatar_element or attr_name == 'AllDamage':
|
||||
if (
|
||||
attr_name == self.avatar.avatar_element
|
||||
or attr_name == 'AllDamage'
|
||||
):
|
||||
logger.info(
|
||||
f'{attr} 对 {self.avatar.avatar_element} '
|
||||
f'有 {merged_attr[attr]} 伤害加成'
|
||||
@ -310,10 +344,9 @@ class RoleInstance:
|
||||
atk_buff = min(10, int((i - 1) * (atk_buff + 1)))
|
||||
injury_add = atk_buff * injury_add
|
||||
qiwang_damage = (
|
||||
(critical_chance_base *
|
||||
(critical_damage_base + critical_damage_add))
|
||||
+ 1
|
||||
)
|
||||
critical_chance_base
|
||||
* (critical_damage_base + critical_damage_add)
|
||||
) + 1
|
||||
|
||||
damage_cd = (
|
||||
attack
|
||||
@ -339,9 +372,12 @@ class RoleInstance:
|
||||
damage_qw_z += damage_qw
|
||||
|
||||
attr_value_tz: float = self.base_attr.get('attack', 0)
|
||||
attack_tz = attr_value_tz + attr_value_tz * (
|
||||
1 + self.attribute_bonus['AttackAddedRatio'] + 2.144
|
||||
) + self.attribute_bonus['AttackDelta']
|
||||
attack_tz = (
|
||||
attr_value_tz
|
||||
+ attr_value_tz
|
||||
* (1 + self.attribute_bonus['AttackAddedRatio'] + 2.144)
|
||||
+ self.attribute_bonus['AttackDelta']
|
||||
)
|
||||
injury_add_tz = 0
|
||||
if self.avatar.avatar_element == 'Imaginary':
|
||||
injury_add_tz = 0.12
|
||||
@ -358,9 +394,6 @@ class RoleInstance:
|
||||
)
|
||||
|
||||
damage_tz_z += damage_tz
|
||||
logger.info(
|
||||
f'{skill_info[1]}第{i}段 暴击伤害: {damage_cd} 期望伤害{damage_qw}'
|
||||
)
|
||||
|
||||
if self.avatar.avatar_element == 'Thunder':
|
||||
element_area = 0
|
||||
|
@ -1,11 +1,11 @@
|
||||
import json
|
||||
from pathlib import Path
|
||||
from typing import Dict
|
||||
from pathlib import Path
|
||||
|
||||
from mpmath import mp
|
||||
|
||||
from ..Base.model import DamageInstanceWeapon
|
||||
from ..Base.WeaponBase import BaseWeapon
|
||||
from ..Base.model import DamageInstanceWeapon
|
||||
|
||||
path = Path(__file__).parent.parent
|
||||
with Path.open(path / 'Excel' / 'weapon_effect.json', encoding='utf-8') as f:
|
||||
@ -17,6 +17,7 @@ mp.dps = 14
|
||||
|
||||
class Arrows(BaseWeapon):
|
||||
weapon_base_attributes: Dict
|
||||
|
||||
def __init__(self, weapon: DamageInstanceWeapon):
|
||||
super().__init__(weapon)
|
||||
|
||||
@ -24,7 +25,9 @@ class Arrows(BaseWeapon):
|
||||
# 装备者消灭敌方目标
|
||||
return True
|
||||
|
||||
async def weapon_ability(self, Ultra_Use: int, base_attr: Dict, attribute_bonus: Dict):
|
||||
async def weapon_ability(
|
||||
self, Ultra_Use: int, base_attr: Dict, attribute_bonus: Dict
|
||||
):
|
||||
if await self.check():
|
||||
critical_chance_base = attribute_bonus.get('CriticalChance', 0)
|
||||
attribute_bonus['CriticalChance'] = critical_chance_base + mp.mpf(
|
||||
@ -37,6 +40,7 @@ class Arrows(BaseWeapon):
|
||||
|
||||
class ReturntoDarkness(BaseWeapon):
|
||||
weapon_base_attributes: Dict
|
||||
|
||||
def __init__(self, weapon: DamageInstanceWeapon):
|
||||
super().__init__(weapon)
|
||||
|
||||
@ -44,7 +48,9 @@ class ReturntoDarkness(BaseWeapon):
|
||||
# 装备者消灭敌方目标
|
||||
return True
|
||||
|
||||
async def weapon_ability(self, Ultra_Use: int, base_attr: Dict, attribute_bonus: Dict):
|
||||
async def weapon_ability(
|
||||
self, Ultra_Use: int, base_attr: Dict, attribute_bonus: Dict
|
||||
):
|
||||
if await self.check():
|
||||
pass
|
||||
return attribute_bonus
|
||||
@ -52,6 +58,7 @@ class ReturntoDarkness(BaseWeapon):
|
||||
|
||||
class Swordplay(BaseWeapon):
|
||||
weapon_base_attributes: Dict
|
||||
|
||||
def __init__(self, weapon: DamageInstanceWeapon):
|
||||
super().__init__(weapon)
|
||||
|
||||
@ -59,7 +66,9 @@ class Swordplay(BaseWeapon):
|
||||
# 装备者消灭敌方目标
|
||||
return True
|
||||
|
||||
async def weapon_ability(self, Ultra_Use: int, base_attr: Dict, attribute_bonus: Dict):
|
||||
async def weapon_ability(
|
||||
self, Ultra_Use: int, base_attr: Dict, attribute_bonus: Dict
|
||||
):
|
||||
if await self.check():
|
||||
all_damage_added_ratio = attribute_bonus.get(
|
||||
'AllDamageAddedRatio', 0
|
||||
@ -76,6 +85,7 @@ class Swordplay(BaseWeapon):
|
||||
|
||||
class DartingArrow(BaseWeapon):
|
||||
weapon_base_attributes: Dict
|
||||
|
||||
def __init__(self, weapon: DamageInstanceWeapon):
|
||||
super().__init__(weapon)
|
||||
|
||||
@ -83,7 +93,9 @@ class DartingArrow(BaseWeapon):
|
||||
# 装备者消灭敌方目标
|
||||
return True
|
||||
|
||||
async def weapon_ability(self, Ultra_Use: int, base_attr: Dict, attribute_bonus: Dict):
|
||||
async def weapon_ability(
|
||||
self, Ultra_Use: int, base_attr: Dict, attribute_bonus: Dict
|
||||
):
|
||||
if await self.check():
|
||||
attack_added_ratio = attribute_bonus.get('AttackAddedRatio', 0)
|
||||
attribute_bonus['AttackAddedRatio'] = attack_added_ratio + mp.mpf(
|
||||
@ -96,6 +108,7 @@ class DartingArrow(BaseWeapon):
|
||||
|
||||
class Adversarial(BaseWeapon):
|
||||
weapon_base_attributes: Dict
|
||||
|
||||
def __init__(self, weapon: DamageInstanceWeapon):
|
||||
super().__init__(weapon)
|
||||
|
||||
@ -103,7 +116,9 @@ class Adversarial(BaseWeapon):
|
||||
# 装备者消灭敌方目标
|
||||
return True
|
||||
|
||||
async def weapon_ability(self, Ultra_Use: int, base_attr: Dict, attribute_bonus: Dict):
|
||||
async def weapon_ability(
|
||||
self, Ultra_Use: int, base_attr: Dict, attribute_bonus: Dict
|
||||
):
|
||||
if await self.check():
|
||||
speed_added_ratio = attribute_bonus.get('SpeedAddedRatio', 0)
|
||||
attribute_bonus['SpeedAddedRatio'] = speed_added_ratio + mp.mpf(
|
||||
@ -117,6 +132,7 @@ class Adversarial(BaseWeapon):
|
||||
|
||||
class SubscribeforMore(BaseWeapon):
|
||||
weapon_base_attributes: Dict
|
||||
|
||||
def __init__(self, weapon: DamageInstanceWeapon):
|
||||
super().__init__(weapon)
|
||||
|
||||
@ -124,7 +140,9 @@ class SubscribeforMore(BaseWeapon):
|
||||
# 装备者的当前能量值等于其能量上限
|
||||
return True
|
||||
|
||||
async def weapon_ability(self, Ultra_Use: int, base_attr: Dict, attribute_bonus: Dict):
|
||||
async def weapon_ability(
|
||||
self, Ultra_Use: int, base_attr: Dict, attribute_bonus: Dict
|
||||
):
|
||||
if await self.check():
|
||||
normal_dmg_add = attribute_bonus.get('NormalDmgAdd', 0)
|
||||
attribute_bonus['NormalDmgAdd'] = normal_dmg_add + (
|
||||
@ -150,6 +168,7 @@ class SubscribeforMore(BaseWeapon):
|
||||
|
||||
class RiverFlowsinSpring(BaseWeapon):
|
||||
weapon_base_attributes: Dict
|
||||
|
||||
def __init__(self, weapon: DamageInstanceWeapon):
|
||||
super().__init__(weapon)
|
||||
|
||||
@ -158,7 +177,9 @@ class RiverFlowsinSpring(BaseWeapon):
|
||||
# 当装备者受到伤害后该效果失效,下个回合结束时该效果恢复。
|
||||
return True
|
||||
|
||||
async def weapon_ability(self, Ultra_Use: int, base_attr: Dict, attribute_bonus: Dict):
|
||||
async def weapon_ability(
|
||||
self, Ultra_Use: int, base_attr: Dict, attribute_bonus: Dict
|
||||
):
|
||||
if await self.check():
|
||||
speed_added_ratio = attribute_bonus.get('SpeedAddedRatio', 0)
|
||||
attribute_bonus['SpeedAddedRatio'] = speed_added_ratio + mp.mpf(
|
||||
@ -182,6 +203,7 @@ class RiverFlowsinSpring(BaseWeapon):
|
||||
|
||||
class SleepLiketheDead(BaseWeapon):
|
||||
weapon_base_attributes: Dict
|
||||
|
||||
def __init__(self, weapon: DamageInstanceWeapon):
|
||||
super().__init__(weapon)
|
||||
|
||||
@ -190,7 +212,9 @@ class SleepLiketheDead(BaseWeapon):
|
||||
# 该效果每3回合可以触发1次。
|
||||
return True
|
||||
|
||||
async def weapon_ability(self, Ultra_Use: int, base_attr: Dict, attribute_bonus: Dict):
|
||||
async def weapon_ability(
|
||||
self, Ultra_Use: int, base_attr: Dict, attribute_bonus: Dict
|
||||
):
|
||||
if await self.check():
|
||||
return attribute_bonus
|
||||
return None
|
||||
@ -198,6 +222,7 @@ class SleepLiketheDead(BaseWeapon):
|
||||
|
||||
class OnlySilenceRemains(BaseWeapon):
|
||||
weapon_base_attributes: Dict
|
||||
|
||||
def __init__(self, weapon: DamageInstanceWeapon):
|
||||
super().__init__(weapon)
|
||||
|
||||
@ -205,7 +230,9 @@ class OnlySilenceRemains(BaseWeapon):
|
||||
# 当场上的敌方目标数量小于等于2时
|
||||
return True
|
||||
|
||||
async def weapon_ability(self, Ultra_Use: int, base_attr: Dict, attribute_bonus: Dict):
|
||||
async def weapon_ability(
|
||||
self, Ultra_Use: int, base_attr: Dict, attribute_bonus: Dict
|
||||
):
|
||||
if await self.check():
|
||||
critical_chance_base = attribute_bonus.get('CriticalChanceBase', 0)
|
||||
attribute_bonus[
|
||||
@ -218,16 +245,20 @@ class OnlySilenceRemains(BaseWeapon):
|
||||
return attribute_bonus
|
||||
return None
|
||||
|
||||
|
||||
# 拂晓之前
|
||||
class BeforeDawn(BaseWeapon):
|
||||
weapon_base_attributes: Dict
|
||||
|
||||
def __init__(self, weapon: DamageInstanceWeapon):
|
||||
super().__init__(weapon)
|
||||
|
||||
async def check(self):
|
||||
pass
|
||||
|
||||
async def weapon_ability(self, Ultra_Use: int, base_attr: Dict, attribute_bonus: Dict):
|
||||
async def weapon_ability(
|
||||
self, Ultra_Use: int, base_attr: Dict, attribute_bonus: Dict
|
||||
):
|
||||
bp_skill_dmg_add = attribute_bonus.get('BPSkillDmgAdd', 0)
|
||||
attribute_bonus['BPSkillDmgAdd'] = bp_skill_dmg_add + (
|
||||
mp.mpf(
|
||||
@ -248,20 +279,23 @@ class BeforeDawn(BaseWeapon):
|
||||
)
|
||||
return attribute_bonus
|
||||
|
||||
|
||||
class IntheNight(BaseWeapon):
|
||||
weapon_base_attributes: Dict
|
||||
|
||||
def __init__(self, weapon: DamageInstanceWeapon):
|
||||
super().__init__(weapon)
|
||||
|
||||
async def check(self):
|
||||
pass
|
||||
|
||||
async def weapon_ability(self, Ultra_Use: int, base_attr: Dict, attribute_bonus: Dict):
|
||||
async def weapon_ability(
|
||||
self, Ultra_Use: int, base_attr: Dict, attribute_bonus: Dict
|
||||
):
|
||||
char_speed = (
|
||||
(mp.mpf(base_attr.get('speed', 0))
|
||||
+ mp.mpf(attribute_bonus.get('SpeedDelta', 0)))
|
||||
* (mp.mpf(attribute_bonus.get('SpeedAddedRatio', 0))+1)
|
||||
)
|
||||
mp.mpf(base_attr.get('speed', 0))
|
||||
+ mp.mpf(attribute_bonus.get('SpeedDelta', 0))
|
||||
) * (mp.mpf(attribute_bonus.get('SpeedAddedRatio', 0)) + 1)
|
||||
print(char_speed)
|
||||
count_ = min(6, int(mp.floor((char_speed - 100) / 10)))
|
||||
normal_dmg_add = attribute_bonus.get('NormalDmgAdd', 0)
|
||||
@ -296,6 +330,7 @@ class IntheNight(BaseWeapon):
|
||||
|
||||
class CruisingintheStellarSea(BaseWeapon):
|
||||
weapon_base_attributes: Dict
|
||||
|
||||
def __init__(self, weapon: DamageInstanceWeapon):
|
||||
super().__init__(weapon)
|
||||
|
||||
@ -304,7 +339,9 @@ class CruisingintheStellarSea(BaseWeapon):
|
||||
# 装备者消灭敌方目标
|
||||
return True
|
||||
|
||||
async def weapon_ability(self, Ultra_Use: int, base_attr: Dict, attribute_bonus: Dict):
|
||||
async def weapon_ability(
|
||||
self, Ultra_Use: int, base_attr: Dict, attribute_bonus: Dict
|
||||
):
|
||||
if await self.check():
|
||||
critical_chance_base = attribute_bonus.get('CriticalChanceBase', 0)
|
||||
attribute_bonus[
|
||||
@ -323,8 +360,10 @@ class CruisingintheStellarSea(BaseWeapon):
|
||||
)
|
||||
return attribute_bonus
|
||||
|
||||
|
||||
class SeriousnessofBreakfast(BaseWeapon):
|
||||
weapon_base_attributes: Dict
|
||||
|
||||
def __init__(self, weapon: DamageInstanceWeapon):
|
||||
super().__init__(weapon)
|
||||
|
||||
@ -333,10 +372,10 @@ class SeriousnessofBreakfast(BaseWeapon):
|
||||
# 每消灭1个敌方目标,装备者的攻击力提高4%,该效果最多叠加3层。
|
||||
return True
|
||||
|
||||
async def weapon_ability(self, Ultra_Use: int, base_attr: Dict, attribute_bonus: Dict):
|
||||
all_damage_added_ratio = attribute_bonus.get(
|
||||
'AllDamageAddedRatio', 0
|
||||
)
|
||||
async def weapon_ability(
|
||||
self, Ultra_Use: int, base_attr: Dict, attribute_bonus: Dict
|
||||
):
|
||||
all_damage_added_ratio = attribute_bonus.get('AllDamageAddedRatio', 0)
|
||||
attribute_bonus[
|
||||
'AllDamageAddedRatio'
|
||||
] = all_damage_added_ratio + mp.mpf(
|
||||
@ -346,16 +385,22 @@ class SeriousnessofBreakfast(BaseWeapon):
|
||||
)
|
||||
if await self.check():
|
||||
attack_added_ratio = attribute_bonus.get('AttackAddedRatio', 0)
|
||||
attribute_bonus['AttackAddedRatio'] = attack_added_ratio + mp.mpf(
|
||||
attribute_bonus['AttackAddedRatio'] = (
|
||||
attack_added_ratio
|
||||
+ mp.mpf(
|
||||
weapon_effect['21027']['Param']['AttackAddedRatio'][
|
||||
self.weapon_rank - 1
|
||||
]
|
||||
) * 3
|
||||
)
|
||||
* 3
|
||||
)
|
||||
return attribute_bonus
|
||||
|
||||
|
||||
# 银河铁道之夜
|
||||
class NightontheMilkyWay(BaseWeapon):
|
||||
weapon_base_attributes: Dict
|
||||
|
||||
def __init__(self, weapon: DamageInstanceWeapon):
|
||||
super().__init__(weapon)
|
||||
|
||||
@ -364,7 +409,9 @@ class NightontheMilkyWay(BaseWeapon):
|
||||
# 敌方目标的弱点被击破时,装备者造成的伤害提高30%
|
||||
return True
|
||||
|
||||
async def weapon_ability(self, Ultra_Use: int, base_attr: Dict, attribute_bonus: Dict):
|
||||
async def weapon_ability(
|
||||
self, Ultra_Use: int, base_attr: Dict, attribute_bonus: Dict
|
||||
):
|
||||
if await self.check():
|
||||
attack_added_ratio = attribute_bonus.get('AttackAddedRatio', 0)
|
||||
attribute_bonus['AttackAddedRatio'] = attack_added_ratio + mp.mpf(
|
||||
@ -385,9 +432,11 @@ class NightontheMilkyWay(BaseWeapon):
|
||||
return attribute_bonus
|
||||
return None
|
||||
|
||||
|
||||
# 今日亦是和平的一日
|
||||
class TodayIsAnotherPeacefulDay(BaseWeapon):
|
||||
weapon_base_attributes: Dict
|
||||
|
||||
def __init__(self, weapon: DamageInstanceWeapon):
|
||||
super().__init__(weapon)
|
||||
|
||||
@ -395,22 +444,26 @@ class TodayIsAnotherPeacefulDay(BaseWeapon):
|
||||
# 根据装备者的能量上限,提高装备者造成的伤害:每点能量提高0.2%,最多计入160点
|
||||
pass
|
||||
|
||||
async def weapon_ability(self, Ultra_Use: int, base_attr: Dict, attribute_bonus: Dict):
|
||||
all_damage_added_ratio = attribute_bonus.get(
|
||||
'AllDamageAddedRatio', 0
|
||||
)
|
||||
attribute_bonus[
|
||||
'AllDamageAddedRatio'
|
||||
] = all_damage_added_ratio + mp.mpf(
|
||||
async def weapon_ability(
|
||||
self, Ultra_Use: int, base_attr: Dict, attribute_bonus: Dict
|
||||
):
|
||||
all_damage_added_ratio = attribute_bonus.get('AllDamageAddedRatio', 0)
|
||||
attribute_bonus['AllDamageAddedRatio'] = (
|
||||
all_damage_added_ratio
|
||||
+ mp.mpf(
|
||||
weapon_effect['21034']['Param']['AllDamageAddedRatio'][
|
||||
self.weapon_rank - 1
|
||||
]
|
||||
) * Ultra_Use
|
||||
)
|
||||
* Ultra_Use
|
||||
)
|
||||
return attribute_bonus
|
||||
|
||||
|
||||
# 天才们的休憩
|
||||
class GeniusesRepose(BaseWeapon):
|
||||
weapon_base_attributes: Dict
|
||||
|
||||
def __init__(self, weapon: DamageInstanceWeapon):
|
||||
super().__init__(weapon)
|
||||
|
||||
@ -419,7 +472,9 @@ class GeniusesRepose(BaseWeapon):
|
||||
# 当装备者消灭敌方目标后,暴击伤害提高24%
|
||||
return True
|
||||
|
||||
async def weapon_ability(self, Ultra_Use: int, base_attr: Dict, attribute_bonus: Dict):
|
||||
async def weapon_ability(
|
||||
self, Ultra_Use: int, base_attr: Dict, attribute_bonus: Dict
|
||||
):
|
||||
# attack_added_ratio = attribute_bonus.get('AttackAddedRatio', 0)
|
||||
# attribute_bonus['AttackAddedRatio'] = attack_added_ratio + mp.mpf(
|
||||
# weapon_effect['21020']['Param']['AttackAddedRatio'][
|
||||
@ -430,14 +485,18 @@ class GeniusesRepose(BaseWeapon):
|
||||
critical_chance_base = attribute_bonus.get('CriticalDamageBase', 0)
|
||||
attribute_bonus['CriticalDamageBase'] = critical_chance_base + (
|
||||
mp.mpf(
|
||||
weapon_effect['21020']['Param']['CriticalDamageBase'][self.weapon_rank - 1]
|
||||
weapon_effect['21020']['Param']['CriticalDamageBase'][
|
||||
self.weapon_rank - 1
|
||||
]
|
||||
)
|
||||
)
|
||||
return attribute_bonus
|
||||
|
||||
|
||||
# 别让世界静下来
|
||||
class MaketheWorldClamor(BaseWeapon):
|
||||
weapon_base_attributes: Dict
|
||||
|
||||
def __init__(self, weapon: DamageInstanceWeapon):
|
||||
super().__init__(weapon)
|
||||
|
||||
@ -445,7 +504,9 @@ class MaketheWorldClamor(BaseWeapon):
|
||||
# 终结技造成的伤害提高32%。
|
||||
pass
|
||||
|
||||
async def weapon_ability(self, Ultra_Use: int, base_attr: Dict, attribute_bonus: Dict):
|
||||
async def weapon_ability(
|
||||
self, Ultra_Use: int, base_attr: Dict, attribute_bonus: Dict
|
||||
):
|
||||
ultra_dmg_add = attribute_bonus.get('UltraDmgAdd', 0)
|
||||
attribute_bonus['UltraDmgAdd'] = ultra_dmg_add + (
|
||||
mp.mpf(
|
||||
@ -454,9 +515,11 @@ class MaketheWorldClamor(BaseWeapon):
|
||||
)
|
||||
return attribute_bonus
|
||||
|
||||
|
||||
# 「我」的诞生
|
||||
class TheBirthoftheSelf(BaseWeapon):
|
||||
weapon_base_attributes: Dict
|
||||
|
||||
def __init__(self, weapon: DamageInstanceWeapon):
|
||||
super().__init__(weapon)
|
||||
|
||||
@ -465,20 +528,26 @@ class TheBirthoftheSelf(BaseWeapon):
|
||||
# 若该敌方目标当前生命值百分比小于等于50%,则追加攻击造成的伤害额外提高30%。
|
||||
return True
|
||||
|
||||
async def weapon_ability(self, Ultra_Use: int, base_attr: Dict, attribute_bonus: Dict):
|
||||
async def weapon_ability(
|
||||
self, Ultra_Use: int, base_attr: Dict, attribute_bonus: Dict
|
||||
):
|
||||
if await self.check():
|
||||
talent_dmg_add = attribute_bonus.get('TalentDmgAdd', 0)
|
||||
attribute_bonus['TalentDmgAdd'] = talent_dmg_add + (
|
||||
mp.mpf(
|
||||
weapon_effect['21006']['Param']['t_dmg'][self.weapon_rank - 1]
|
||||
weapon_effect['21006']['Param']['t_dmg'][
|
||||
self.weapon_rank - 1
|
||||
]
|
||||
)
|
||||
)
|
||||
return attribute_bonus
|
||||
return None
|
||||
|
||||
|
||||
# 秘密誓心
|
||||
class ASecretVow(BaseWeapon):
|
||||
weapon_base_attributes: Dict
|
||||
|
||||
def __init__(self, weapon: DamageInstanceWeapon):
|
||||
super().__init__(weapon)
|
||||
|
||||
@ -487,7 +556,9 @@ class ASecretVow(BaseWeapon):
|
||||
# 对当前生命值百分比大于等于装备者自身当前生命值百分比的敌方目标造成的伤害额外提高20%
|
||||
return True
|
||||
|
||||
async def weapon_ability(self, Ultra_Use: int, base_attr: Dict, attribute_bonus: Dict):
|
||||
async def weapon_ability(
|
||||
self, Ultra_Use: int, base_attr: Dict, attribute_bonus: Dict
|
||||
):
|
||||
if await self.check():
|
||||
all_damage_added_ratio = attribute_bonus.get(
|
||||
'AllDamageAddedRatio', 0
|
||||
@ -502,9 +573,11 @@ class ASecretVow(BaseWeapon):
|
||||
return attribute_bonus
|
||||
return None
|
||||
|
||||
|
||||
# 比阳光更明亮的
|
||||
class BrighterThantheSun(BaseWeapon):
|
||||
weapon_base_attributes: Dict
|
||||
|
||||
def __init__(self, weapon: DamageInstanceWeapon):
|
||||
super().__init__(weapon)
|
||||
|
||||
@ -513,19 +586,27 @@ class BrighterThantheSun(BaseWeapon):
|
||||
# 当装备者施放普攻时,获得1层【龙吟】,持续2回合。每层【龙吟】使装备者的攻击力提高18%,【龙吟】最多叠加2层
|
||||
return True
|
||||
|
||||
async def weapon_ability(self, Ultra_Use: int, base_attr: Dict, attribute_bonus: Dict):
|
||||
async def weapon_ability(
|
||||
self, Ultra_Use: int, base_attr: Dict, attribute_bonus: Dict
|
||||
):
|
||||
if await self.check():
|
||||
attack_added_ratio = attribute_bonus.get('AttackAddedRatio', 0)
|
||||
attribute_bonus['AttackAddedRatio'] = attack_added_ratio + mp.mpf(
|
||||
attribute_bonus['AttackAddedRatio'] = (
|
||||
attack_added_ratio
|
||||
+ mp.mpf(
|
||||
weapon_effect['23015']['Param']['AttackAddedRatio'][
|
||||
self.weapon_rank - 1
|
||||
]
|
||||
) * 2
|
||||
)
|
||||
* 2
|
||||
)
|
||||
return attribute_bonus
|
||||
|
||||
|
||||
# 到不了的彼岸
|
||||
class TheUnreachableSide(BaseWeapon):
|
||||
weapon_base_attributes: Dict
|
||||
|
||||
def __init__(self, weapon: DamageInstanceWeapon):
|
||||
super().__init__(weapon)
|
||||
|
||||
@ -534,7 +615,9 @@ class TheUnreachableSide(BaseWeapon):
|
||||
# 当装备者受到攻击或装备者消耗自身生命值后,造成的伤害提高40%
|
||||
return True
|
||||
|
||||
async def weapon_ability(self, Ultra_Use: int, base_attr: Dict, attribute_bonus: Dict):
|
||||
async def weapon_ability(
|
||||
self, Ultra_Use: int, base_attr: Dict, attribute_bonus: Dict
|
||||
):
|
||||
# critical_chance_base = attribute_bonus.get('CriticalChanceBase', 0)
|
||||
# attribute_bonus[
|
||||
# 'CriticalChanceBase'
|
||||
@ -564,9 +647,11 @@ class TheUnreachableSide(BaseWeapon):
|
||||
)
|
||||
return attribute_bonus
|
||||
|
||||
|
||||
# 无可取代的东西
|
||||
class SomethingIrreplaceable(BaseWeapon):
|
||||
weapon_base_attributes: Dict
|
||||
|
||||
def __init__(self, weapon: DamageInstanceWeapon):
|
||||
super().__init__(weapon)
|
||||
|
||||
@ -575,7 +660,9 @@ class SomethingIrreplaceable(BaseWeapon):
|
||||
# 当装备者消灭敌方目标或受到攻击后,造成的伤害提高24%
|
||||
return True
|
||||
|
||||
async def weapon_ability(self, Ultra_Use: int, base_attr: Dict, attribute_bonus: Dict):
|
||||
async def weapon_ability(
|
||||
self, Ultra_Use: int, base_attr: Dict, attribute_bonus: Dict
|
||||
):
|
||||
# attack_added_ratio = attribute_bonus.get('AttackAddedRatio', 0)
|
||||
# attribute_bonus['AttackAddedRatio'] = attack_added_ratio + mp.mpf(
|
||||
# weapon_effect['23002']['Param']['AttackAddedRatio'][
|
||||
@ -595,9 +682,11 @@ class SomethingIrreplaceable(BaseWeapon):
|
||||
)
|
||||
return attribute_bonus
|
||||
|
||||
|
||||
# 记一位星神的陨落
|
||||
class OntheFallofanAeon(BaseWeapon):
|
||||
weapon_base_attributes: Dict
|
||||
|
||||
def __init__(self, weapon: DamageInstanceWeapon):
|
||||
super().__init__(weapon)
|
||||
|
||||
@ -606,14 +695,20 @@ class OntheFallofanAeon(BaseWeapon):
|
||||
# 当装备者击破敌方目标弱点后,造成的伤害提高12%
|
||||
return True
|
||||
|
||||
async def weapon_ability(self, Ultra_Use: int, base_attr: Dict, attribute_bonus: Dict):
|
||||
async def weapon_ability(
|
||||
self, Ultra_Use: int, base_attr: Dict, attribute_bonus: Dict
|
||||
):
|
||||
if await self.check():
|
||||
attack_added_ratio = attribute_bonus.get('AttackAddedRatio', 0)
|
||||
attribute_bonus['AttackAddedRatio'] = attack_added_ratio + mp.mpf(
|
||||
attribute_bonus['AttackAddedRatio'] = (
|
||||
attack_added_ratio
|
||||
+ mp.mpf(
|
||||
weapon_effect['24000']['Param']['AttackAddedRatio'][
|
||||
self.weapon_rank - 1
|
||||
]
|
||||
) * 4
|
||||
)
|
||||
* 4
|
||||
)
|
||||
all_damage_added_ratio = attribute_bonus.get(
|
||||
'AllDamageAddedRatio', 0
|
||||
)
|
||||
@ -626,9 +721,11 @@ class OntheFallofanAeon(BaseWeapon):
|
||||
)
|
||||
return attribute_bonus
|
||||
|
||||
|
||||
# 无处可逃
|
||||
class NowheretoRun(BaseWeapon):
|
||||
weapon_base_attributes: Dict
|
||||
|
||||
def __init__(self, weapon: DamageInstanceWeapon):
|
||||
super().__init__(weapon)
|
||||
|
||||
@ -636,7 +733,9 @@ class NowheretoRun(BaseWeapon):
|
||||
# 使装备者的攻击力提高24%
|
||||
pass
|
||||
|
||||
async def weapon_ability(self, Ultra_Use: int, base_attr: Dict, attribute_bonus: Dict):
|
||||
async def weapon_ability(
|
||||
self, Ultra_Use: int, base_attr: Dict, attribute_bonus: Dict
|
||||
):
|
||||
# attack_added_ratio = attribute_bonus.get('AttackAddedRatio', 0)
|
||||
# attribute_bonus['AttackAddedRatio'] = attack_added_ratio + mp.mpf(
|
||||
# weapon_effect['21033']['Param']['AttackAddedRatio'][
|
||||
@ -645,9 +744,11 @@ class NowheretoRun(BaseWeapon):
|
||||
# )
|
||||
return attribute_bonus
|
||||
|
||||
|
||||
# 汪!散步时间!
|
||||
class WoofWalkTime(BaseWeapon):
|
||||
weapon_base_attributes: Dict
|
||||
|
||||
def __init__(self, weapon: DamageInstanceWeapon):
|
||||
super().__init__(weapon)
|
||||
|
||||
@ -656,7 +757,9 @@ class WoofWalkTime(BaseWeapon):
|
||||
# 对处于灼烧或裂伤状态的敌方目标造成的伤害提高16%
|
||||
return True
|
||||
|
||||
async def weapon_ability(self, Ultra_Use: int, base_attr: Dict, attribute_bonus: Dict):
|
||||
async def weapon_ability(
|
||||
self, Ultra_Use: int, base_attr: Dict, attribute_bonus: Dict
|
||||
):
|
||||
# attack_added_ratio = attribute_bonus.get('AttackAddedRatio', 0)
|
||||
# attribute_bonus['AttackAddedRatio'] = attack_added_ratio + mp.mpf(
|
||||
# weapon_effect['21026']['Param']['AttackAddedRatio'][
|
||||
@ -676,9 +779,11 @@ class WoofWalkTime(BaseWeapon):
|
||||
)
|
||||
return attribute_bonus
|
||||
|
||||
|
||||
# 在蓝天下
|
||||
class UndertheBlueSky(BaseWeapon):
|
||||
weapon_base_attributes: Dict
|
||||
|
||||
def __init__(self, weapon: DamageInstanceWeapon):
|
||||
super().__init__(weapon)
|
||||
|
||||
@ -687,7 +792,9 @@ class UndertheBlueSky(BaseWeapon):
|
||||
# 当装备者消灭敌方目标后,暴击率提高12%
|
||||
return True
|
||||
|
||||
async def weapon_ability(self, Ultra_Use: int, base_attr: Dict, attribute_bonus: Dict):
|
||||
async def weapon_ability(
|
||||
self, Ultra_Use: int, base_attr: Dict, attribute_bonus: Dict
|
||||
):
|
||||
# attack_added_ratio = attribute_bonus.get('AttackAddedRatio', 0)
|
||||
# attribute_bonus['AttackAddedRatio'] = attack_added_ratio + mp.mpf(
|
||||
# weapon_effect['21019']['Param']['AttackAddedRatio'][
|
||||
@ -705,9 +812,11 @@ class UndertheBlueSky(BaseWeapon):
|
||||
)
|
||||
return attribute_bonus
|
||||
|
||||
|
||||
# 鼹鼠党欢迎你
|
||||
class TheMolesWelcomeYou(BaseWeapon):
|
||||
weapon_base_attributes: Dict
|
||||
|
||||
def __init__(self, weapon: DamageInstanceWeapon):
|
||||
super().__init__(weapon)
|
||||
|
||||
@ -715,19 +824,27 @@ class TheMolesWelcomeYou(BaseWeapon):
|
||||
# 装备者施放普攻、战技或终结技攻击敌方目标后,分别获取一层【淘气值】。每层使装备者的攻击力提高12%。
|
||||
return True
|
||||
|
||||
async def weapon_ability(self, Ultra_Use: int, base_attr: Dict, attribute_bonus: Dict):
|
||||
async def weapon_ability(
|
||||
self, Ultra_Use: int, base_attr: Dict, attribute_bonus: Dict
|
||||
):
|
||||
if await self.check():
|
||||
attack_added_ratio = attribute_bonus.get('AttackAddedRatio', 0)
|
||||
attribute_bonus['AttackAddedRatio'] = attack_added_ratio + mp.mpf(
|
||||
attribute_bonus['AttackAddedRatio'] = (
|
||||
attack_added_ratio
|
||||
+ mp.mpf(
|
||||
weapon_effect['21005']['Param']['AttackAddedRatio'][
|
||||
self.weapon_rank - 1
|
||||
]
|
||||
) * 3
|
||||
)
|
||||
* 3
|
||||
)
|
||||
return attribute_bonus
|
||||
|
||||
|
||||
# 雨一直下
|
||||
class IncessantRain(BaseWeapon):
|
||||
weapon_base_attributes: Dict
|
||||
|
||||
def __init__(self, weapon: DamageInstanceWeapon):
|
||||
super().__init__(weapon)
|
||||
|
||||
@ -736,12 +853,12 @@ class IncessantRain(BaseWeapon):
|
||||
# 持有【以太编码】的目标受到的伤害提高12%
|
||||
return True
|
||||
|
||||
async def weapon_ability(self, Ultra_Use: int, base_attr: Dict, attribute_bonus: Dict):
|
||||
async def weapon_ability(
|
||||
self, Ultra_Use: int, base_attr: Dict, attribute_bonus: Dict
|
||||
):
|
||||
if await self.check():
|
||||
damage_ratio = attribute_bonus.get('DmgRatio', 0)
|
||||
attribute_bonus[
|
||||
'DmgRatio'
|
||||
] = damage_ratio + mp.mpf(
|
||||
attribute_bonus['DmgRatio'] = damage_ratio + mp.mpf(
|
||||
weapon_effect['23007']['Param']['DmgRatio'][
|
||||
self.weapon_rank - 1
|
||||
]
|
||||
@ -756,64 +873,248 @@ class IncessantRain(BaseWeapon):
|
||||
)
|
||||
return attribute_bonus
|
||||
|
||||
# class HuntWeapon:
|
||||
# def __new__(cls, weapon: DamageInstanceWeapon):
|
||||
# if weapon.id_ == 23007:
|
||||
# return IncessantRain(weapon)
|
||||
# if weapon.id_ == 21005:
|
||||
# return TheMolesWelcomeYou(weapon)
|
||||
# if weapon.id_ == 21019:
|
||||
# return UndertheBlueSky(weapon)
|
||||
# if weapon.id_ == 21026:
|
||||
# return WoofWalkTime(weapon)
|
||||
# if weapon.id_ == 21033:
|
||||
# return NowheretoRun(weapon)
|
||||
# if weapon.id_ == 24000:
|
||||
# return OntheFallofanAeon(weapon)
|
||||
# if weapon.id_ == 23002:
|
||||
# return SomethingIrreplaceable(weapon)
|
||||
# if weapon.id_ == 23009:
|
||||
# return TheUnreachableSide(weapon)
|
||||
# if weapon.id_ == 23015:
|
||||
# return BrighterThantheSun(weapon)
|
||||
# if weapon.id_ == 21012:
|
||||
# return ASecretVow(weapon)
|
||||
# if weapon.id_ == 21006:
|
||||
# return TheBirthoftheSelf(weapon)
|
||||
# if weapon.id_ == 21013:
|
||||
# return MaketheWorldClamor(weapon)
|
||||
# if weapon.id_ == 21020:
|
||||
# return GeniusesRepose(weapon)
|
||||
# if weapon.id_ == 21027:
|
||||
# return SeriousnessofBreakfast(weapon)
|
||||
# if weapon.id_ == 21034:
|
||||
# return TodayIsAnotherPeacefulDay(weapon)
|
||||
# if weapon.id_ == 23000:
|
||||
# return NightontheMilkyWay(weapon)
|
||||
# if weapon.id_ == 23010:
|
||||
# return BeforeDawn(weapon)
|
||||
# if weapon.id_ == 24001:
|
||||
# return CruisingintheStellarSea(weapon)
|
||||
# if weapon.id_ == 23001:
|
||||
# return IntheNight(weapon)
|
||||
# if weapon.id_ == 21003:
|
||||
# return OnlySilenceRemains(weapon)
|
||||
# if weapon.id_ == 21024:
|
||||
# return RiverFlowsinSpring(weapon)
|
||||
# if weapon.id_ == 20014:
|
||||
# return Adversarial(weapon)
|
||||
# if weapon.id_ == 20007:
|
||||
# return DartingArrow(weapon)
|
||||
# if weapon.id_ == 21010:
|
||||
# return Swordplay(weapon)
|
||||
# if weapon.id_ == 21031:
|
||||
# return ReturntoDarkness(weapon)
|
||||
# if weapon.id_ == 20000:
|
||||
# return Arrows(weapon)
|
||||
# raise ValueError(f'未知武器id: {weapon.id_}')
|
||||
|
||||
# async def check_ability(self):
|
||||
# pass
|
||||
# 只需等待
|
||||
class PatienceIsAllYouNeed(BaseWeapon):
|
||||
weapon_base_attributes: Dict
|
||||
|
||||
def __init__(self, weapon: DamageInstanceWeapon):
|
||||
super().__init__(weapon)
|
||||
|
||||
async def check(self):
|
||||
# 使装备者造成的伤害提高24%
|
||||
# 装备者每次施放攻击后,速度提高4.8%,最多叠加3层。
|
||||
return True
|
||||
|
||||
async def weapon_ability(
|
||||
self, Ultra_Use: int, base_attr: Dict, attribute_bonus: Dict
|
||||
):
|
||||
if await self.check():
|
||||
all_damage_added_ratio = attribute_bonus.get(
|
||||
'AllDamageAddedRatio', 0
|
||||
)
|
||||
attribute_bonus[
|
||||
'AllDamageAddedRatio'
|
||||
] = all_damage_added_ratio + mp.mpf(
|
||||
weapon_effect['23006']['Param']['AllDamageAddedRatio'][
|
||||
self.weapon_rank - 1
|
||||
]
|
||||
)
|
||||
|
||||
speed_added_ratio = attribute_bonus.get('SpeedAddedRatio', 0)
|
||||
attribute_bonus['SpeedAddedRatio'] = (
|
||||
speed_added_ratio
|
||||
+ mp.mpf(
|
||||
weapon_effect['23006']['Param']['SpeedAddedRatio'][
|
||||
self.weapon_rank - 1
|
||||
]
|
||||
)
|
||||
* 3
|
||||
)
|
||||
return attribute_bonus
|
||||
|
||||
|
||||
# 以世界之名
|
||||
class IntheNameoftheWorld(BaseWeapon):
|
||||
weapon_base_attributes: Dict
|
||||
|
||||
def __init__(self, weapon: DamageInstanceWeapon):
|
||||
super().__init__(weapon)
|
||||
|
||||
async def check(self):
|
||||
# 使装备者对陷入负面效果的敌方目标造成的伤害提高24%
|
||||
# 当装备者施放战技时,装备者此次攻击的效果命中提高18%
|
||||
# 当装备者施放战技时,装备者此次攻击的攻击力提高24%。
|
||||
return True
|
||||
|
||||
async def weapon_ability(
|
||||
self, Ultra_Use: int, base_attr: Dict, attribute_bonus: Dict
|
||||
):
|
||||
if await self.check():
|
||||
all_damage_added_ratio = attribute_bonus.get(
|
||||
'AllDamageAddedRatio', 0
|
||||
)
|
||||
attribute_bonus[
|
||||
'AllDamageAddedRatio'
|
||||
] = all_damage_added_ratio + mp.mpf(
|
||||
weapon_effect['23004']['Param']['AllDamageAddedRatio'][
|
||||
self.weapon_rank - 1
|
||||
]
|
||||
)
|
||||
|
||||
a2_status_probability = attribute_bonus.get(
|
||||
'BPSkillStatusProbabilityBase', 0
|
||||
)
|
||||
attribute_bonus[
|
||||
'BPSkillStatusProbabilityBase'
|
||||
] = a2_status_probability + mp.mpf(
|
||||
weapon_effect['23004']['Param']['A2_StatusProbability'][
|
||||
self.weapon_rank - 1
|
||||
]
|
||||
)
|
||||
|
||||
a2_attack_added_ratio = attribute_bonus.get(
|
||||
'BPSkillAttackAddedRatio', 0
|
||||
)
|
||||
attribute_bonus[
|
||||
'BPSkillAttackAddedRatio'
|
||||
] = a2_attack_added_ratio + mp.mpf(
|
||||
weapon_effect['23004']['Param']['A2_AttackAddedRatio'][
|
||||
self.weapon_rank - 1
|
||||
]
|
||||
)
|
||||
return attribute_bonus
|
||||
|
||||
|
||||
# 孤独的疗愈
|
||||
class SolitaryHealing(BaseWeapon):
|
||||
weapon_base_attributes: Dict
|
||||
|
||||
def __init__(self, weapon: DamageInstanceWeapon):
|
||||
super().__init__(weapon)
|
||||
|
||||
async def check(self):
|
||||
# 使装备者的击破特攻提高20%
|
||||
# 装备者施放终结技时,使装备者造成的持续伤害提高24%
|
||||
pass
|
||||
|
||||
async def weapon_ability(
|
||||
self, Ultra_Use: int, base_attr: Dict, attribute_bonus: Dict
|
||||
):
|
||||
return attribute_bonus
|
||||
|
||||
|
||||
# 新手任务开始前
|
||||
class BeforetheTutorialMissionStarts(BaseWeapon):
|
||||
weapon_base_attributes: Dict
|
||||
|
||||
def __init__(self, weapon: DamageInstanceWeapon):
|
||||
super().__init__(weapon)
|
||||
|
||||
async def check(self):
|
||||
# 当装备者攻击防御力被降低的敌方目标后,恢复4点能量。
|
||||
pass
|
||||
|
||||
async def weapon_ability(
|
||||
self, Ultra_Use: int, base_attr: Dict, attribute_bonus: Dict
|
||||
):
|
||||
return attribute_bonus
|
||||
|
||||
|
||||
# 后会有期
|
||||
class WeWillMeetAgain(BaseWeapon):
|
||||
weapon_base_attributes: Dict
|
||||
|
||||
def __init__(self, weapon: DamageInstanceWeapon):
|
||||
super().__init__(weapon)
|
||||
|
||||
async def check(self):
|
||||
# 装备者施放普攻或战技后,对随机1个受到攻击的敌方目标造成等同于自身48%攻击力的附加伤害。
|
||||
pass
|
||||
|
||||
async def weapon_ability(
|
||||
self, Ultra_Use: int, base_attr: Dict, attribute_bonus: Dict
|
||||
):
|
||||
return attribute_bonus
|
||||
|
||||
|
||||
# 延长记号
|
||||
class Fermata(BaseWeapon):
|
||||
weapon_base_attributes: Dict
|
||||
|
||||
def __init__(self, weapon: DamageInstanceWeapon):
|
||||
super().__init__(weapon)
|
||||
|
||||
async def check(self):
|
||||
# 对处于触电或风化状态的敌方目标造成的伤害提高16%
|
||||
return True
|
||||
|
||||
async def weapon_ability(
|
||||
self, Ultra_Use: int, base_attr: Dict, attribute_bonus: Dict
|
||||
):
|
||||
if await self.check():
|
||||
all_damage_added_ratio = attribute_bonus.get(
|
||||
'AllDamageAddedRatio', 0
|
||||
)
|
||||
attribute_bonus[
|
||||
'AllDamageAddedRatio'
|
||||
] = all_damage_added_ratio + mp.mpf(
|
||||
weapon_effect['21022']['Param']['AllDamageAddedRatio'][
|
||||
self.weapon_rank - 1
|
||||
]
|
||||
)
|
||||
return attribute_bonus
|
||||
|
||||
|
||||
# 决心如汗珠般闪耀
|
||||
class ResolutionShinesAsPearlsofSweat(BaseWeapon):
|
||||
weapon_base_attributes: Dict
|
||||
|
||||
def __init__(self, weapon: DamageInstanceWeapon):
|
||||
super().__init__(weapon)
|
||||
|
||||
async def check(self):
|
||||
# 对处于触电或风化状态的敌方目标造成的伤害提高16%
|
||||
return True
|
||||
|
||||
async def weapon_ability(
|
||||
self, Ultra_Use: int, base_attr: Dict, attribute_bonus: Dict
|
||||
):
|
||||
if await self.check():
|
||||
ignore_defence = attribute_bonus.get('ignore_defence', 0)
|
||||
attribute_bonus['ignore_defence'] = ignore_defence + mp.mpf(
|
||||
weapon_effect['21015']['Param']['ignore_defence'][
|
||||
self.weapon_rank - 1
|
||||
]
|
||||
)
|
||||
return attribute_bonus
|
||||
|
||||
|
||||
# 猎物的视线
|
||||
class EyesofthePrey(BaseWeapon):
|
||||
weapon_base_attributes: Dict
|
||||
|
||||
def __init__(self, weapon: DamageInstanceWeapon):
|
||||
super().__init__(weapon)
|
||||
|
||||
async def check(self):
|
||||
# 造成的持续伤害提高24%。
|
||||
pass
|
||||
|
||||
async def weapon_ability(
|
||||
self, Ultra_Use: int, base_attr: Dict, attribute_bonus: Dict
|
||||
):
|
||||
return attribute_bonus
|
||||
|
||||
|
||||
# 晚安与睡颜
|
||||
class GoodNightandSleepWell(BaseWeapon):
|
||||
weapon_base_attributes: Dict
|
||||
|
||||
def __init__(self, weapon: DamageInstanceWeapon):
|
||||
super().__init__(weapon)
|
||||
|
||||
async def check(self):
|
||||
# 敌方目标每承受1个负面效果,装备者对其造成的伤害提高12%,最多叠加3层
|
||||
return True
|
||||
|
||||
async def weapon_ability(
|
||||
self, Ultra_Use: int, base_attr: Dict, attribute_bonus: Dict
|
||||
):
|
||||
if await self.check():
|
||||
all_damage_added_ratio = attribute_bonus.get(
|
||||
'AllDamageAddedRatio', 0
|
||||
)
|
||||
attribute_bonus['AllDamageAddedRatio'] = (
|
||||
all_damage_added_ratio
|
||||
+ mp.mpf(
|
||||
weapon_effect['21001']['Param']['AllDamageAddedRatio'][
|
||||
self.weapon_rank - 1
|
||||
]
|
||||
)
|
||||
* 3
|
||||
)
|
||||
return attribute_bonus
|
||||
|
||||
|
||||
class Weapon:
|
||||
@ -848,7 +1149,34 @@ class Weapon:
|
||||
21010,
|
||||
21031,
|
||||
20000,
|
||||
23006,
|
||||
23004,
|
||||
24003,
|
||||
22000,
|
||||
21029,
|
||||
21022,
|
||||
21015,
|
||||
21008,
|
||||
21001,
|
||||
]:
|
||||
if weapon.id_ == 21001:
|
||||
return GoodNightandSleepWell(weapon)
|
||||
if weapon.id_ == 21008:
|
||||
return EyesofthePrey(weapon)
|
||||
if weapon.id_ == 21015:
|
||||
return ResolutionShinesAsPearlsofSweat(weapon)
|
||||
if weapon.id_ == 21022:
|
||||
return Fermata(weapon)
|
||||
if weapon.id_ == 21029:
|
||||
return WeWillMeetAgain(weapon)
|
||||
if weapon.id_ == 22000:
|
||||
return BeforetheTutorialMissionStarts(weapon)
|
||||
if weapon.id_ == 24003:
|
||||
return SolitaryHealing(weapon)
|
||||
if weapon.id_ == 23004:
|
||||
return IntheNameoftheWorld(weapon)
|
||||
if weapon.id_ == 23006:
|
||||
return PatienceIsAllYouNeed(weapon)
|
||||
if weapon.id_ == 23007:
|
||||
return IncessantRain(weapon)
|
||||
if weapon.id_ == 21005:
|
||||
|
@ -4,6 +4,7 @@ from typing import Dict
|
||||
async def merge_attribute(base_attr: Dict, attribute_bonus: Dict) -> Dict:
|
||||
# hp attack defence need base_value and add_value
|
||||
merged_attr = {}
|
||||
attr_list = ['attack', 'defence', 'hp', 'speed']
|
||||
for attribute in attribute_bonus:
|
||||
if (
|
||||
attribute.__contains__('Attack')
|
||||
@ -13,10 +14,12 @@ async def merge_attribute(base_attr: Dict, attribute_bonus: Dict) -> Dict:
|
||||
):
|
||||
if attribute.__contains__('Delta'):
|
||||
attr = attribute.split('Delta')[0].lower()
|
||||
if attr in attr_list:
|
||||
attr_value = merged_attr.get(attr, 0)
|
||||
merged_attr[attr] = attr_value + attribute_bonus[attribute]
|
||||
elif attribute.__contains__('AddedRatio'):
|
||||
attr = attribute.split('AddedRatio')[0].lower()
|
||||
if attr in attr_list:
|
||||
attr_value = merged_attr.get(attr, 0)
|
||||
merged_attr[attr] = attr_value + base_attr[attr] * (
|
||||
1 + attribute_bonus[attribute]
|
||||
@ -49,5 +52,5 @@ async def merge_attribute(base_attr: Dict, attribute_bonus: Dict) -> Dict:
|
||||
attr_value = base_attr.get(attribute, 0)
|
||||
merged_attr[attribute] = attr_value + attribute_bonus[attribute]
|
||||
else:
|
||||
raise Exception(f'attribute error {attribute}')
|
||||
continue
|
||||
return merged_attr
|
||||
|
@ -1,11 +1,11 @@
|
||||
import json
|
||||
from collections import Counter
|
||||
from typing import Dict
|
||||
from collections import Counter
|
||||
|
||||
from loguru import logger
|
||||
from mpmath import mp
|
||||
from loguru import logger
|
||||
|
||||
from ...utils.map.SR_MAP_PATH import EquipmentID2AbilityProperty, RelicSetSkill
|
||||
from ...utils.map.SR_MAP_PATH import RelicSetSkill, EquipmentID2AbilityProperty
|
||||
|
||||
mp.dps = 14
|
||||
|
||||
|
@ -4,13 +4,13 @@ from typing import List, Union
|
||||
|
||||
from PIL import Image, ImageDraw
|
||||
|
||||
from ..utils.fonts.first_world import fw_font_28
|
||||
from ..utils.fonts.starrail_fonts import sr_font_24, sr_font_30, sr_font_58
|
||||
from ..utils.image.convert import convert_img
|
||||
from ..utils.map.name_covert import avatar_id_to_char_star
|
||||
from ..utils.map.SR_MAP_PATH import avatarId2Name
|
||||
from ..utils.resource.RESOURCE_PATH import CHAR_ICON_PATH, CHAR_PREVIEW_PATH
|
||||
from .to_data import api_to_dict
|
||||
from ..utils.image.convert import convert_img
|
||||
from ..utils.fonts.first_world import fw_font_28
|
||||
from ..utils.map.SR_MAP_PATH import avatarId2Name
|
||||
from ..utils.map.name_covert import avatar_id_to_char_star
|
||||
from ..utils.fonts.starrail_fonts import sr_font_24, sr_font_30, sr_font_58
|
||||
from ..utils.resource.RESOURCE_PATH import CHAR_ICON_PATH, CHAR_PREVIEW_PATH
|
||||
|
||||
half_color = (255, 255, 255, 120)
|
||||
first_color = (29, 29, 29)
|
||||
@ -39,9 +39,7 @@ async def api_to_card(uid: str) -> Union[str, bytes]:
|
||||
return await draw_enka_card(uid=uid, char_list=char_data_list, showfrom=1)
|
||||
|
||||
|
||||
async def draw_enka_card(
|
||||
uid: str, char_list: List, showfrom: int = 0
|
||||
):
|
||||
async def draw_enka_card(uid: str, char_list: List, showfrom: int = 0):
|
||||
char_data_list = []
|
||||
if 1102 in char_list:
|
||||
char_list.remove(1102)
|
||||
|
@ -1,36 +1,36 @@
|
||||
import json
|
||||
from pathlib import Path
|
||||
from typing import List, Optional, Union
|
||||
from typing import List, Union, Optional
|
||||
|
||||
from httpx import ReadTimeout
|
||||
from mpmath import mp
|
||||
from httpx import ReadTimeout
|
||||
|
||||
from ..utils.error_reply import UID_HINT
|
||||
from ..sruid_utils.api.mihomo import MihomoData
|
||||
from ..sruid_utils.api.mihomo.models import Avatar
|
||||
from ..utils.resource.RESOURCE_PATH import PLAYER_PATH
|
||||
from ..sruid_utils.api.mihomo.requests import get_char_card_info
|
||||
from ..utils.error_reply import UID_HINT
|
||||
|
||||
# from gsuid_core.utils.api.minigg.request import get_weapon_info
|
||||
from .cal_value import cal_relic_sub_affix, cal_relic_main_affix
|
||||
from ..utils.excel.read_excel import AvatarPromotion, EquipmentPromotion
|
||||
from ..utils.map.SR_MAP_PATH import (
|
||||
EquipmentID2Name,
|
||||
EquipmentID2Rarity,
|
||||
SetId2Name,
|
||||
ItemId2Name,
|
||||
Property2Name,
|
||||
RelicId2SetId,
|
||||
SetId2Name,
|
||||
avatarId2DamageType,
|
||||
avatarId2EnName,
|
||||
EquipmentID2Name,
|
||||
EquipmentID2Rarity,
|
||||
rankId2Name,
|
||||
skillId2Name,
|
||||
avatarId2Name,
|
||||
skillId2Effect,
|
||||
avatarId2EnName,
|
||||
avatarId2Rarity,
|
||||
characterSkillTree,
|
||||
rankId2Name,
|
||||
skillId2AttackType,
|
||||
skillId2Effect,
|
||||
skillId2Name,
|
||||
avatarId2DamageType,
|
||||
)
|
||||
from ..utils.resource.RESOURCE_PATH import PLAYER_PATH
|
||||
|
||||
# from gsuid_core.utils.api.minigg.request import get_weapon_info
|
||||
from .cal_value import cal_relic_main_affix, cal_relic_sub_affix
|
||||
|
||||
mp.dps = 14
|
||||
|
||||
@ -65,9 +65,7 @@ async def api_to_dict(
|
||||
PlayerDetailInfo = sr_data['detailInfo']
|
||||
path = PLAYER_PATH / str(sr_uid)
|
||||
path.mkdir(parents=True, exist_ok=True)
|
||||
with Path.open(
|
||||
path / f'{sr_uid!s}.json', 'w', encoding='UTF-8'
|
||||
) as file:
|
||||
with Path.open(path / f'{sr_uid!s}.json', 'w', encoding='UTF-8') as file:
|
||||
json.dump(PlayerDetailInfo, file, ensure_ascii=False)
|
||||
with Path.open(path / 'rawData.json', 'w', encoding='UTF-8') as file:
|
||||
json.dump(sr_data, file, ensure_ascii=False)
|
||||
@ -334,9 +332,7 @@ async def get_data(char: Avatar, sr_data: MihomoData, sr_uid: str):
|
||||
|
||||
char_data['equipmentInfo'] = equipment_info
|
||||
|
||||
with Path.open(
|
||||
path / f'{avatarName}.json', 'w', encoding='UTF-8'
|
||||
) as file:
|
||||
with Path.open(path / f'{avatarName}.json', 'w', encoding='UTF-8') as file:
|
||||
json.dump(char_data, file, ensure_ascii=False)
|
||||
return char_data, avatarName
|
||||
|
||||
|
@ -1,12 +1,12 @@
|
||||
from gsuid_core.sv import SV
|
||||
from gsuid_core.bot import Bot
|
||||
from gsuid_core.models import Event
|
||||
from gsuid_core.sv import SV
|
||||
|
||||
from ..utils.convert import get_uid
|
||||
from ..utils.error_reply import UID_HINT
|
||||
from ..utils.sr_prefix import PREFIX
|
||||
from .draw_gachalogs import draw_gachalogs_img
|
||||
from ..utils.error_reply import UID_HINT
|
||||
from .get_gachalogs import save_gachalogs
|
||||
from .draw_gachalogs import draw_gachalogs_img
|
||||
|
||||
sv_gacha_log = SV('sr抽卡记录')
|
||||
sv_get_gachalog_by_link = SV('sr导入抽卡链接', area='DIRECT')
|
||||
|
@ -1,18 +1,24 @@
|
||||
import json
|
||||
import asyncio
|
||||
import datetime
|
||||
import json
|
||||
from pathlib import Path
|
||||
from typing import List, Tuple, Union
|
||||
|
||||
from PIL import Image, ImageDraw
|
||||
|
||||
from gsuid_core.logger import logger
|
||||
from gsuid_core.utils.image.image_tools import (
|
||||
draw_pic_with_ring,
|
||||
get_color_bg,
|
||||
get_qq_avatar,
|
||||
draw_pic_with_ring,
|
||||
)
|
||||
|
||||
from ..utils.image.convert import convert_img
|
||||
from ..utils.map.name_covert import name_to_avatar_id, name_to_weapon_id
|
||||
from ..utils.resource.RESOURCE_PATH import (
|
||||
PLAYER_PATH,
|
||||
WEAPON_PATH,
|
||||
CHAR_ICON_PATH,
|
||||
)
|
||||
from ..utils.fonts.starrail_fonts import (
|
||||
sr_font_20,
|
||||
sr_font_24,
|
||||
@ -20,13 +26,6 @@ from ..utils.fonts.starrail_fonts import (
|
||||
sr_font_38,
|
||||
sr_font_40,
|
||||
)
|
||||
from ..utils.image.convert import convert_img
|
||||
from ..utils.map.name_covert import name_to_avatar_id, name_to_weapon_id
|
||||
from ..utils.resource.RESOURCE_PATH import (
|
||||
CHAR_ICON_PATH,
|
||||
PLAYER_PATH,
|
||||
WEAPON_PATH,
|
||||
)
|
||||
|
||||
TEXT_PATH = Path(__file__).parent / 'texture2d'
|
||||
EMO_PATH = Path(__file__).parent / 'texture2d' / 'emo'
|
||||
|
@ -1,9 +1,9 @@
|
||||
import asyncio
|
||||
import json
|
||||
from datetime import datetime
|
||||
import asyncio
|
||||
from pathlib import Path
|
||||
from typing import Dict, Optional
|
||||
from urllib import parse
|
||||
from datetime import datetime
|
||||
from typing import Dict, Optional
|
||||
|
||||
from ..utils.mys_api import mys_api
|
||||
from ..utils.resource.RESOURCE_PATH import PLAYER_PATH
|
||||
|
@ -1,17 +1,16 @@
|
||||
import json
|
||||
from datetime import datetime
|
||||
from pathlib import Path
|
||||
from typing import Union
|
||||
from datetime import datetime
|
||||
|
||||
from PIL import Image, ImageDraw
|
||||
|
||||
from gsuid_core.logger import logger
|
||||
|
||||
from ..utils.error_reply import get_error
|
||||
from ..utils.fonts.starrail_fonts import sr_font_20, sr_font_28, sr_font_34
|
||||
from ..utils.image.convert import convert_img
|
||||
from ..utils.mys_api import mys_api
|
||||
from ..utils.error_reply import get_error
|
||||
from ..utils.image.convert import convert_img
|
||||
from ..utils.resource.RESOURCE_PATH import PLAYER_PATH
|
||||
from ..utils.fonts.starrail_fonts import sr_font_20, sr_font_28, sr_font_34
|
||||
|
||||
TEXT_PATH = Path(__file__).parent / 'texture2d'
|
||||
|
||||
@ -242,7 +241,9 @@ async def draw_note_img(sr_uid: str) -> Union[bytes, str]:
|
||||
if last_monthly_data:
|
||||
pie_image = Image.new("RGBA", (2100, 2100), color=(255, 255, 255, 0))
|
||||
pie_image_draw = ImageDraw.Draw(pie_image)
|
||||
for _index, i in enumerate(last_monthly_data['month_data']['group_by']):
|
||||
for _index, i in enumerate(
|
||||
last_monthly_data['month_data']['group_by']
|
||||
):
|
||||
pie_image_draw.pieslice(
|
||||
xy,
|
||||
temp,
|
||||
|
@ -1,7 +1,7 @@
|
||||
from datetime import datetime
|
||||
|
||||
from ..utils.error_reply import get_error
|
||||
from ..utils.mys_api import mys_api
|
||||
from ..utils.error_reply import get_error
|
||||
|
||||
month_im = """==============
|
||||
SR_UID:{}
|
||||
|
@ -1,8 +1,8 @@
|
||||
import re
|
||||
|
||||
from gsuid_core.sv import SV
|
||||
from gsuid_core.bot import Bot
|
||||
from gsuid_core.models import Event
|
||||
from gsuid_core.sv import SV
|
||||
from gsuid_core.utils.error_reply import UID_HINT
|
||||
|
||||
from ..utils.convert import get_uid
|
||||
|
@ -1,30 +1,29 @@
|
||||
import math
|
||||
from pathlib import Path
|
||||
from typing import List, Optional, Union
|
||||
from typing import List, Union, Optional
|
||||
|
||||
from PIL import Image, ImageDraw
|
||||
|
||||
from gsuid_core.logger import logger
|
||||
from gsuid_core.utils.error_reply import get_error
|
||||
from gsuid_core.utils.image.image_tools import (
|
||||
draw_pic_with_ring,
|
||||
get_qq_avatar,
|
||||
draw_pic_with_ring,
|
||||
)
|
||||
|
||||
from .utils import get_icon
|
||||
from ..utils.convert import GsCookie
|
||||
from ..utils.image.convert import convert_img
|
||||
from ..sruid_utils.api.mys.models import (
|
||||
RogueAvatar,
|
||||
RogueBuffitems,
|
||||
RogueMiracles,
|
||||
RogueBuffitems,
|
||||
)
|
||||
from ..utils.convert import GsCookie
|
||||
from ..utils.fonts.starrail_fonts import (
|
||||
sr_font_22,
|
||||
sr_font_28,
|
||||
sr_font_34,
|
||||
sr_font_42,
|
||||
)
|
||||
from ..utils.image.convert import convert_img
|
||||
from .utils import get_icon
|
||||
|
||||
TEXT_PATH = Path(__file__).parent / 'texture2D'
|
||||
white_color = (255, 255, 255)
|
||||
|
@ -2,9 +2,8 @@ from io import BytesIO
|
||||
from pathlib import Path
|
||||
from typing import TypeVar
|
||||
|
||||
from aiohttp import ClientSession
|
||||
from PIL import Image
|
||||
|
||||
from aiohttp import ClientSession
|
||||
from gsuid_core.data_store import get_res_path
|
||||
|
||||
T = TypeVar("T")
|
||||
|
@ -1,16 +1,15 @@
|
||||
import asyncio
|
||||
from pathlib import Path
|
||||
from typing import Dict, List, Optional, Union
|
||||
from typing import Dict, List, Union, Optional
|
||||
|
||||
from PIL import Image, ImageDraw
|
||||
|
||||
from gsuid_core.utils.error_reply import get_error
|
||||
|
||||
from ..sruid_utils.api.mys.models import AvatarListItem, RoleBasicInfo, Stats
|
||||
from ..utils.fonts.starrail_fonts import sr_font_24, sr_font_30, sr_font_36
|
||||
from ..utils.image.convert import convert_img
|
||||
from ..utils.mys_api import mys_api
|
||||
from .utils import get_icon, wrap_list
|
||||
from ..utils.image.convert import convert_img
|
||||
from ..utils.fonts.starrail_fonts import sr_font_24, sr_font_30, sr_font_36
|
||||
from ..sruid_utils.api.mys.models import Stats, RoleBasicInfo, AvatarListItem
|
||||
|
||||
TEXT_PATH = Path(__file__).parent / 'texture2D'
|
||||
|
||||
|
@ -1,10 +1,9 @@
|
||||
from io import BytesIO
|
||||
from pathlib import Path
|
||||
from typing import Generator, List, TypeVar
|
||||
from typing import List, TypeVar, Generator
|
||||
|
||||
from aiohttp import ClientSession
|
||||
from PIL import Image
|
||||
|
||||
from aiohttp import ClientSession
|
||||
from gsuid_core.data_store import get_res_path
|
||||
|
||||
T = TypeVar("T")
|
||||
|
@ -1,14 +1,14 @@
|
||||
import asyncio
|
||||
import random
|
||||
import asyncio
|
||||
from copy import deepcopy
|
||||
|
||||
from gsuid_core.gss import gss
|
||||
from gsuid_core.logger import logger
|
||||
from gsuid_core.utils.plugins_config.gs_config import core_plugins_config
|
||||
|
||||
from ..starrailuid_config.sr_config import srconfig
|
||||
from ..utils.api import get_sqla
|
||||
from ..utils.mys_api import mys_api
|
||||
from ..starrailuid_config.sr_config import srconfig
|
||||
|
||||
private_msg_list = {}
|
||||
group_msg_list = {}
|
||||
@ -49,7 +49,9 @@ async def sign_in(sr_uid: str) -> str:
|
||||
if core_plugins_config.get_config('CaptchaPass').data:
|
||||
gt = sign_data['gt']
|
||||
ch = sign_data['challenge']
|
||||
vl, ch = await mys_api._pass(gt, ch, Header) # noqa: SLF001
|
||||
vl, ch = await mys_api._pass(
|
||||
gt, ch, Header
|
||||
) # noqa: SLF001
|
||||
if vl:
|
||||
delay = 1
|
||||
Header['x-rpc-challenge'] = ch
|
||||
|
@ -5,12 +5,14 @@ from typing import Optional
|
||||
|
||||
import aiohttp
|
||||
from PIL import Image, ImageDraw
|
||||
|
||||
from gsuid_core.logger import logger
|
||||
|
||||
from ..utils.api import get_sqla
|
||||
from ..utils.mys_api import mys_api
|
||||
from ..utils.image.convert import convert_img
|
||||
from ..sruid_utils.api.mys.models import Expedition
|
||||
from ..starrailuid_config.sr_config import srconfig
|
||||
from ..utils.api import get_sqla
|
||||
from ..utils.image.image_tools import get_simple_bg
|
||||
from ..utils.fonts.starrail_fonts import (
|
||||
sr_font_22,
|
||||
sr_font_24,
|
||||
@ -18,9 +20,6 @@ from ..utils.fonts.starrail_fonts import (
|
||||
sr_font_36,
|
||||
sr_font_50,
|
||||
)
|
||||
from ..utils.image.convert import convert_img
|
||||
from ..utils.image.image_tools import get_simple_bg
|
||||
from ..utils.mys_api import mys_api
|
||||
|
||||
use_widget = srconfig.get_config('WidgetResin').data
|
||||
|
||||
|
@ -3,10 +3,10 @@ from typing import Dict
|
||||
from gsuid_core.gss import gss
|
||||
from gsuid_core.logger import logger
|
||||
|
||||
from ..sruid_utils.api.mys.models import DailyNoteData
|
||||
from ..starrailuid_config.sr_config import srconfig
|
||||
from ..utils.api import get_sqla
|
||||
from ..utils.mys_api import mys_api
|
||||
from ..starrailuid_config.sr_config import srconfig
|
||||
from ..sruid_utils.api.mys.models import DailyNoteData
|
||||
|
||||
MR_NOTICE = '\n可发送[srmr]或者[sr每日]来查看更多信息!\n'
|
||||
|
||||
|
@ -2,8 +2,8 @@ from typing import List
|
||||
|
||||
from gsuid_core.logger import logger
|
||||
|
||||
from ..utils.error_reply import get_error
|
||||
from ..utils.mys_api import mys_api
|
||||
from ..utils.error_reply import get_error
|
||||
|
||||
daily_im = """*数据刷新可能存在一定延迟,请以当前游戏实际数据为准
|
||||
==============
|
||||
|
@ -1,12 +1,12 @@
|
||||
from typing import List
|
||||
|
||||
from gsuid_core.sv import SV
|
||||
from gsuid_core.bot import Bot
|
||||
from gsuid_core.models import Event
|
||||
from gsuid_core.sv import SV
|
||||
|
||||
from ..utils.api import get_sqla
|
||||
from ..utils.message import send_diff_msg
|
||||
from ..utils.sr_prefix import PREFIX
|
||||
from ..utils.message import send_diff_msg
|
||||
from .draw_user_card import get_user_card
|
||||
|
||||
sv_user_config = SV('sr用户管理', pm=2)
|
||||
|
@ -1,10 +1,10 @@
|
||||
from http.cookies import SimpleCookie
|
||||
from pathlib import Path
|
||||
from typing import Dict, List
|
||||
from http.cookies import SimpleCookie
|
||||
|
||||
from ..utils.api import get_sqla
|
||||
from ..utils.error_reply import UID_HINT
|
||||
from ..utils.mys_api import mys_api
|
||||
from ..utils.error_reply import UID_HINT
|
||||
|
||||
pic_path = Path(__file__).parent / 'pic'
|
||||
id_list = [
|
||||
@ -79,7 +79,6 @@ async def refresh_ck_by_uid_list(bot_id: str, uid_dict: Dict) -> str:
|
||||
return f'{s_im}\n{f_im}' if f_im else s_im
|
||||
|
||||
|
||||
|
||||
async def deal_ck(bot_id: str, mes: str, user_id: str, mode: str = 'PIC'):
|
||||
im = await _deal_ck(bot_id, mes, user_id)
|
||||
if mode == 'PIC':
|
||||
@ -236,10 +235,8 @@ async def _deal_ck(bot_id: str, mes: str, user_id: str) -> str:
|
||||
'Cookies和Stoken属于个人重要信息,如果你是在不知情的情况下添加,请马上修改米游社账户密码,保护个人隐私!'
|
||||
)
|
||||
im_list.append(
|
||||
|
||||
'如果需要【sr开启自动签到】和【sr开启推送】还需要在【群聊中】使用命令“绑定uid”绑定你的uid。'
|
||||
'\n例如:绑定uid123456789。'
|
||||
|
||||
)
|
||||
im_list.append('你可以使用命令【sr绑定信息】检查你的账号绑定情况!')
|
||||
return '\n'.join(im_list)
|
||||
|
@ -1,5 +1,5 @@
|
||||
# from pathlib import Path
|
||||
from typing import Optional, Tuple
|
||||
from typing import Tuple, Optional
|
||||
|
||||
from PIL import Image
|
||||
|
||||
|
@ -1,16 +1,15 @@
|
||||
import asyncio
|
||||
import base64
|
||||
import io
|
||||
import json
|
||||
import base64
|
||||
import asyncio
|
||||
from http.cookies import SimpleCookie
|
||||
from typing import Any, List, Literal, Tuple, Union
|
||||
from typing import Any, List, Tuple, Union, Literal
|
||||
|
||||
import qrcode
|
||||
from qrcode.constants import ERROR_CORRECT_L
|
||||
|
||||
from gsuid_core.bot import Bot
|
||||
from gsuid_core.logger import logger
|
||||
from gsuid_core.models import Event
|
||||
from gsuid_core.logger import logger
|
||||
from qrcode.constants import ERROR_CORRECT_L
|
||||
from gsuid_core.segment import MessageSegment
|
||||
|
||||
from ..utils.api import get_sqla
|
||||
|
@ -1,14 +1,14 @@
|
||||
import re
|
||||
from typing import Optional, Tuple, Union, overload
|
||||
from typing import Tuple, Union, Optional, overload
|
||||
|
||||
from gsuid_core.bot import Bot
|
||||
from gsuid_core.models import Event
|
||||
from gsuid_core.utils.api.mys.models import IndexData
|
||||
|
||||
from ..sruid_utils.api.mys.models import AbyssData, RogueData
|
||||
from .api import get_sqla
|
||||
from .error_reply import VERIFY_HINT
|
||||
from .mys_api import mys_api
|
||||
from .error_reply import VERIFY_HINT
|
||||
from ..sruid_utils.api.mys.models import AbyssData, RogueData
|
||||
|
||||
|
||||
@overload
|
||||
|
@ -1,6 +1,6 @@
|
||||
from base64 import b64encode
|
||||
from io import BytesIO
|
||||
from pathlib import Path
|
||||
from base64 import b64encode
|
||||
from typing import Union, overload
|
||||
|
||||
import aiofiles
|
||||
|
@ -156,7 +156,9 @@ for skill in AvatarSkillConfig:
|
||||
for avatar_property in AvatarPropertyConfig:
|
||||
PropertyType = AvatarPropertyConfig[avatar_property]['PropertyType']
|
||||
PropertyName = AvatarPropertyConfig[avatar_property]['PropertyName']
|
||||
PropertyNameHash = AvatarPropertyConfig[avatar_property]['PropertyNameFilter']['Hash']
|
||||
PropertyNameHash = AvatarPropertyConfig[avatar_property][
|
||||
'PropertyNameFilter'
|
||||
]['Hash']
|
||||
for item in TextMapCN:
|
||||
if str(item) == str(PropertyNameHash):
|
||||
Property_Name = TextMapCN[item]
|
||||
@ -180,7 +182,11 @@ for set_group in RelicSetConfig:
|
||||
|
||||
for character in characters:
|
||||
char_id = characters[character]['id']
|
||||
characterSkillTree[str(char_id)] = {} if str(char_id) not in characterSkillTree else characterSkillTree[str(char_id)]
|
||||
characterSkillTree[str(char_id)] = (
|
||||
{}
|
||||
if str(char_id) not in characterSkillTree
|
||||
else characterSkillTree[str(char_id)]
|
||||
)
|
||||
skill_tree_list = characters[character]['skill_trees']
|
||||
for skill in skill_tree_list:
|
||||
skill_tree = character_skill_trees[skill]
|
||||
@ -191,8 +197,14 @@ for set_ in RelicSetSkillConfig:
|
||||
for item in RelicSetSkillConfig[set_]:
|
||||
set_id = RelicSetSkillConfig[set_][item]['SetID']
|
||||
property_list = RelicSetSkillConfig[set_][item]['PropertyList']
|
||||
RelicSetSkill[set_] = {} if set_ not in RelicSetSkill else RelicSetSkill[set_]
|
||||
RelicSetSkill[set_][item] = {} if item not in RelicSetSkill[set_] else RelicSetSkill[set_][item]
|
||||
RelicSetSkill[set_] = (
|
||||
{} if set_ not in RelicSetSkill else RelicSetSkill[set_]
|
||||
)
|
||||
RelicSetSkill[set_][item] = (
|
||||
{}
|
||||
if item not in RelicSetSkill[set_]
|
||||
else RelicSetSkill[set_][item]
|
||||
)
|
||||
for property_ in property_list:
|
||||
property_id = property_['NAOGDGBJNOJ']
|
||||
property_value = property_['MBOHKHKHFPD']['Value']
|
||||
@ -234,7 +246,9 @@ Property2Name = json.dumps(Property2Name, ensure_ascii=False)
|
||||
Relic2SetId = json.dumps(Relic2SetId, ensure_ascii=False)
|
||||
SetId2Name = json.dumps(SetId2Name, ensure_ascii=False)
|
||||
characterSkillTree = json.dumps(characterSkillTree, ensure_ascii=False)
|
||||
EquipmentID2AbilityProperty = json.dumps(EquipmentID2AbilityProperty, ensure_ascii=False)
|
||||
EquipmentID2AbilityProperty = json.dumps(
|
||||
EquipmentID2AbilityProperty, ensure_ascii=False
|
||||
)
|
||||
RelicSetSkill = json.dumps(RelicSetSkill, ensure_ascii=False)
|
||||
skillId2AttackType = json.dumps(skillId2AttackType, ensure_ascii=False)
|
||||
EquipmentID2Rarity = json.dumps(EquipmentID2Rarity, ensure_ascii=False)
|
||||
|
@ -2,13 +2,12 @@ import asyncio
|
||||
from pathlib import Path
|
||||
from typing import Dict, List, Tuple, Union
|
||||
|
||||
from aiohttp.client import ClientSession
|
||||
from msgspec import json as msgjson
|
||||
|
||||
from gsuid_core.logger import logger
|
||||
from aiohttp.client import ClientSession
|
||||
|
||||
from .download_url import download_file
|
||||
from .RESOURCE_PATH import GUIDE_PATH, RESOURCE_PATH, WIKI_PATH
|
||||
from .RESOURCE_PATH import WIKI_PATH, GUIDE_PATH, RESOURCE_PATH
|
||||
|
||||
with Path.open(
|
||||
Path(__file__).parent / 'resource_map.json', encoding='UTF-8'
|
||||
|
@ -1,12 +1,11 @@
|
||||
from typing import Optional, Tuple
|
||||
from typing import Tuple, Optional
|
||||
|
||||
import aiofiles
|
||||
from gsuid_core.logger import logger
|
||||
from aiohttp.client import ClientSession
|
||||
from aiohttp.client_exceptions import ClientConnectorError
|
||||
|
||||
from gsuid_core.logger import logger
|
||||
|
||||
from .RESOURCE_PATH import GUIDE_PATH, RESOURCE_PATH, WIKI_PATH
|
||||
from .RESOURCE_PATH import WIKI_PATH, GUIDE_PATH, RESOURCE_PATH
|
||||
|
||||
PATHDICT = {
|
||||
'resource': RESOURCE_PATH,
|
||||
|
Loading…
x
Reference in New Issue
Block a user