添加黑天鹅伤害计算

This commit is contained in:
a376148946 2024-02-16 13:32:36 +08:00
parent 6e7f8ac0ca
commit 2077e86f50
4 changed files with 275 additions and 2 deletions

View File

@ -1086,7 +1086,6 @@ class Kafka(BaseAvatar):
skill_multiplier, skill_multiplier,
self.avatar_level, self.avatar_level,
) )
damagelist4[2] += damage3
skill_info_list.append({"name": "单次持续伤害", "damagelist": damagelist4}) skill_info_list.append({"name": "单次持续伤害", "damagelist": damagelist4})
# 计算追加攻击伤害 # 计算追加攻击伤害
@ -1971,7 +1970,6 @@ class Guinaifen(BaseAvatar):
skill_multiplier, skill_multiplier,
self.avatar_level, self.avatar_level,
) )
damagelist4[2] += damage3
skill_info_list.append({"name": "单次持续伤害", "damagelist": damagelist4}) skill_info_list.append({"name": "单次持续伤害", "damagelist": damagelist4})
return skill_info_list return skill_info_list
@ -4699,6 +4697,129 @@ class XueYi(BaseAvatar):
return skill_info_list return skill_info_list
class BlackSwan(BaseAvatar):
Buff: BaseAvatarBuff
def __init__(self, char: DamageInstanceAvatar, skills: List[DamageInstanceSkill]):
super().__init__(char=char, skills=skills)
self.eidolon_attribute: Dict[str, float] = {}
self.extra_ability_attribute: Dict[str, float] = {}
self.eidolons()
self.extra_ability()
def Technique(self):
pass
def eidolons(self):
if self.avatar_rank >= 1:
self.eidolon_attribute["WindResistancePenetration"] = 0.25
self.eidolon_attribute["PhysicalResistancePenetration"] = 0.25
self.eidolon_attribute["FireResistancePenetration"] = 0.25
self.eidolon_attribute["ThunderResistancePenetration"] = 0.25
def extra_ability(self):
#战技降防计算
bpskill_defence = self.Skill_num("BPSkill", "BPSkill_D")
self.extra_ability_attribute["ignore_defence"] = bpskill_defence
#终结技加伤害
self.extra_ability_attribute["AllDamageAddedRatio"] = self.Skill_num("Ultra", "Ultra_A")
async def getdamage(
self,
base_attr: Dict[str, float],
attribute_bonus: Dict[str, float],
):
# 使自身造成的伤害提高提高数值等同于效果命中的60%最多使造成的伤害提高72%。
Break_Damage_Added_Ratio = attribute_bonus.get("StatusProbabilityBase", 0) * 0.6
attribute_bonus["AllDamageAddedRatio"] = attribute_bonus.get(
"AllDamageAddedRatio", 0
) + min(0.72, Break_Damage_Added_Ratio)
damage1, damage2, damage3 = await calculate_damage(
base_attr,
attribute_bonus,
"fujia",
"fujia",
"Thunder",
0.44,
self.avatar_level,
)
skill_info_list = []
# 计算普攻伤害
skill_multiplier = self.Skill_num("Normal", "Normal")
damagelist1 = await calculate_damage(
base_attr,
attribute_bonus,
"Normal",
"Normal",
self.avatar_element,
skill_multiplier,
self.avatar_level,
)
damagelist1[2] += damage3
skill_info_list.append({"name": "普攻", "damagelist": damagelist1})
# 计算战技伤害
skill_multiplier = self.Skill_num("BPSkill", "BPSkill")
damagelist2 = await calculate_damage(
base_attr,
attribute_bonus,
"BPSkill",
"BPSkill",
self.avatar_element,
skill_multiplier,
self.avatar_level,
)
damagelist2[2] += damage3
skill_info_list.append({"name": "战技", "damagelist": damagelist2})
# 计算终结技伤害
skill_multiplier = self.Skill_num("Ultra", "Ultra")
damagelist3 = await calculate_damage(
base_attr,
attribute_bonus,
"Ultra",
"Ultra",
self.avatar_element,
skill_multiplier,
self.avatar_level,
)
damagelist3[2] += damage3
skill_info_list.append({"name": "终结技", "damagelist": damagelist3})
# 计算1层奥迹持续伤害
skill_multiplier = self.Skill_num("Talent", "Talent")
skill_multiplier += self.Skill_num("Talent", "Talent_UP")
damagelist4 = await calculate_damage(
base_attr,
attribute_bonus,
"DOT",
"DOT",
self.avatar_element,
skill_multiplier,
self.avatar_level,
)
skill_info_list.append({"name": "1层奥迹伤害", "damagelist": damagelist4})
# 计算50层奥迹持续伤害
skill_multiplier = self.Skill_num("Talent", "Talent")
skill_multiplier += self.Skill_num("Talent", "Talent_UP") * 50
add_attr_bonus = copy.deepcopy(attribute_bonus)
add_attr_bonus["ignore_defence"] = (
add_attr_bonus.get("ignore_defence", 0) + 0.2
)
damagelist5 = await calculate_damage(
base_attr,
add_attr_bonus,
"DOT",
"DOT",
self.avatar_element,
skill_multiplier,
self.avatar_level,
)
skill_info_list.append({"name": "50层奥迹伤害", "damagelist": damagelist5})
return skill_info_list
class AvatarDamage: class AvatarDamage:
@classmethod @classmethod
@ -4707,6 +4828,8 @@ class AvatarDamage:
return XueYi(char, skills) return XueYi(char, skills)
if char.id_ == 1303: if char.id_ == 1303:
return RuanMei(char, skills) return RuanMei(char, skills)
if char.id_ == 1307:
return BlackSwan(char, skills)
if char.id_ == 1305: if char.id_ == 1305:
return DrRatio(char, skills) return DrRatio(char, skills)
if char.id_ == 1215: if char.id_ == 1215:

View File

@ -1205,5 +1205,56 @@
], ],
"Maze": [20], "Maze": [20],
"Ultra_Use": [120] "Ultra_Use": [120]
},
"1307": {
"Normal": [
0.3000000002793968, 0.3600000003352761, 0.4200000003911555,
0.48000000044703484, 0.5400000005029142, 0.6000000005587935,
0.6600000006146729, 0.7200000006705523, 0.7800000007264316
],
"BPSkill": [
0.45000000041909516, 0.4950000001117587, 0.5400000005029142,
0.5850000001955777, 0.6300000005867332, 0.6750000002793968,
0.7312500011175871, 0.7875000005587935, 0.8437500013969839,
0.9000000008381903, 0.9450000005308539, 0.9900000009220093,
1.0349999996833503, 1.0800000000745058, 1.1249999997671694
],
"BPSkill_D": [
0.1479999995790422, 0.1539999998640269, 0.1600000001490116,
0.1659999997355044, 0.1720000000204891, 0.17799999960698187,
0.18550000013783574, 0.19299999997019768, 0.20050000050105155,
0.20799999963492155, 0.21399999991990626, 0.22000000020489097,
0.22599999979138374, 0.23200000007636845, 0.23799999966286123
],
"Ultra_A": [
0.1500000001396984, 0.1600000001490116, 0.17000000015832484,
0.18000000016763806, 0.1900000001769513, 0.20000000018626451,
0.21250000037252903, 0.2249999998603016, 0.23750000004656613,
0.25000000023283064, 0.26000000024214387, 0.2700000002514571,
0.2800000002607703, 0.29000000027008355, 0.3000000002793968
],
"Ultra": [
0.7200000006705523, 0.7680000001564622, 0.8160000003408641,
0.8640000005252659, 0.9120000007096678, 0.9600000008940697,
1.0200000000186265, 1.0800000000745058, 1.1400000001303852,
1.2000000001862645, 1.2479999996721745, 1.2959999998565763,
1.3440000000409782, 1.39200000022538, 1.440000000409782
],
"Talent": [
0.9600000008940697, 1.1183999998029321, 1.2768000003416091,
1.4352000001817942, 1.5936000007204711, 1.7520000005606562,
1.8960000004153699, 2.040000000037253, 2.220000000204891,
2.400000000372529, 2.5200000004842877, 2.6400000005960464,
2.760000000707805, 2.880000000819564, 3
],
"Talent_UP": [
0.04799999948590994, 0.0559200004208833, 0.06384000065736473,
0.07176000089384615, 0.07968000043183565, 0.08759999996982515,
0.0948000003118068, 0.10199999995529652, 0.11100000003352761,
0.12000000011175871, 0.12599999969825149, 0.1319999999832362,
0.13799999956972897, 0.14399999985471368, 0.1500000001396984
],
"Maze": [20],
"Ultra_Use": [120]
} }
} }

View File

@ -438,6 +438,30 @@
] ]
} }
}, },
"23021": {
"Param": {
"CriticalDamageBase": [
0.2800000002607703, 0.3500000003259629, 0.4200000003911555,
0.49000000045634806, 0.5600000005215406
],
"CriticalChance": [
0.10000000009313226, 0.11000000010244548, 0.12000000011175871,
0.13000000012107193, 0.14000000013038516
]
}
},
"23022": {
"Param": {
"AttackAddedRatio": [
0.05000000004656613, 0.060000000055879354, 0.07000000006519258,
0.0800000000745058, 0.09000000008381903
],
"ignore_defence": [
0.07199999992735684, 0.07899999944493175, 0.08599999966099858,
0.09299999987706542, 0.10000000009313226
]
}
},
"21032": { "21032": {
"Param": { "Param": {
"AttackAddedRatio": [ "AttackAddedRatio": [

View File

@ -2342,12 +2342,87 @@ class PastSelfinMirror(BaseWeapon):
) )
return attribute_bonus return attribute_bonus
# 游戏尘寰
class EarthlyEscapade(BaseWeapon):
weapon_base_attributes: Dict
def __init__(self, weapon: DamageInstanceWeapon):
super().__init__(weapon)
async def check(self):
# 战斗开始时使装备者获得【假面】持续3回合。当装备者持有【假面】时装备者的队友暴击率提高10%暴击伤害提高28%。
return True
async def weapon_ability(
self,
Ultra_Use: float,
base_attr: Dict[str, float],
attribute_bonus: Dict[str, float],
):
if await self.check():
critical_damage_base = attribute_bonus.get("CriticalDamageBase", 0)
attribute_bonus["CriticalDamageBase"] = (
critical_damage_base
+ weapon_effect["23021"]["Param"]["CriticalDamageBase"][self.weapon_rank - 1]
)
critical_chance_base = attribute_bonus.get("CriticalChanceBase", 0)
attribute_bonus["CriticalChanceBase"] = (
critical_chance_base
+ weapon_effect["23021"]["Param"]["CriticalChance"][self.weapon_rank - 1]
)
return attribute_bonus
# 重塑时光之忆
class ReforgedRemembrance(BaseWeapon):
weapon_base_attributes: Dict
def __init__(self, weapon: DamageInstanceWeapon):
super().__init__(weapon)
async def check(self):
# 装备者对陷入风化、灼烧、触电、裂伤状态的敌方目标造成伤害时分别获得1层【先知】最多叠加4层。单场战斗中每种持续伤害状态类型仅可叠加1次【先知】效果。每层【先知】使装备者的攻击力提高5%造成的持续伤害无视目标7.2%的防御力。
return True
async def weapon_ability(
self,
Ultra_Use: float,
base_attr: Dict[str, float],
attribute_bonus: Dict[str, float],
):
if await self.check():
AttackAddedRatio = attribute_bonus.get("AttackAddedRatio", 0)
attribute_bonus["AttackAddedRatio"] = (
AttackAddedRatio
+ (
weapon_effect["23022"]["Param"]["AttackAddedRatio"][
self.weapon_rank - 1
]
)
* 4
)
resistance_penetration = attribute_bonus.get("DOTignore_defence", 0)
attribute_bonus["DOTignore_defence"] = (
resistance_penetration
+ (
weapon_effect["23022"]["Param"]["ignore_defence"][
self.weapon_rank - 1
]
)
* 4
)
return attribute_bonus
class Weapon: class Weapon:
@classmethod @classmethod
def create(cls, weapon: DamageInstanceWeapon): def create(cls, weapon: DamageInstanceWeapon):
if weapon.id_ == 23019: if weapon.id_ == 23019:
return PastSelfinMirror(weapon) return PastSelfinMirror(weapon)
if weapon.id_ == 23021:
return EarthlyEscapade(weapon)
if weapon.id_ == 23022:
return ReforgedRemembrance(weapon)
if weapon.id_ == 23020: if weapon.id_ == 23020:
return BaptismofPureThought(weapon) return BaptismofPureThought(weapon)
if weapon.id_ == 22001: if weapon.id_ == 22001: