bump to 1.2.0

This commit is contained in:
qwerdvd 2023-12-16 12:30:35 +08:00
parent a49a18d459
commit 47beeedf75
No known key found for this signature in database
GPG Key ID: A3AF89C783404769
5 changed files with 123 additions and 57 deletions

View File

@ -1,6 +1,6 @@
[project]
name = "starrail_damage_cal"
version = "1.1.0"
version = "1.2.0"
description = "For StarRail Role Damage Cal"
authors = [
{name = "qwerdvd", email = "105906879+qwerdvd@users.noreply.github.com"},

View File

@ -7,11 +7,10 @@ from starrail_damage_cal.damage.Base.model import (
DamageInstanceSkill,
)
from starrail_damage_cal.damage.Role import (
break_damage,
calculate_damage,
calculate_heal,
calculate_shield,
get_damage,
break_damage,
)
from starrail_damage_cal.logger import logger
@ -4371,6 +4370,7 @@ class Hanya(BaseAvatar):
return skill_info_list
class DrRatio(BaseAvatar):
Buff: BaseAvatarBuff
@ -4401,8 +4401,6 @@ class DrRatio(BaseAvatar):
base_attr: Dict[str, float],
attribute_bonus: Dict[str, float],
):
damage1, damage2, damage3 = await calculate_damage(
base_attr,
attribute_bonus,
@ -4485,6 +4483,7 @@ class DrRatio(BaseAvatar):
return skill_info_list
class RuanMei(BaseAvatar):
Buff: BaseAvatarBuff
@ -4515,17 +4514,28 @@ class RuanMei(BaseAvatar):
attribute_bonus: Dict[str, float],
):
# 计算属性加成
attribute_bonus["AllDamageAddedRatio"] = attribute_bonus.get("AllDamageAddedRatio",0) + self.Skill_num("BPSkill", "BPSkill")
attribute_bonus["BreakDamageAddedRatioBase"] = attribute_bonus.get("BreakDamageAddedRatioBase",0) + 0.5
attribute_bonus["ResistancePenetration"] = attribute_bonus.get("ResistancePenetration",0) + self.Skill_num("Ultra", "Ultra_P")
attribute_bonus["SpeedAddedRatio"] = attribute_bonus.get("SpeedAddedRatio",0) + self.Skill_num("Talent", "Talent_S")
attribute_bonus["AllDamageAddedRatio"] = attribute_bonus.get(
"AllDamageAddedRatio", 0
) + self.Skill_num("BPSkill", "BPSkill")
attribute_bonus["BreakDamageAddedRatioBase"] = (
attribute_bonus.get("BreakDamageAddedRatioBase", 0) + 0.5
)
attribute_bonus["ResistancePenetration"] = attribute_bonus.get(
"ResistancePenetration", 0
) + self.Skill_num("Ultra", "Ultra_P")
attribute_bonus["SpeedAddedRatio"] = attribute_bonus.get(
"SpeedAddedRatio", 0
) + self.Skill_num("Talent", "Talent_S")
#战斗中阮•梅的击破特攻大于120%时每超过10%则战技使我方全体伤害提高的效果额外提高6%最高不超过36%。
# 战斗中阮•梅的击破特攻大于120%时, 每超过10%, 则战技使我方全体伤害提高的效果额外提高6%, 最高不超过36%。
Break_Damage_Added_Ratio = attribute_bonus.get("BreakDamageAddedRatioBase", 0)
if Break_Damage_Added_Ratio > 1.2:
add_all_damage_added_ratio = ((Break_Damage_Added_Ratio - 1.2) / 0.1) * 0.06
add_all_damage_added_ratio = min(0.36, add_all_damage_added_ratio)
attribute_bonus["AllDamageAddedRatio"] = attribute_bonus.get("AllDamageAddedRatio",0) + add_all_damage_added_ratio
attribute_bonus["AllDamageAddedRatio"] = (
attribute_bonus.get("AllDamageAddedRatio", 0)
+ add_all_damage_added_ratio
)
damage1, damage2, damage3 = await calculate_damage(
base_attr,
@ -4582,6 +4592,7 @@ class RuanMei(BaseAvatar):
return skill_info_list
class XueYi(BaseAvatar):
Buff: BaseAvatarBuff
@ -4602,16 +4613,20 @@ class XueYi(BaseAvatar):
self.eidolon_attribute["BreakDamageAddedRatioBase"] = 0.4
def extra_ability(self):
self.extra_ability_attribute["UltraDmgAdd"] = 0.1 + self.Skill_num("Ultra", "Ultra_A")
self.extra_ability_attribute["UltraDmgAdd"] = 0.1 + self.Skill_num(
"Ultra", "Ultra_A"
)
async def getdamage(
self,
base_attr: Dict[str, float],
attribute_bonus: Dict[str, float],
):
#使自身造成的伤害提高提高数值等同于击破特攻的100%最多使造成的伤害提高240%。
# 使自身造成的伤害提高, 提高数值等同于击破特攻的100%, 最多使造成的伤害提高240%。
Break_Damage_Added_Ratio = attribute_bonus.get("BreakDamageAddedRatioBase", 0)
attribute_bonus["AllDamageAddedRatio"] = attribute_bonus.get("AllDamageAddedRatio",0) + min(2.4,Break_Damage_Added_Ratio)
attribute_bonus["AllDamageAddedRatio"] = attribute_bonus.get(
"AllDamageAddedRatio", 0
) + min(2.4, Break_Damage_Added_Ratio)
damage1, damage2, damage3 = await calculate_damage(
base_attr,
@ -4684,6 +4699,7 @@ class XueYi(BaseAvatar):
return skill_info_list
class AvatarDamage:
@classmethod
def create(cls, char: DamageInstanceAvatar, skills: List[DamageInstanceSkill]):

View File

@ -371,6 +371,7 @@ 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)
@ -392,12 +393,17 @@ class Relic115(BaseRelicSetSkill):
attribute_bonus: Dict[str, float],
):
if self.pieces2:
attribute_bonus["TalentDmgAdd"] = attribute_bonus.get("TalentDmgAdd", 0) + 0.20000000011175871
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
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)
@ -422,6 +428,7 @@ class Relic116(BaseRelicSetSkill):
attribute_bonus["ignore_defence"] = ignore_defence + 0.06000000009313226 * 3
return attribute_bonus
class Relic301(BaseRelicSetSkill):
def __init__(self, set_id: int, count: int):
super().__init__(set_id, count)
@ -711,6 +718,7 @@ class Relic310(BaseRelicSetSkill):
)
return attribute_bonus
class Relic311(BaseRelicSetSkill):
def __init__(self, set_id: int, count: int):
super().__init__(set_id, count)
@ -720,7 +728,7 @@ class Relic311(BaseRelicSetSkill):
base_attr: Dict[str, float],
attribute_bonus: Dict[str, float],
):
"""当装备者的速度大于等于135/160时使装备者造成的伤害提高12%/18%"""
"""当装备者的速度大于等于135/160时, 使装备者造成的伤害提高12%/18%"""
merged_attr = await merge_attribute(base_attr, attribute_bonus)
if merged_attr["speed"] >= 135:
logger.info("Relic306 check success")
@ -733,15 +741,19 @@ class Relic311(BaseRelicSetSkill):
attribute_bonus: Dict[str, float],
):
if self.pieces2 and await self.check(base_attr, attribute_bonus):
add_damage_base = 0
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
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)
@ -760,10 +772,13 @@ class Relic312(BaseRelicSetSkill):
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
attribute_bonus["AllDamageAddedRatio"] = (
attribute_bonus.get("AllDamageAddedRatio", 0) + 0.10000000018626451
)
return attribute_bonus
class RelicSet:
HEAD: SingleRelic
HAND: SingleRelic

View File

@ -52,6 +52,7 @@ async def calculate_shield(
return [defence_num]
async def get_damage(
damege: int,
base_attr: Dict[str, float],
@ -88,6 +89,7 @@ async def get_damage(
return [damage_cd, damage_qw, damage_tz]
async def break_damage(
base_attr: Dict[str, float],
attribute_bonus: Dict[str, float],
@ -97,13 +99,13 @@ async def break_damage(
level: int,
):
break_element = {
'Ice': 1,
'Imaginary': 1,
'Quantum': 1,
'Thunder': 2,
'Wind': 3,
'Physical': 4,
'Fire': 5,
"Ice": 1,
"Imaginary": 1,
"Quantum": 1,
"Thunder": 2,
"Wind": 3,
"Physical": 4,
"Fire": 5,
}
add_attr_bonus = copy.deepcopy(attribute_bonus)
@ -112,7 +114,7 @@ async def break_damage(
merged_attr = await merge_attribute(base_attr, add_attr_bonus)
break_atk = 3767.55 #80级敌人击破伤害基数我也不知道为什么是这个反正都说是这个
break_atk = 3767.55 # 80级敌人击破伤害基数, 我也不知道为什么是这个, 反正都说是这个
damage_reduction = calculate_damage_reduction(level)
@ -123,16 +125,28 @@ async def break_damage(
element,
)
defence_multiplier = calculate_defence_multiplier(level, merged_attr)
defence_multiplier = calculate_defence_multiplier(
level, merged_attr, skill_type, add_skill_type
)
damage_ratio = calculate_damage_ratio(merged_attr, skill_type, add_skill_type)
break_damage = merged_attr.get("BreakDamageAddedRatioBase", 0) + 1
damage_cd = break_atk * break_element[element] * 2 * break_damage * damage_ratio * damage_reduction * resistance_area * defence_multiplier
damage_cd = (
break_atk
* break_element[element]
* 2
* break_damage
* damage_ratio
* damage_reduction
* resistance_area
* defence_multiplier
)
return [damage_cd]
async def calculate_damage(
base_attr: Dict[str, float],
attribute_bonus: Dict[str, float],
@ -165,7 +179,9 @@ async def calculate_damage(
element,
)
defence_multiplier = calculate_defence_multiplier(level, merged_attr, skill_type, add_skill_type)
defence_multiplier = calculate_defence_multiplier(
level, merged_attr, skill_type, add_skill_type
)
injury_area, element_area = calculate_injury_area(
merged_attr,

View File

@ -2261,6 +2261,7 @@ class Mediation(BaseWeapon):
)
return attribute_bonus
# 纯粹思维的洗礼
class BaptismofPureThought(BaseWeapon):
weapon_base_attributes: Dict
@ -2269,7 +2270,7 @@ class BaptismofPureThought(BaseWeapon):
super().__init__(weapon)
async def check(self):
# 敌方目标每承受1个负面效果装备者对其造成的暴击伤害额外提高8%最多叠加3层。施放终结技攻击敌方目标时使装备者获得【论辩】效果造成的伤害提高36%追加攻击无视目标24%的防御力,该效果持续2回合。
# 敌方目标每承受1个负面效果, 装备者对其造成的暴击伤害额外提高8%, 最多叠加3层。施放终结技攻击敌方目标时, 使装备者获得【论辩】效果, 造成的伤害提高36%, 追加攻击无视目标24%的防御力, 该效果持续2回合。
return True
async def weapon_ability(
@ -2282,23 +2283,36 @@ class BaptismofPureThought(BaseWeapon):
critical_damage_base = attribute_bonus.get("CriticalDamageBase", 0)
attribute_bonus["CriticalDamageBase"] = (
critical_damage_base
+ (weapon_effect["23020"]["Param"]["CriticalDamageBase"][self.weapon_rank - 1])
+ (
weapon_effect["23020"]["Param"]["CriticalDamageBase"][
self.weapon_rank - 1
]
)
* 3
)
all_damage_added_ratio = attribute_bonus.get("AllDamageAddedRatio", 0)
attribute_bonus["AllDamageAddedRatio"] = (
all_damage_added_ratio
+ (weapon_effect["23020"]["Param"]["AllDamageAddedRatio"][self.weapon_rank - 1])
+ (
weapon_effect["23020"]["Param"]["AllDamageAddedRatio"][
self.weapon_rank - 1
]
)
)
resistance_penetration = attribute_bonus.get("Talentignore_defence", 0)
attribute_bonus["Talentignore_defence"] = (
resistance_penetration
+ (weapon_effect["23020"]["Param"]["ignore_defence"][self.weapon_rank - 1])
+ (
weapon_effect["23020"]["Param"]["ignore_defence"][
self.weapon_rank - 1
]
)
)
return attribute_bonus
# 镜中故我
class PastSelfinMirror(BaseWeapon):
weapon_base_attributes: Dict
@ -2307,7 +2321,7 @@ class PastSelfinMirror(BaseWeapon):
super().__init__(weapon)
async def check(self):
# 装备者施放终结技后使我方全体造成的伤害提高40%持续3回合
# 装备者施放终结技后, 使我方全体造成的伤害提高40%, 持续3回合
return True
async def weapon_ability(
@ -2320,10 +2334,15 @@ class PastSelfinMirror(BaseWeapon):
all_damage_added_ratio = attribute_bonus.get("AllDamageAddedRatio", 0)
attribute_bonus["AllDamageAddedRatio"] = (
all_damage_added_ratio
+ (weapon_effect["23019"]["Param"]["AllDamageAddedRatio"][self.weapon_rank - 1])
+ (
weapon_effect["23019"]["Param"]["AllDamageAddedRatio"][
self.weapon_rank - 1
]
)
)
return attribute_bonus
class Weapon:
@classmethod
def create(cls, weapon: DamageInstanceWeapon):