mirror of
https://github.com/PaiGramTeam/StarRailDamageCal.git
synced 2024-11-30 18:59:26 +00:00
添加robin伤害计算
This commit is contained in:
parent
456f521a72
commit
0405dc5c1e
@ -5273,6 +5273,104 @@ class Gallagher(BaseAvatar):
|
||||
|
||||
return skill_info_list
|
||||
|
||||
class Robin(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 >= 2:
|
||||
self.eidolon_attribute["CriticalDamageBase"] = 0.2
|
||||
if self.avatar_rank >= 6:
|
||||
self.eidolon_attribute["AllDamageResistancePenetration"] = 0.2
|
||||
|
||||
def extra_ability(self):
|
||||
pass
|
||||
|
||||
async def getdamage(
|
||||
self,
|
||||
base_attr: Dict[str, float],
|
||||
attribute_bonus: Dict[str, float],
|
||||
):
|
||||
|
||||
# 战技伤害加成
|
||||
all_damage_added_ratio = attribute_bonus.get("AllDamageAddedRatio", 0)
|
||||
attribute_bonus["AllDamageAddedRatio"] = all_damage_added_ratio + self.Skill_num("BPSkill", "BPSkill")
|
||||
|
||||
# 终结技攻击加成计算
|
||||
attack = (
|
||||
base_attr["attack"] * (1 + attribute_bonus["AttackAddedRatio"])
|
||||
+ attribute_bonus["AttackDelta"]
|
||||
)
|
||||
add_attack = (attack * self.Skill_num("Ultra", "Ultra_A")) + self.Skill_num("Ultra", "Ultra_G")
|
||||
attribute_bonus["AttackDelta"] = attribute_bonus.get("AttackDelta", 0) + add_attack
|
||||
|
||||
# 天赋爆伤加成
|
||||
Critical_Damage_Base = attribute_bonus.get("CriticalDamageBase", 0)
|
||||
attribute_bonus["CriticalDamageBase"] = Critical_Damage_Base + self.Skill_num("Talent", "Talent")
|
||||
|
||||
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_num = self.Skill_num("BPSkill", "BPSkill")
|
||||
damagelist2 = {}
|
||||
damagelist2[0] = add_attack
|
||||
skill_info_list.append({"name": "终结技攻击提高", "damagelist": damagelist2})
|
||||
|
||||
# 计算追击伤害
|
||||
skill_multiplier = self.Skill_num("Ultra", "Ultra")
|
||||
add_attr_bonus = copy.deepcopy(attribute_bonus)
|
||||
add_attr_bonus['CriticalDamageBase'] = 1
|
||||
add_attr_bonus['CriticalChanceBase'] = 0.95
|
||||
if self.avatar_rank >= 1:
|
||||
skill_multiplier = skill_multiplier + 0.72
|
||||
if self.avatar_rank >= 6:
|
||||
add_attr_bonus['CriticalDamageBase'] = 3
|
||||
damagelist4 = await calculate_damage(
|
||||
base_attr,
|
||||
add_attr_bonus,
|
||||
"Talent",
|
||||
"Talent",
|
||||
self.avatar_element,
|
||||
skill_multiplier,
|
||||
self.avatar_level,
|
||||
)
|
||||
damagelist4[2] += damage3
|
||||
skill_info_list.append({"name": "【协奏】追加伤害", "damagelist": damagelist4})
|
||||
|
||||
return skill_info_list
|
||||
|
||||
class AvatarDamage:
|
||||
@classmethod
|
||||
def create(cls, char: DamageInstanceAvatar, skills: List[DamageInstanceSkill]):
|
||||
@ -5282,6 +5380,8 @@ class AvatarDamage:
|
||||
return Sparkle(char, skills)
|
||||
if char.id_ == 1308:
|
||||
return Acheron(char, skills)
|
||||
if char.id_ == 1309:
|
||||
return Robin(char, skills)
|
||||
if char.id_ == 1303:
|
||||
return RuanMei(char, skills)
|
||||
if char.id_ == 1304:
|
||||
|
@ -1411,5 +1411,45 @@
|
||||
],
|
||||
"Maze": [20],
|
||||
"Ultra_Use": [120]
|
||||
},
|
||||
"1309": {
|
||||
"Normal": [
|
||||
0.5000000004656613, 0.6000000005587935, 0.7000000006519258,
|
||||
0.8000000007450581, 0.9000000008381903, 1.0000000000931323,
|
||||
1.1000000000931323, 1.2000000001862645, 1.3000000002793968
|
||||
],
|
||||
"BPSkill": [
|
||||
0.25000000023283064, 0.27499999990686774, 0.3000000002793968,
|
||||
0.32499999995343387, 0.3500000003259629, 0.375,
|
||||
0.4062500004656613, 0.43750000023283064, 0.46875000069849193,
|
||||
0.5000000004656613, 0.5250000001396984, 0.5500000005122274,
|
||||
0.5750000001862645, 0.6000000005587935, 0.6250000002328306
|
||||
],
|
||||
"Ultra_A": [
|
||||
0.15200000000186265, 0.159599999897182, 0.16719999979250133,
|
||||
0.1748000003863126, 0.18240000028163195, 0.1900000001769513,
|
||||
0.19949999987147748, 0.20899999956600368, 0.2184999999590218,
|
||||
0.227999999653548, 0.23560000024735928, 0.24320000014267862,
|
||||
0.2508000007364899, 0.2583999999333173, 0.26599999982863665
|
||||
],
|
||||
"Ultra_G": [
|
||||
50, 65, 80, 95, 110, 125, 144, 162, 181, 200, 215, 230, 245, 260, 275
|
||||
],
|
||||
"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.05000000004656613, 0.06499999971129, 0.0800000000745058,
|
||||
0.09499999973922968, 0.11000000010244548, 0.12499999976716936,
|
||||
0.14375000074505806, 0.1625000003259629, 0.18125000060535967,
|
||||
0.20000000018626451, 0.2149999998509884, 0.2300000002142042,
|
||||
0.24499999987892807, 0.26000000024214387, 0.27499999990686774
|
||||
],
|
||||
"Maze": [20],
|
||||
"Ultra_Use": [120]
|
||||
}
|
||||
}
|
||||
|
@ -59,6 +59,30 @@
|
||||
]
|
||||
}
|
||||
},
|
||||
"23026": {
|
||||
"Param": {
|
||||
"AttackAddedRatio": [
|
||||
0.48000000044703484, 0.5600000005215406, 0.6400000005960464,
|
||||
0.7200000006705523, 0.8000000007450581
|
||||
],
|
||||
"AllDamageAddedRatio": [
|
||||
0.24000000022351742, 0.2800000002607703, 0.3200000002980232,
|
||||
0.3600000003352761, 0.40000000037252903
|
||||
]
|
||||
}
|
||||
},
|
||||
"23027": {
|
||||
"Param": {
|
||||
"ignore_defence": [
|
||||
0.20000000018626451, 0.2300000002142042, 0.26000000024214387,
|
||||
0.29000000027008355, 0.3200000002980232
|
||||
],
|
||||
"DmgRatio": [
|
||||
0.010000000009313226, 0.011500000255182385, 0.012999999802559614,
|
||||
0.014500000048428774, 0.015999999595806003
|
||||
]
|
||||
}
|
||||
},
|
||||
"21017": {
|
||||
"Param": {
|
||||
"a_dmg": [
|
||||
@ -71,6 +95,22 @@
|
||||
]
|
||||
}
|
||||
},
|
||||
"21044": {
|
||||
"Param": {
|
||||
"CriticalDamageBase": [
|
||||
0.24000000022351742, 0.3000000002793968, 0.3600000003352761,
|
||||
0.4200000003911555, 0.48000000044703484
|
||||
]
|
||||
}
|
||||
},
|
||||
"22002": {
|
||||
"Param": {
|
||||
"AllDamageAddedRatio": [
|
||||
0.18000000016763806, 0.21000000019557774, 0.24000000022351742,
|
||||
0.2700000002514571, 0.3000000002793968
|
||||
]
|
||||
}
|
||||
},
|
||||
"23010": {
|
||||
"Param": {
|
||||
"CriticalDamageBase": [
|
||||
|
@ -2751,6 +2751,141 @@ class InherentlyUnjustDestiny(BaseWeapon):
|
||||
)
|
||||
return attribute_bonus
|
||||
|
||||
# 夜色流光溢彩
|
||||
class FlowingNightglow(BaseWeapon):
|
||||
weapon_base_attributes: Dict
|
||||
|
||||
def __init__(self, weapon: DamageInstanceWeapon):
|
||||
super().__init__(weapon)
|
||||
|
||||
async def check(self):
|
||||
# 【华彩】使装备者的攻击力提高48%,使我方全体造成的伤害提高24%,持续1回合。
|
||||
return True
|
||||
|
||||
async def weapon_ability(
|
||||
self,
|
||||
Ultra_Use: float,
|
||||
base_attr: Dict[str, float],
|
||||
attribute_bonus: Dict[str, float],
|
||||
):
|
||||
if await self.check():
|
||||
Attack_Added_Ratio = attribute_bonus.get("AttackAddedRatio", 0)
|
||||
attribute_bonus["AttackAddedRatio"] = (
|
||||
Attack_Added_Ratio
|
||||
+ (
|
||||
weapon_effect["23026"]["Param"]["AttackAddedRatio"][
|
||||
self.weapon_rank - 1
|
||||
]
|
||||
)
|
||||
)
|
||||
all_damage_added_ratio = attribute_bonus.get("AllDamageAddedRatio", 0)
|
||||
attribute_bonus["AllDamageAddedRatio"] = (
|
||||
all_damage_added_ratio
|
||||
+ (
|
||||
weapon_effect["23026"]["Param"]["AllDamageAddedRatio"][
|
||||
self.weapon_rank - 1
|
||||
]
|
||||
)
|
||||
)
|
||||
return attribute_bonus
|
||||
|
||||
# 驶向第二次生命
|
||||
class SailingTowardsASecondLife(BaseWeapon):
|
||||
weapon_base_attributes: Dict
|
||||
|
||||
def __init__(self, weapon: DamageInstanceWeapon):
|
||||
super().__init__(weapon)
|
||||
|
||||
async def check(self):
|
||||
# 造成的击破伤害无视目标20%的防御力。当装备者击中敌方目标时,使目标受到的伤害提高1%,该状态最多叠加6层
|
||||
return True
|
||||
|
||||
async def weapon_ability(
|
||||
self,
|
||||
Ultra_Use: float,
|
||||
base_attr: Dict[str, float],
|
||||
attribute_bonus: Dict[str, float],
|
||||
):
|
||||
if await self.check():
|
||||
resistance_penetration = attribute_bonus.get("ignore_defence", 0)
|
||||
attribute_bonus["ignore_defence"] = (
|
||||
resistance_penetration
|
||||
+ (
|
||||
weapon_effect["23027"]["Param"]["ignore_defence"][
|
||||
self.weapon_rank - 1
|
||||
]
|
||||
)
|
||||
)
|
||||
Dmg_Ratio = attribute_bonus.get("DmgRatio", 0)
|
||||
attribute_bonus["DmgRatio"] = (
|
||||
Dmg_Ratio
|
||||
+ (
|
||||
weapon_effect["23027"]["Param"]["DmgRatio"][
|
||||
self.weapon_rank - 1
|
||||
]
|
||||
* 6
|
||||
)
|
||||
)
|
||||
return attribute_bonus
|
||||
|
||||
# 无边曼舞
|
||||
class BoundlessChoreo(BaseWeapon):
|
||||
weapon_base_attributes: Dict
|
||||
|
||||
def __init__(self, weapon: DamageInstanceWeapon):
|
||||
super().__init__(weapon)
|
||||
|
||||
async def check(self):
|
||||
# 装备者对处于防御降低或减速状态下的敌人造成的暴击伤害提高24%。
|
||||
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["21044"]["Param"]["CriticalDamageBase"][
|
||||
self.weapon_rank - 1
|
||||
]
|
||||
)
|
||||
)
|
||||
return attribute_bonus
|
||||
|
||||
# 为了明日的旅途
|
||||
class ForTomorrowsJourney(BaseWeapon):
|
||||
weapon_base_attributes: Dict
|
||||
|
||||
def __init__(self, weapon: DamageInstanceWeapon):
|
||||
super().__init__(weapon)
|
||||
|
||||
async def check(self):
|
||||
# 装备者施放终结技后,造成的伤害提高18%
|
||||
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["22002"]["Param"]["AllDamageAddedRatio"][
|
||||
self.weapon_rank - 1
|
||||
]
|
||||
)
|
||||
)
|
||||
return attribute_bonus
|
||||
|
||||
class Weapon:
|
||||
@classmethod
|
||||
def create(cls, weapon: DamageInstanceWeapon):
|
||||
@ -2760,8 +2895,16 @@ class Weapon:
|
||||
return AlongthePassingShore(weapon)
|
||||
if weapon.id_ == 23021:
|
||||
return EarthlyEscapade(weapon)
|
||||
if weapon.id_ == 22002:
|
||||
return ForTomorrowsJourney(weapon)
|
||||
if weapon.id_ == 23023:
|
||||
return InherentlyUnjustDestiny(weapon)
|
||||
if weapon.id_ == 21044:
|
||||
return BoundlessChoreo(weapon)
|
||||
if weapon.id_ == 23026:
|
||||
return FlowingNightglow(weapon)
|
||||
if weapon.id_ == 23027:
|
||||
return SailingTowardsASecondLife(weapon)
|
||||
if weapon.id_ == 21035:
|
||||
return WhatIsReal(weapon)
|
||||
if weapon.id_ == 21036:
|
||||
|
Loading…
Reference in New Issue
Block a user