添加2.0角色计算

This commit is contained in:
a376148946 2024-02-29 11:11:06 +08:00
parent 2077e86f50
commit 82442b7065
5 changed files with 520 additions and 0 deletions

View File

@ -4821,11 +4821,86 @@ class BlackSwan(BaseAvatar):
skill_info_list.append({"name": "50层奥迹伤害", "damagelist": damagelist5})
return skill_info_list
class Sparkle(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):
pass
def extra_ability(self):
self.extra_ability_attribute["AttackAddedRatio"] = 0.45
async def getdamage(
self,
base_attr: Dict[str, float],
attribute_bonus: Dict[str, float],
):
# 终结技天赋增加伤害
All_Damage_Add = (self.Skill_num("Talent", "Talent") + self.Skill_num("Ultra", "Ultra")) * 3
attribute_bonus["AllDamageAddedRatio"] = attribute_bonus.get(
"AllDamageAddedRatio", 0
) + All_Damage_Add
#战技增加暴击伤害
if self.avatar_rank >= 6:
add_critical_damage_base = attribute_bonus.get("CriticalDamageBase", 0) * (self.Skill_num("BPSkill", "BPSkill") + 0.3) + self.Skill_num("BPSkill", "BPSkill_G")
else:
add_critical_damage_base = attribute_bonus.get("CriticalDamageBase", 0) * self.Skill_num("BPSkill", "BPSkill") + self.Skill_num("BPSkill", "BPSkill_G")
attribute_bonus["CriticalDamageBase"] = (
attribute_bonus.get("CriticalDamageBase", 0) + add_critical_damage_base
)
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})
# 计算终结技
critical_damage_base_str = add_critical_damage_base * 100
damagelist2 = []
damagelist2.append(critical_damage_base_str)
skill_info_list.append({"name": "战技提升爆伤(%)", "damagelist": damagelist2})
return skill_info_list
class AvatarDamage:
@classmethod
def create(cls, char: DamageInstanceAvatar, skills: List[DamageInstanceSkill]):
if char.id_ == 1214:
return XueYi(char, skills)
if char.id_ == 1306:
return Sparkle(char, skills)
if char.id_ == 1303:
return RuanMei(char, skills)
if char.id_ == 1307:

View File

@ -1256,5 +1256,42 @@
],
"Maze": [20],
"Ultra_Use": [120]
},
"1306": {
"Normal": [
0.5000000004656613, 0.6000000005587935, 0.7000000006519258,
0.8000000007450581, 0.9000000008381903, 1.0000000000931323,
1.1000000000931323, 1.2000000001862645, 1.3000000002793968
],
"BPSkill": [
0.12000000011175871, 0.1319999999832362, 0.14399999985471368,
0.15599999972619116, 0.16799999959766865, 0.18000000016763806,
0.19499999983236194, 0.21000000019557774, 0.2249999998603016,
0.24000000022351742, 0.2520000000949949, 0.2639999999664724,
0.27599999983794987, 0.28799999970942736, 0.3000000002793968
],
"BPSkill_G": [
0.2700000002514571, 0.28799999970942736, 0.30599999986588955,
0.32400000002235174, 0.34200000017881393, 0.3600000003352761,
0.38250000053085387, 0.4050000000279397, 0.4275000002235174,
0.45000000041909516, 0.4679999998770654, 0.4860000000335276,
0.5040000001899898, 0.522000000346452, 0.5400000005029142
],
"Ultra": [
0.060000000055879354, 0.06399999978020787, 0.06799999950453639,
0.07199999992735684, 0.07599999965168536, 0.0800000000745058,
0.08499999972991645, 0.09000000008381903, 0.09499999973922968,
0.10000000009313226, 0.10399999981746078, 0.1079999995417893,
0.11199999996460974, 0.11599999968893826, 0.12000000011175871
],
"Talent": [
0.030000000027939677, 0.032999999821186066, 0.035999999614432454,
0.03899999940767884, 0.04199999989941716, 0.04499999969266355,
0.04875000030733645, 0.05250000022351742, 0.056250000139698386,
0.060000000055879354, 0.06299999984912574, 0.06599999964237213,
0.06899999943561852, 0.07199999992735684, 0.07499999972060323
],
"Maze": [20],
"Ultra_Use": [120]
}
}

View File

@ -591,6 +591,78 @@
]
}
},
"21036": {
"Param": {
"AllDamageAddedRatio": [
0.12000000011175871, 0.14000000013038516, 0.1600000001490116,
0.18000000016763806, 0.20000000018626451
]
}
},
"21038": {
"Param": {
"AllDamageAddedRatio": [
0.25000000023283064, 0.3125000004656613, 0.375,
0.43750000023283064, 0.5000000004656613
]
}
},
"21043": {
"Param": {
"AllDamageAddedRatio": [
0.0400000000372529, 0.05000000004656613, 0.060000000055879354,
0.07000000006519258, 0.0800000000745058
]
}
},
"21039": {
"Param": {
"AllDamageAddedRatio": [
0.007999999448657036, 0.008999999379739165, 0.010000000009313226,
0.010999999940395355, 0.011999999871477485
],
"AllDamageAddedRatio_max": [
0.3200000002980232, 0.3600000003352761, 0.40000000037252903,
0.44000000040978193, 0.48000000044703484
]
}
},
"21041": {
"Param": {
"AllDamageAddedRatio": [
0.060000000055879354, 0.07000000006519258, 0.0800000000745058,
0.09000000008381903, 0.10000000009313226
],
"AttackAddedRatio": [
0.20000000018626451, 0.24000000022351742, 0.2800000002607703,
0.3200000002980232, 0.3600000003352761
]
}
},
"21037": {
"Param": {
"CriticalDamageBase": [
0.0800000000745058, 0.09000000008381903, 0.10000000009313226,
0.11000000010244548, 0.12000000011175871
]
}
},
"21042": {
"Param": {
"CriticalChanceBase": [
0.1500000001396984, 0.1875, 0.2249999998603016,
0.26250000041909516, 0.3000000002793968
]
}
},
"21040": {
"Param": {
"CriticalDamageBase": [
0.20000000018626451, 0.25000000023283064, 0.3000000002793968,
0.3500000003259629, 0.40000000037252903
]
}
},
"23012": {
"Param": {
"CriticalChance": [

View File

@ -428,6 +428,57 @@ class Relic116(BaseRelicSetSkill):
attribute_bonus["ignore_defence"] = ignore_defence + 0.06000000009313226 * 3
return attribute_bonus
class Relic117(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],
):
"""2件: 对受负面状态影响的敌人造成的伤害提高12%"""
# 暴击率提高4%装备者对陷入不少于2/3个负面效果的敌方目标造成的暴击伤害提高8%/12%。装备者对敌方目标施加负面效果后上述效果提高100%持续1回合
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 and await self.check(base_attr, attribute_bonus):
All_Damage_Added_Ratio = attribute_bonus.get("AllDamageAddedRatio", 0)
attribute_bonus["AllDamageAddedRatio"] = All_Damage_Added_Ratio + 0.12000000011175871
if self.pieces4 and await self.check(base_attr, attribute_bonus):
Critical_Damage_Base = attribute_bonus.get("CriticalDamageBase", 0)
attribute_bonus["CriticalDamageBase"] = Critical_Damage_Base + 0.12000000011175871 * 2
return attribute_bonus
class Relic118(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],
):
"""当装备者对我方目标施放终结技时我方全体击破特攻提高30%持续2回合该效果无法叠加。"""
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):
Break_Damage_Added_Ratio_Base = attribute_bonus.get("BreakDamageAddedRatioBase", 0)
attribute_bonus["BreakDamageAddedRatioBase"] = Break_Damage_Added_Ratio_Base + 0.3000000002793968
return attribute_bonus
class Relic301(BaseRelicSetSkill):
def __init__(self, set_id: int, count: int):
@ -806,6 +857,8 @@ class RelicSet:
Relic114,
Relic115,
Relic116,
Relic117,
Relic118,
Relic301,
Relic302,
Relic303,
@ -890,6 +943,10 @@ class RelicSet:
self.SetSkill.append(Relic115(set_id, count))
elif set_id == 116:
self.SetSkill.append(Relic116(set_id, count))
elif set_id == 117:
self.SetSkill.append(Relic117(set_id, count))
elif set_id == 118:
self.SetSkill.append(Relic118(set_id, count))
elif set_id == 301:
self.SetSkill.append(Relic301(set_id, count))
elif set_id == 302:

View File

@ -2414,6 +2414,267 @@ class ReforgedRemembrance(BaseWeapon):
)
return attribute_bonus
# 何物为真
class WhatIsReal(BaseWeapon):
weapon_base_attributes: Dict
def __init__(self, weapon: DamageInstanceWeapon):
super().__init__(weapon)
async def check(self):
# 施放普攻后装备者回复等同于2%生命上限+800点的生命值。
pass
async def weapon_ability(
self,
Ultra_Use: float,
base_attr: Dict[str, float],
attribute_bonus: Dict[str, float],
):
return attribute_bonus
# 美梦小镇大冒险
class DreamvilleAdventure(BaseWeapon):
weapon_base_attributes: Dict
def __init__(self, weapon: DamageInstanceWeapon):
super().__init__(weapon)
async def check(self):
# 装备者施放普攻、战技、终结技中某一类型的技能后为我方全体附加【童心】【童心】可以使我方目标对应类型的技能所造成的伤害提高12%
return True
async def weapon_ability(
self,
Ultra_Use: float,
base_attr: Dict[str, float],
attribute_bonus: Dict[str, float],
):
if await self.check():
all_damage_added_ratio = attribute_bonus.get("AllDamageAddedRatio", 0)
attribute_bonus["AllDamageAddedRatio"] = (
all_damage_added_ratio
+ (
weapon_effect["21036"]["Param"]["AllDamageAddedRatio"][
self.weapon_rank - 1
]
)
)
return attribute_bonus
# 最后的赢家
class FinalVictor(BaseWeapon):
weapon_base_attributes: Dict
def __init__(self, weapon: DamageInstanceWeapon):
super().__init__(weapon)
async def check(self):
# 当装备者对敌方目标造成暴击后获得一层【好运】最多叠加4层。每层【好运】使装备者的暴击伤害提高8%
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["21037"]["Param"]["CriticalDamageBase"][
self.weapon_rank - 1
]
* 4
)
)
return attribute_bonus
# 在火的远处
class FlamesAfar(BaseWeapon):
weapon_base_attributes: Dict
def __init__(self, weapon: DamageInstanceWeapon):
super().__init__(weapon)
async def check(self):
# 使装备者造成的伤害提高25%
return True
async def weapon_ability(
self,
Ultra_Use: float,
base_attr: Dict[str, float],
attribute_bonus: Dict[str, float],
):
if await self.check():
all_damage_added_ratio = attribute_bonus.get("AllDamageAddedRatio", 0)
attribute_bonus["AllDamageAddedRatio"] = (
all_damage_added_ratio
+ (
weapon_effect["21038"]["Param"]["AllDamageAddedRatio"][
self.weapon_rank - 1
]
)
)
return attribute_bonus
# 织造命运之线
class DestinysThreadsForewoven(BaseWeapon):
weapon_base_attributes: Dict
def __init__(self, weapon: DamageInstanceWeapon):
super().__init__(weapon)
async def check(self):
# 装备者每有100点防御力使装备者造成的伤害提高0.8%最多使造成的伤害提高32%。
return True
async def weapon_ability(
self,
Ultra_Use: float,
base_attr: Dict[str, float],
attribute_bonus: Dict[str, float],
):
if await self.check():
defence = base_attr["defence"] * (1 + attribute_bonus["DefenceAddedRatio"]) + attribute_bonus["DefenceDelta"]
damage_added = (defence/100) * weapon_effect["21039"]["Param"]["AllDamageAddedRatio"][self.weapon_rank - 1]
damage_added = min(damage_added, weapon_effect["21039"]["Param"]["AllDamageAddedRatio_max"][self.weapon_rank - 1])
all_damage_added_ratio = attribute_bonus.get("AllDamageAddedRatio", 0)
attribute_bonus["AllDamageAddedRatio"] = all_damage_added_ratio + damage_added
return attribute_bonus
# 银河沦陷日
class TheDayTheCosmosFell(BaseWeapon):
weapon_base_attributes: Dict
def __init__(self, weapon: DamageInstanceWeapon):
super().__init__(weapon)
async def check(self):
# 装备者施放攻击后若有不少于2个被攻击的敌方目标具有对应属性弱点装备者的暴击伤害提高20%持续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():
Critical_Damage_Base = attribute_bonus.get("CriticalDamageBase", 0)
attribute_bonus["CriticalDamageBase"] = (
Critical_Damage_Base
+ (
weapon_effect["21040"]["Param"]["CriticalDamageBase"][
self.weapon_rank - 1
]
)
)
return attribute_bonus
# 好戏开演
class ItsShowtime(BaseWeapon):
weapon_base_attributes: Dict
def __init__(self, weapon: DamageInstanceWeapon):
super().__init__(weapon)
async def check(self):
# 装备者对敌方目标施加负面状态后获得一层【戏法】每层【戏法】使装备者造成的伤害提高6%最多叠加3层持续1回合。当装备者的效果命中大于等于80%时攻击力提高20%。
return True
async def weapon_ability(
self,
Ultra_Use: float,
base_attr: Dict[str, float],
attribute_bonus: Dict[str, float],
):
if await self.check():
all_damage_added_ratio = attribute_bonus.get("AllDamageAddedRatio", 0)
attribute_bonus["AllDamageAddedRatio"] = (
all_damage_added_ratio
+ (
weapon_effect["21041"]["Param"]["AllDamageAddedRatio"][
self.weapon_rank - 1
]
* 3
)
)
Status_Probability_Base = attribute_bonus.get("StatusProbabilityBase", 0)
if Status_Probability_Base >= 0.8:
Attack_Added_Ratio = attribute_bonus.get("AttackAddedRatio", 0)
attribute_bonus["AttackAddedRatio"] = (
Attack_Added_Ratio
+ (
weapon_effect["21041"]["Param"]["AttackAddedRatio"][
self.weapon_rank - 1
]
)
)
return attribute_bonus
# 铭记于心的约定
class IndeliblePromise(BaseWeapon):
weapon_base_attributes: Dict
def __init__(self, weapon: DamageInstanceWeapon):
super().__init__(weapon)
async def check(self):
# 当装备者释放终结技时暴击率提高15%持续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():
Critical_Chance_Base = attribute_bonus.get("CriticalChanceBase", 0)
attribute_bonus["CriticalChanceBase"] = (
Critical_Chance_Base
+ (
weapon_effect["21042"]["Param"]["CriticalChanceBase"][
self.weapon_rank - 1
]
)
)
return attribute_bonus
# 两个人的演唱会
class ConcertforTwo(BaseWeapon):
weapon_base_attributes: Dict
def __init__(self, weapon: DamageInstanceWeapon):
super().__init__(weapon)
async def check(self):
# 场上每有一名持有护盾的角色装备者造成的伤害提高4%。
return True
async def weapon_ability(
self,
Ultra_Use: float,
base_attr: Dict[str, float],
attribute_bonus: Dict[str, float],
):
if await self.check():
all_damage_added_ratio = attribute_bonus.get("AllDamageAddedRatio", 0)
attribute_bonus["AllDamageAddedRatio"] = (
all_damage_added_ratio
+ (
weapon_effect["21043"]["Param"]["AllDamageAddedRatio"][
self.weapon_rank - 1
]
* 2
)
)
return attribute_bonus
class Weapon:
@classmethod
def create(cls, weapon: DamageInstanceWeapon):
@ -2421,6 +2682,24 @@ class Weapon:
return PastSelfinMirror(weapon)
if weapon.id_ == 23021:
return EarthlyEscapade(weapon)
if weapon.id_ == 21035:
return WhatIsReal(weapon)
if weapon.id_ == 21036:
return DreamvilleAdventure(weapon)
if weapon.id_ == 21037:
return FinalVictor(weapon)
if weapon.id_ == 21038:
return FlamesAfar(weapon)
if weapon.id_ == 21039:
return DestinysThreadsForewoven(weapon)
if weapon.id_ == 21040:
return TheDayTheCosmosFell(weapon)
if weapon.id_ == 21041:
return ItsShowtime(weapon)
if weapon.id_ == 21042:
return IndeliblePromise(weapon)
if weapon.id_ == 21043:
return ConcertforTwo(weapon)
if weapon.id_ == 23022:
return ReforgedRemembrance(weapon)
if weapon.id_ == 23020: