mirror of
https://github.com/PaiGramTeam/StarRailDamageCal.git
synced 2024-11-16 04:45:43 +00:00
更新1.5遗器
This commit is contained in:
parent
a995d48482
commit
4935dea7e8
@ -1,6 +1,6 @@
|
||||
[project]
|
||||
name = "starrail_damage_cal"
|
||||
version = "1.0.5"
|
||||
version = "1.0.6"
|
||||
description = "For StarRail Role Damage Cal"
|
||||
authors = [
|
||||
{name = "qwerdvd", email = "105906879+qwerdvd@users.noreply.github.com"},
|
||||
|
@ -55,7 +55,7 @@ class DamageCal:
|
||||
raise MihomoRequestError
|
||||
|
||||
if char_id not in char_id_list:
|
||||
raise NotInCharacterShowcaseError(char_id_list)
|
||||
raise NotInCharacterShowcaseError
|
||||
|
||||
char_data = char_data_dict[char_id]
|
||||
return await cls.cal_info(char_data)
|
||||
@ -78,7 +78,7 @@ class DamageCal:
|
||||
raise MihomoRequestError
|
||||
|
||||
if char_id not in char_id_list:
|
||||
raise NotInCharacterShowcaseError(char_id_list)
|
||||
raise NotInCharacterShowcaseError
|
||||
|
||||
char_data = char_data_dict[char_id]
|
||||
return await cls.cal_info(char_data)
|
||||
@ -104,7 +104,7 @@ class DamageCal:
|
||||
|
||||
@classmethod
|
||||
async def get_all_damage_data_by_uid(cls, uid: str):
|
||||
char_id_list, char_data_dict = await api_to_dict(uid)
|
||||
char_id_list, char_data_dict = await api_to_dict(sr_uid=uid)
|
||||
|
||||
if isinstance(char_id_list, str):
|
||||
raise MihomoRequestError
|
||||
|
@ -371,6 +371,56 @@ class Relic114(BaseRelicSetSkill):
|
||||
attribute_bonus["SpeedAddedRatio"] = speed_added_ratio + 0.12000000011175871
|
||||
return attribute_bonus
|
||||
|
||||
class Relic115(BaseRelicSetSkill):
|
||||
def __init__(self, set_id: int, count: int):
|
||||
super().__init__(set_id, count)
|
||||
self._count = count
|
||||
|
||||
async def check(
|
||||
self,
|
||||
base_attr: Dict[str, float],
|
||||
attribute_bonus: Dict[str, float],
|
||||
):
|
||||
"""追加攻击造成的伤害提高20%。"""
|
||||
"""每次造成伤害时使装备者的攻击力提高6%,最多叠加8次,持续3回合。该效果在装备者下一次施放追加攻击时移除。"""
|
||||
logger.info("Relic114 check success")
|
||||
return True
|
||||
|
||||
async def set_skill_ability(
|
||||
self,
|
||||
base_attr: Dict[str, float],
|
||||
attribute_bonus: Dict[str, float],
|
||||
):
|
||||
if self.pieces2:
|
||||
attribute_bonus["TalentDmgAdd"] = attribute_bonus.get("TalentDmgAdd", 0) + 0.20000000011175871
|
||||
if self.pieces4 and await self.check(base_attr, attribute_bonus):
|
||||
attack_added_ratio = attribute_bonus.get("AttackAddedRatio", 0)
|
||||
attribute_bonus["AttackAddedRatio"] = attack_added_ratio + 0.06000000009313226 * 8
|
||||
return attribute_bonus
|
||||
|
||||
class Relic116(BaseRelicSetSkill):
|
||||
def __init__(self, set_id: int, count: int):
|
||||
super().__init__(set_id, count)
|
||||
self._count = count
|
||||
|
||||
async def check(
|
||||
self,
|
||||
base_attr: Dict[str, float],
|
||||
attribute_bonus: Dict[str, float],
|
||||
):
|
||||
"""敌方目标每承受1个持续伤害效果,装备者对其造成伤害时就无视其6%的防御力,最多计入3个持续伤害效果。"""
|
||||
logger.info("Relic114 check success")
|
||||
return True
|
||||
|
||||
async def set_skill_ability(
|
||||
self,
|
||||
base_attr: Dict[str, float],
|
||||
attribute_bonus: Dict[str, float],
|
||||
):
|
||||
if self.pieces4 and await self.check(base_attr, attribute_bonus):
|
||||
ignore_defence = attribute_bonus.get("ignore_defence", 0)
|
||||
attribute_bonus["ignore_defence"] = ignore_defence + 0.06000000009313226 * 3
|
||||
return attribute_bonus
|
||||
|
||||
class Relic301(BaseRelicSetSkill):
|
||||
def __init__(self, set_id: int, count: int):
|
||||
@ -661,6 +711,58 @@ class Relic310(BaseRelicSetSkill):
|
||||
)
|
||||
return attribute_bonus
|
||||
|
||||
class Relic311(BaseRelicSetSkill):
|
||||
def __init__(self, set_id: int, count: int):
|
||||
super().__init__(set_id, count)
|
||||
|
||||
async def check(
|
||||
self,
|
||||
base_attr: Dict[str, float],
|
||||
attribute_bonus: Dict[str, float],
|
||||
):
|
||||
"""当装备者的速度大于等于135/160时,使装备者造成的伤害提高12%/18%。"""
|
||||
merged_attr = await merge_attribute(base_attr, attribute_bonus)
|
||||
if merged_attr["speed"] >= 135:
|
||||
logger.info("Relic306 check success")
|
||||
return True
|
||||
return False
|
||||
|
||||
async def set_skill_ability(
|
||||
self,
|
||||
base_attr: Dict[str, float],
|
||||
attribute_bonus: Dict[str, float],
|
||||
):
|
||||
if self.pieces2 and await self.check(base_attr, attribute_bonus):
|
||||
merged_attr = await merge_attribute(base_attr, attribute_bonus)
|
||||
if merged_attr["speed"] >= 135:
|
||||
add_damage_base = 0.12000000018626451
|
||||
if merged_attr["speed"] >= 160:
|
||||
add_damage_base = 0.18000000018626451
|
||||
attribute_bonus["AllDamageAddedRatio"] = attribute_bonus.get("AllDamageAddedRatio", 0) + add_damage_base
|
||||
|
||||
return attribute_bonus
|
||||
|
||||
class Relic312(BaseRelicSetSkill):
|
||||
def __init__(self, set_id: int, count: int):
|
||||
super().__init__(set_id, count)
|
||||
|
||||
async def check(
|
||||
self,
|
||||
base_attr: Dict[str, float],
|
||||
attribute_bonus: Dict[str, float],
|
||||
):
|
||||
"""使队伍中与装备者属性相同的我方其他角色造成的伤害提高10%。"""
|
||||
return True
|
||||
|
||||
async def set_skill_ability(
|
||||
self,
|
||||
base_attr: Dict[str, float],
|
||||
attribute_bonus: Dict[str, float],
|
||||
):
|
||||
if self.pieces2 and await self.check(base_attr, attribute_bonus):
|
||||
attribute_bonus["AllDamageAddedRatio"] = attribute_bonus.get("AllDamageAddedRatio", 0) + 0.10000000018626451
|
||||
|
||||
return attribute_bonus
|
||||
|
||||
class RelicSet:
|
||||
HEAD: SingleRelic
|
||||
@ -687,6 +789,8 @@ class RelicSet:
|
||||
Relic112,
|
||||
Relic113,
|
||||
Relic114,
|
||||
Relic115,
|
||||
Relic116,
|
||||
Relic301,
|
||||
Relic302,
|
||||
Relic303,
|
||||
@ -697,6 +801,8 @@ class RelicSet:
|
||||
Relic308,
|
||||
Relic309,
|
||||
Relic310,
|
||||
Relic311,
|
||||
Relic312,
|
||||
]
|
||||
]
|
||||
|
||||
@ -765,6 +871,10 @@ class RelicSet:
|
||||
self.SetSkill.append(Relic113(set_id, count))
|
||||
elif set_id == 114:
|
||||
self.SetSkill.append(Relic114(set_id, count))
|
||||
elif set_id == 115:
|
||||
self.SetSkill.append(Relic115(set_id, count))
|
||||
elif set_id == 116:
|
||||
self.SetSkill.append(Relic116(set_id, count))
|
||||
elif set_id == 301:
|
||||
self.SetSkill.append(Relic301(set_id, count))
|
||||
elif set_id == 302:
|
||||
@ -785,6 +895,10 @@ class RelicSet:
|
||||
self.SetSkill.append(Relic309(set_id, count))
|
||||
elif set_id == 310:
|
||||
self.SetSkill.append(Relic310(set_id, count))
|
||||
elif set_id == 311:
|
||||
self.SetSkill.append(Relic311(set_id, count))
|
||||
elif set_id == 312:
|
||||
self.SetSkill.append(Relic312(set_id, count))
|
||||
else:
|
||||
msg = f"Unknow SetId: {set_id}"
|
||||
raise ValueError(msg)
|
||||
|
@ -35,6 +35,42 @@
|
||||
"StatusResistanceBase": 0.0,
|
||||
"AttributeAddedRatio": 1
|
||||
},
|
||||
{
|
||||
"role": "真理医生",
|
||||
"HPDelta": 0.0,
|
||||
"HPAddedRatio": 0.0,
|
||||
"AttackDelta": 0.75,
|
||||
"AttackAddedRatio": 0.75,
|
||||
"DefenceDelta": 0.0,
|
||||
"DefenceAddedRatio": 0.0,
|
||||
"SpeedDelta": 1.0,
|
||||
"CriticalChanceBase": 1,
|
||||
"CriticalDamageBase": 1,
|
||||
"BreakDamageAddedRatioBase": 0.0,
|
||||
"HealRatio": 0,
|
||||
"SPRatio": 0.5,
|
||||
"StatusProbabilityBase": 0.0,
|
||||
"StatusResistanceBase": 0.0,
|
||||
"AttributeAddedRatio": 1
|
||||
},
|
||||
{
|
||||
"role": "阮•梅",
|
||||
"HPDelta": 0.0,
|
||||
"HPAddedRatio": 0.0,
|
||||
"AttackDelta": 0.5,
|
||||
"AttackAddedRatio": 0.5,
|
||||
"DefenceDelta": 0.0,
|
||||
"DefenceAddedRatio": 0.0,
|
||||
"SpeedDelta": 1.0,
|
||||
"CriticalChanceBase": 1,
|
||||
"CriticalDamageBase": 1,
|
||||
"BreakDamageAddedRatioBase": 1.0,
|
||||
"HealRatio": 0,
|
||||
"SPRatio": 0.5,
|
||||
"StatusProbabilityBase": 0.0,
|
||||
"StatusResistanceBase": 0.0,
|
||||
"AttributeAddedRatio": 1
|
||||
},
|
||||
{
|
||||
"role": "布洛妮娅",
|
||||
"HPDelta": 0.75,
|
||||
|
@ -271,6 +271,22 @@
|
||||
"43106": 36,
|
||||
"53106": 46,
|
||||
"63106": 56,
|
||||
"33115": 25,
|
||||
"43115": 35,
|
||||
"53115": 45,
|
||||
"63115": 55,
|
||||
"33116": 26,
|
||||
"43116": 36,
|
||||
"53116": 46,
|
||||
"63116": 56,
|
||||
"33125": 25,
|
||||
"43125": 35,
|
||||
"53125": 45,
|
||||
"63125": 55,
|
||||
"33126": 26,
|
||||
"43126": 36,
|
||||
"53126": 46,
|
||||
"63126": 56,
|
||||
"55001": 436,
|
||||
"55002": 441,
|
||||
"55003": 434,
|
||||
@ -308,5 +324,37 @@
|
||||
"31144": 24,
|
||||
"41144": 34,
|
||||
"51144": 44,
|
||||
"61144": 54
|
||||
"61144": 54,
|
||||
"31151": 21,
|
||||
"41151": 31,
|
||||
"51151": 41,
|
||||
"61151": 51,
|
||||
"31152": 22,
|
||||
"41152": 32,
|
||||
"51152": 42,
|
||||
"61152": 52,
|
||||
"31153": 23,
|
||||
"41153": 33,
|
||||
"51153": 43,
|
||||
"61153": 53,
|
||||
"31154": 24,
|
||||
"41154": 34,
|
||||
"51154": 44,
|
||||
"61154": 54,
|
||||
"31161": 21,
|
||||
"41161": 31,
|
||||
"51161": 41,
|
||||
"61161": 51,
|
||||
"31162": 22,
|
||||
"41162": 32,
|
||||
"51162": 42,
|
||||
"61162": 52,
|
||||
"31163": 23,
|
||||
"41163": 33,
|
||||
"51163": 43,
|
||||
"61163": 53,
|
||||
"31164": 24,
|
||||
"41164": 34,
|
||||
"51164": 44,
|
||||
"61164": 54
|
||||
}
|
@ -55,6 +55,14 @@
|
||||
"31142": 2,
|
||||
"31143": 2,
|
||||
"31144": 2,
|
||||
"31151": 2,
|
||||
"31152": 2,
|
||||
"31153": 2,
|
||||
"31154": 2,
|
||||
"31161": 2,
|
||||
"31162": 2,
|
||||
"31163": 2,
|
||||
"31164": 2,
|
||||
"33015": 2,
|
||||
"33016": 2,
|
||||
"33025": 2,
|
||||
@ -75,6 +83,10 @@
|
||||
"33096": 2,
|
||||
"33105": 2,
|
||||
"33106": 2,
|
||||
"33115": 2,
|
||||
"33116": 2,
|
||||
"33125": 2,
|
||||
"33126": 2,
|
||||
"41011": 3,
|
||||
"41012": 3,
|
||||
"41013": 3,
|
||||
@ -131,6 +143,14 @@
|
||||
"41142": 3,
|
||||
"41143": 3,
|
||||
"41144": 3,
|
||||
"41151": 3,
|
||||
"41152": 3,
|
||||
"41153": 3,
|
||||
"41154": 3,
|
||||
"41161": 3,
|
||||
"41162": 3,
|
||||
"41163": 3,
|
||||
"41164": 3,
|
||||
"43015": 3,
|
||||
"43016": 3,
|
||||
"43025": 3,
|
||||
@ -151,6 +171,10 @@
|
||||
"43096": 3,
|
||||
"43105": 3,
|
||||
"43106": 3,
|
||||
"43115": 3,
|
||||
"43116": 3,
|
||||
"43125": 3,
|
||||
"43126": 3,
|
||||
"51011": 4,
|
||||
"51012": 4,
|
||||
"51013": 4,
|
||||
@ -207,6 +231,14 @@
|
||||
"51142": 4,
|
||||
"51143": 4,
|
||||
"51144": 4,
|
||||
"51151": 4,
|
||||
"51152": 4,
|
||||
"51153": 4,
|
||||
"51154": 4,
|
||||
"51161": 4,
|
||||
"51162": 4,
|
||||
"51163": 4,
|
||||
"51164": 4,
|
||||
"53015": 4,
|
||||
"53016": 4,
|
||||
"53025": 4,
|
||||
@ -227,6 +259,10 @@
|
||||
"53096": 4,
|
||||
"53105": 4,
|
||||
"53106": 4,
|
||||
"53115": 4,
|
||||
"53116": 4,
|
||||
"53125": 4,
|
||||
"53126": 4,
|
||||
"55001": 4,
|
||||
"55002": 4,
|
||||
"55003": 4,
|
||||
@ -289,6 +325,14 @@
|
||||
"61142": 5,
|
||||
"61143": 5,
|
||||
"61144": 5,
|
||||
"61151": 5,
|
||||
"61152": 5,
|
||||
"61153": 5,
|
||||
"61154": 5,
|
||||
"61161": 5,
|
||||
"61162": 5,
|
||||
"61163": 5,
|
||||
"61164": 5,
|
||||
"63015": 5,
|
||||
"63016": 5,
|
||||
"63025": 5,
|
||||
@ -308,5 +352,9 @@
|
||||
"63095": 5,
|
||||
"63096": 5,
|
||||
"63105": 5,
|
||||
"63106": 5
|
||||
"63106": 5,
|
||||
"63115": 5,
|
||||
"63116": 5,
|
||||
"63125": 5,
|
||||
"63126": 5
|
||||
}
|
@ -271,6 +271,22 @@
|
||||
"43106": 310,
|
||||
"53106": 310,
|
||||
"63106": 310,
|
||||
"33115": 311,
|
||||
"43115": 311,
|
||||
"53115": 311,
|
||||
"63115": 311,
|
||||
"33116": 311,
|
||||
"43116": 311,
|
||||
"53116": 311,
|
||||
"63116": 311,
|
||||
"33125": 312,
|
||||
"43125": 312,
|
||||
"53125": 312,
|
||||
"63125": 312,
|
||||
"33126": 312,
|
||||
"43126": 312,
|
||||
"53126": 312,
|
||||
"63126": 312,
|
||||
"55001": 101,
|
||||
"55002": 101,
|
||||
"55003": 102,
|
||||
@ -308,5 +324,37 @@
|
||||
"31144": 114,
|
||||
"41144": 114,
|
||||
"51144": 114,
|
||||
"61144": 114
|
||||
"61144": 114,
|
||||
"31151": 115,
|
||||
"41151": 115,
|
||||
"51151": 115,
|
||||
"61151": 115,
|
||||
"31152": 115,
|
||||
"41152": 115,
|
||||
"51152": 115,
|
||||
"61152": 115,
|
||||
"31153": 115,
|
||||
"41153": 115,
|
||||
"51153": 115,
|
||||
"61153": 115,
|
||||
"31154": 115,
|
||||
"41154": 115,
|
||||
"51154": 115,
|
||||
"61154": 115,
|
||||
"31161": 116,
|
||||
"41161": 116,
|
||||
"51161": 116,
|
||||
"61161": 116,
|
||||
"31162": 116,
|
||||
"41162": 116,
|
||||
"51162": 116,
|
||||
"61162": 116,
|
||||
"31163": 116,
|
||||
"41163": 116,
|
||||
"51163": 116,
|
||||
"61163": 116,
|
||||
"31164": 116,
|
||||
"41164": 116,
|
||||
"51164": 116,
|
||||
"61164": 116
|
||||
}
|
@ -146,6 +146,18 @@
|
||||
"Value": 0.10000000009313226
|
||||
}
|
||||
},
|
||||
"311": {
|
||||
"2": {
|
||||
"Property": "AttackAddedRatio",
|
||||
"Value": 0.12000000011175871
|
||||
}
|
||||
},
|
||||
"312": {
|
||||
"2": {
|
||||
"Property": "SPRatioBase",
|
||||
"Value": 0.05000000004656613
|
||||
}
|
||||
},
|
||||
"113": {
|
||||
"2": {
|
||||
"Property": "HPAddedRatio",
|
||||
@ -159,5 +171,16 @@
|
||||
"Value": 0.060000000055879354
|
||||
},
|
||||
"4": {}
|
||||
},
|
||||
"115": {
|
||||
"2": {},
|
||||
"4": {}
|
||||
},
|
||||
"116": {
|
||||
"2": {
|
||||
"Property": "AttackAddedRatio",
|
||||
"Value": 0.12000000011175871
|
||||
},
|
||||
"4": {}
|
||||
}
|
||||
}
|
@ -13,6 +13,8 @@
|
||||
"112": "盗匪荒漠的废土客",
|
||||
"113": "宝命长存的莳者",
|
||||
"114": "骇域漫游的信使",
|
||||
"115": "毁烬焚骨的大公",
|
||||
"116": "幽锁深牢的系囚",
|
||||
"301": "太空封印站",
|
||||
"302": "不老者的仙舟",
|
||||
"303": "泛银河商业公司",
|
||||
@ -22,5 +24,7 @@
|
||||
"307": "盗贼公国塔利亚",
|
||||
"308": "生命的翁瓦克",
|
||||
"309": "繁星竞技场",
|
||||
"310": "折断的龙骨"
|
||||
"310": "折断的龙骨",
|
||||
"311": "苍穹战线格拉默",
|
||||
"312": "梦想之地匹诺康尼"
|
||||
}
|
@ -40,6 +40,6 @@
|
||||
"1302": "Argenti",
|
||||
"1217": "Huohuo",
|
||||
"1215": "Hanya",
|
||||
"1305": "Dr. Ratio",
|
||||
"1305": "DrRatio",
|
||||
"1303": "RuanMei"
|
||||
}
|
@ -305,7 +305,8 @@ async def get_data(
|
||||
char_data["equipmentInfo"] = equipment_info
|
||||
|
||||
if save_path:
|
||||
path = save_path / uid
|
||||
path = save_path / str(uid)
|
||||
path.mkdir(parents=True, exist_ok=True)
|
||||
path.mkdir(parents=True, exist_ok=True)
|
||||
with Path.open(path / f"{avatarName}.json", "w", encoding="UTF-8") as file:
|
||||
json.dump(char_data, file, ensure_ascii=False)
|
||||
|
Loading…
Reference in New Issue
Block a user