完善伤害计算防御光锥,模拟宇宙bug修改 (#71)

* 完善伤害计算防御光锥,模拟宇宙bug修改

* 🚨 `pre-commit-ci`修复格式错误

* 伤害计算完善存护光锥

* 完成杰帕德计算

* 🚨 `pre-commit-ci`修复格式错误

* 更新饮月君别称map

* 修复克拉拉专武战斗未生效bug

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
This commit is contained in:
季落 2023-09-08 12:12:23 +08:00 committed by GitHub
parent 7e12552b96
commit 8acd99e518
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
9 changed files with 730 additions and 10 deletions

View File

@ -89,7 +89,7 @@ async def draw_char_info_img(raw_mes: str, sr_uid: str):
return char_data
char = await cal_char_info(char_data)
damage_len = 0
if char.char_id in [1102, 1204, 1107, 1213, 1006, 1005, 1205, 1208]:
if char.char_id in [1102, 1204, 1107, 1213, 1006, 1005, 1205, 1208, 1104]:
skill_list = skill_dict[str(char.char_id)]['skilllist']
damage_len = len(skill_list)
# print(damage_len)
@ -727,7 +727,7 @@ async def cal(char_data: Dict):
char = await cal_char_info(char_data)
skill_info_list = []
if char.char_id in [1102, 1204, 1107, 1213, 1006, 1005, 1205, 1208]:
if char.char_id in [1102, 1204, 1107, 1213, 1006, 1005, 1205, 1208, 1104]:
if char.char_id == 1213:
for skill_type in [
'Normal',

View File

@ -238,11 +238,35 @@ class Fuxuan(BaseAvatar):
pass
class Gepard(BaseAvatar):
Buff: BaseAvatarBuff
def __init__(
self, char: DamageInstanceAvatar, skills: List[DamageInstanceSkill]
):
super().__init__(char=char, skills=skills)
self.eidolon_attribute = {}
self.extra_ability_attribute = {}
self.eidolons()
self.extra_ability()
def Technique(self):
pass
def eidolons(self):
pass
def extra_ability(self):
pass
class Avatar:
@classmethod
def create(
cls, char: DamageInstanceAvatar, skills: List[DamageInstanceSkill]
):
if char.id_ == 1104:
return Gepard(char, skills)
if char.id_ == 1208:
return Fuxuan(char, skills)
if char.id_ == 1205:

View File

@ -788,5 +788,80 @@
"Normal": ["attack","普攻", 1],
"Ultra": ["attack","终结技", 1]
}
},
"1104": {
"Normal": [
0.5000000004656613,
0.6000000005587935,
0.7000000006519258,
0.8000000007450581,
0.9000000008381903,
1.0000000000931323,
1.1000000001862645,
1.2000000002793968,
1.3000000002793968
],
"BPSkill": [
1.0000000004656613,
1.1000000004656613,
1.2000000005587935,
1.3000000003725290,
1.4000000003725290,
1.5000000003725290,
1.6250000003725290,
1.7500000003725290,
1.8750000003725290,
2.0000000003725290,
2.1000000003725290,
2.2000000003725290,
2.3000000003725290,
2.4000000003725290,
2.5000000003725290
],
"Ultra": [
0.3000000003725290,
0.3188000003725290,
0.3375000003725290,
0.3563000003725290,
0.3750000003725290,
0.3900000003725290,
0.4050000003725290,
0.4200000003725290,
0.4350000003725290,
0.4500000003725290,
0.4650000003725290,
0.4800000003725290,
0.4950000003725290,
0.5100000003725290,
0.5250000003725290
],
"Ultra_G": [
150,
240,
308,
375,
420,
465,
499,
533,
566,
600,
634,
668,
701,
735,
769
],
"Maze": [
20
],
"Ultra_Use": [
110
],
"skilllist": {
"Normal": ["attack","一意之拳(普攻)", 1],
"BPSkill": ["attack","震慑之击(战技)", 1],
"Ultra": ["defence","永屹之壁(护盾)", 1]
}
}
}

View File

@ -145,6 +145,24 @@
0.80000000044703484
]
}
},
"20002": {
"Param": {
"a_dmg": [
0.20000000022351742,
0.2500000002793968,
0.3000000003352761,
0.3500000003911555,
0.40000000044703484
],
"e_dmg": [
0.20000000022351742,
0.2500000002793968,
0.3000000003352761,
0.3500000003911555,
0.40000000044703484
]
}
},
"21006": {
"Param": {
@ -167,6 +185,39 @@
0.80000000044703484
]
}
},
"20011": {
"Param": {
"AllDamageAddedRatio": [
0.24000000022351742,
0.3000000002793968,
0.3600000003352761,
0.4200000003911555,
0.48000000044703484
]
}
},
"20004": {
"Param": {
"StatusProbability": [
0.20000000022351742,
0.2500000002793968,
0.3000000003352761,
0.3500000003911555,
0.40000000044703484
]
}
},
"20020": {
"Param": {
"A3_AttackAddedRatio": [
0.24000000022351742,
0.3000000002793968,
0.3600000003352761,
0.4200000003911555,
0.48000000044703484
]
}
},
"21013": {
"Param": {
@ -178,6 +229,17 @@
0.64000000044703484
]
}
},
"20006": {
"Param": {
"r_dmg": [
0.28000000022351742,
0.3500000002793968,
0.4200000003352761,
0.4900000003911555,
0.56000000044703484
]
}
},
"20014": {
"Param": {
@ -240,6 +302,28 @@
0.15000000044703484
]
}
},
"23005": {
"Param": {
"DefenceAddedRatio": [
0.2400000000745058,
0.28000000009313226,
0.32000000011175871,
0.36000000013038516,
0.4000000001490116
]
}
},
"20003": {
"Param": {
"DefenceAddedRatio": [
0.1600000000745058,
0.20000000009313226,
0.24000000011175871,
0.28000000013038516,
0.3200000001490116
]
}
},
"21022": {
"Param": {
@ -359,6 +443,17 @@
0.30000000044703484
]
}
},
"20016": {
"Param": {
"CriticalChance": [
0.12000000022351742,
0.1500000002793968,
0.1800000003352761,
0.2100000003911555,
0.24000000044703484
]
}
},
"21005": {
"Param": {
@ -424,6 +519,17 @@
0.0040000044703484
]
}
},
"20009": {
"Param": {
"AllDamageAddedRatio": [
0.2000000000745058,
0.25000000009313226,
0.30000000011175871,
0.35000000013038516,
0.4100000001490116
]
}
},
"21010": {
"Param": {
@ -456,7 +562,7 @@
},
"23002": {
"Param": {
"AttackAddedRatio": [
"AllDamageAddedRatio": [
0.2400000000745058,
0.28000000009313226,
0.32000000011175871,

View File

@ -163,7 +163,7 @@ class RoleInstance:
logger.info(f'技能区总: {skill_multiplier}')
if self.raw_data.avatar.id_ == 1208:
logger.info(f'符玄战技【穷观阵】属性加成')
logger.info('符玄战技【穷观阵】属性加成')
fx_cc_up = self.avatar.BPSkill_num('BPSkill_CC')
fx_hp_up = self.avatar.BPSkill_num('BPSkill_HP')
critical_chance_base = self.attribute_bonus.get(
@ -233,6 +233,10 @@ class RoleInstance:
skill_multiplier = skill_multiplier / skill_info[2]
logger.info(f'技能区单段: {skill_multiplier}')
attack = merged_attr['attack']
if self.raw_data.avatar.id_ == 1104:
# 杰帕德天赋加攻
defence = merged_attr['defence']
attack = attack + (defence * 0.35)
logger.info(f'攻击力: {attack}')
damage_add = 0
hp_multiplier = 0
@ -373,7 +377,8 @@ class RoleInstance:
skill_name = attr.split('_')[0]
if skill_name == skill_type:
logger.info(
f'{attr}{skill_type}{merged_attr[attr]} 爆伤加成'
f'{attr}{skill_type}'
f'{merged_attr[attr]} 爆伤加成'
)
critical_damage_base += merged_attr[attr]
critical_damage = critical_damage_base + 1
@ -492,4 +497,35 @@ class RoleInstance:
logger.info(
f'{skill_info[1]} 暴击伤害: {damage_cd_z} 期望伤害{damage_qw_z}'
)
# 技能类型为防御
if skill_info[0] == 'defence':
defence = merged_attr['defence']
logger.info(f'防御力: {defence}')
# 获取技能提供的固定护盾值
if skill_type == 'Normal':
defence_multiplier = self.avatar.Normalnum('Normal_G')
elif skill_type == 'BPSkill':
defence_multiplier = self.avatar.BPSkill_num('BPSkill_G')
elif skill_type == 'Ultra':
defence_multiplier = self.avatar.Ultra_num('Ultra_G')
elif skill_type == 'Talent':
defence_multiplier = self.avatar.Talent_num('Talent_G')
# 检查是否有护盾加成
shield_added_ratio = merged_attr.get('shield_added_ratio', 0)
shield_added = shield_added_ratio + 1
logger.info(f'护盾加成: {shield_added}')
defence_num = (
defence * skill_multiplier + defence_multiplier
) * shield_added
skill_info_list = []
skill_info_list.append(skill_info[1])
skill_info_list.append(defence_num)
skill_info_list.append(defence_num)
skill_info_list.append(defence_num)
return skill_info_list

View File

@ -1147,6 +1147,418 @@ class SheAlreadyShutHerEyes(BaseWeapon):
return attribute_bonus
# 制胜的瞬间
class MomentofVictory(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: int, base_attr: Dict, attribute_bonus: Dict
):
if await self.check():
defence_added_ratio = attribute_bonus.get('DefenceAddedRatio', 0)
attribute_bonus[
'DefenceAddedRatio'
] = defence_added_ratio + mp.mpf(
weapon_effect['23005']['Param']['DefenceAddedRatio'][
self.weapon_rank - 1
]
)
return attribute_bonus
# 记忆的质料
class TextureofMemories(BaseWeapon):
weapon_base_attributes: Dict
def __init__(self, weapon: DamageInstanceWeapon):
super().__init__(weapon)
async def check(self):
# ...
pass
async def weapon_ability(
self, Ultra_Use: int, base_attr: Dict, attribute_bonus: Dict
):
return attribute_bonus
# 这就是我啦
class ThisIsMe(BaseWeapon):
weapon_base_attributes: Dict
def __init__(self, weapon: DamageInstanceWeapon):
super().__init__(weapon)
async def check(self):
# 装备者施放终结技时造成的伤害值提高提高数值等同于装备者防御力的60%
pass
async def weapon_ability(
self, Ultra_Use: int, base_attr: Dict, attribute_bonus: Dict
):
return attribute_bonus
# 我们是地火
class WeAreWildfire(BaseWeapon):
weapon_base_attributes: Dict
def __init__(self, weapon: DamageInstanceWeapon):
super().__init__(weapon)
async def check(self):
# 战斗开始时使我方全体受到的伤害降低8%
pass
async def weapon_ability(
self, Ultra_Use: int, base_attr: Dict, attribute_bonus: Dict
):
return attribute_bonus
# 宇宙市场趋势
class TrendoftheUniversalMarket(BaseWeapon):
weapon_base_attributes: Dict
def __init__(self, weapon: DamageInstanceWeapon):
super().__init__(weapon)
async def check(self):
# 当装备者受到攻击后有100%的基础概率使敌方目标陷入灼烧状态每回合造成等同于装备者40%防御力的持续伤害
pass
async def weapon_ability(
self, Ultra_Use: int, base_attr: Dict, attribute_bonus: Dict
):
return attribute_bonus
# 朗道的选择
class LandausChoice(BaseWeapon):
weapon_base_attributes: Dict
def __init__(self, weapon: DamageInstanceWeapon):
super().__init__(weapon)
async def check(self):
# 装备者受到攻击的概率提高同时受到的伤害降低16%。
pass
async def weapon_ability(
self, Ultra_Use: int, base_attr: Dict, attribute_bonus: Dict
):
return attribute_bonus
# 余生的第一天
class DayOneofMyNewLife(BaseWeapon):
weapon_base_attributes: Dict
def __init__(self, weapon: DamageInstanceWeapon):
super().__init__(weapon)
async def check(self):
# 进入战斗后使我方全体的全属性抗性提高8%
pass
async def weapon_ability(
self, Ultra_Use: int, base_attr: Dict, attribute_bonus: Dict
):
return attribute_bonus
# 开疆
class Pioneering(BaseWeapon):
weapon_base_attributes: Dict
def __init__(self, weapon: DamageInstanceWeapon):
super().__init__(weapon)
async def check(self):
# 进入战斗后使我方全体的全属性抗性提高8%
pass
async def weapon_ability(
self, Ultra_Use: int, base_attr: Dict, attribute_bonus: Dict
):
return attribute_bonus
# 戍御
class Defense(BaseWeapon):
weapon_base_attributes: Dict
def __init__(self, weapon: DamageInstanceWeapon):
super().__init__(weapon)
async def check(self):
# 进入战斗后使我方全体的全属性抗性提高8%
pass
async def weapon_ability(
self, Ultra_Use: int, base_attr: Dict, attribute_bonus: Dict
):
return attribute_bonus
# 琥珀
class Amber(BaseWeapon):
weapon_base_attributes: Dict
def __init__(self, weapon: DamageInstanceWeapon):
super().__init__(weapon)
async def check(self):
# 当装备者当前生命值百分比小于50%时其防御力额外提高16%。
return True
async def weapon_ability(
self, Ultra_Use: int, base_attr: Dict, attribute_bonus: Dict
):
if await self.check():
defence_added_ratio = attribute_bonus.get('DefenceAddedRatio', 0)
attribute_bonus[
'DefenceAddedRatio'
] = defence_added_ratio + mp.mpf(
weapon_effect['20003']['Param']['DefenceAddedRatio'][
self.weapon_rank - 1
]
)
return attribute_bonus
# 俱殁
class MutualDemise(BaseWeapon):
weapon_base_attributes: Dict
def __init__(self, weapon: DamageInstanceWeapon):
super().__init__(weapon)
async def check(self):
# 装备者当前生命值百分比小于80%时暴击率提高12%
return True
async def weapon_ability(
self, Ultra_Use: int, base_attr: Dict, attribute_bonus: Dict
):
if await self.check():
critical_chance_base = attribute_bonus.get('CriticalChanceBase', 0)
attribute_bonus[
'CriticalChanceBase'
] = critical_chance_base + mp.mpf(
weapon_effect['20016']['Param']['CriticalChance'][
self.weapon_rank - 1
]
)
return attribute_bonus
# 乐圮
class ShatteredHome(BaseWeapon):
weapon_base_attributes: Dict
def __init__(self, weapon: DamageInstanceWeapon):
super().__init__(weapon)
async def check(self):
# 使装备者对当前生命值百分比大于50%的敌方目标造成的伤害提高20%。
return True
async def weapon_ability(
self, Ultra_Use: int, base_attr: Dict, attribute_bonus: Dict
):
if await self.check():
all_damage_added_ratio = attribute_bonus.get(
'AllDamageAddedRatio', 0
)
attribute_bonus[
'AllDamageAddedRatio'
] = all_damage_added_ratio + mp.mpf(
weapon_effect['20009']['Param']['AllDamageAddedRatio'][
self.weapon_rank - 1
]
)
return attribute_bonus
# 天倾
class CollapsingSky(BaseWeapon):
weapon_base_attributes: Dict
def __init__(self, weapon: DamageInstanceWeapon):
super().__init__(weapon)
async def check(self):
# 使装备者普攻和战技造成的伤害提高20%。
pass
async def weapon_ability(
self, Ultra_Use: int, base_attr: Dict, attribute_bonus: Dict
):
normal_dmg_add = attribute_bonus.get('NormalDmgAdd', 0)
attribute_bonus['NormalDmgAdd'] = normal_dmg_add + (
mp.mpf(
weapon_effect['20002']['Param']['a_dmg'][self.weapon_rank - 1]
)
)
bp_skill_dmg_add = attribute_bonus.get('BPSkillDmgAdd', 0)
attribute_bonus['BPSkillDmgAdd'] = bp_skill_dmg_add + (
mp.mpf(
weapon_effect['20002']['Param']['e_dmg'][self.weapon_rank - 1]
)
)
return attribute_bonus
# 匿影
class HiddenShadow(BaseWeapon):
weapon_base_attributes: Dict
def __init__(self, weapon: DamageInstanceWeapon):
super().__init__(weapon)
async def check(self):
# 施放战技后使装备者的下一次普攻对敌方目标造成等同于自身60%攻击力的附加伤害。
pass
async def weapon_ability(
self, Ultra_Use: int, base_attr: Dict, attribute_bonus: Dict
):
return attribute_bonus
# 渊环
class Loop(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: int, base_attr: Dict, attribute_bonus: Dict
):
if await self.check():
all_damage_added_ratio = attribute_bonus.get(
'AllDamageAddedRatio', 0
)
attribute_bonus[
'AllDamageAddedRatio'
] = all_damage_added_ratio + mp.mpf(
weapon_effect['20009']['Param']['AllDamageAddedRatio'][
self.weapon_rank - 1
]
)
return attribute_bonus
# 幽邃
class Void(BaseWeapon):
weapon_base_attributes: Dict
def __init__(self, weapon: DamageInstanceWeapon):
super().__init__(weapon)
async def check(self):
# 战斗开始时使装备者的效果命中提高20%持续3回合。
return True
async def weapon_ability(
self, Ultra_Use: int, base_attr: Dict, attribute_bonus: Dict
):
if await self.check():
status_probability = attribute_bonus.get(
'StatusProbabilityBase', 0
)
attribute_bonus[
'StatusProbabilityBase'
] = status_probability + mp.mpf(
weapon_effect['20004']['Param']['StatusProbability'][
self.weapon_rank - 1
]
)
return attribute_bonus
# 睿见
class Sagacity(BaseWeapon):
weapon_base_attributes: Dict
def __init__(self, weapon: DamageInstanceWeapon):
super().__init__(weapon)
async def check(self):
# 当装备者施放终结技时攻击力提高24%持续2回合。
return True
async def weapon_ability(
self, Ultra_Use: int, base_attr: Dict, attribute_bonus: Dict
):
if await self.check():
a3_attack_added_ratio = attribute_bonus.get(
'UltraAttackAddedRatio', 0
)
attribute_bonus[
'UltraAttackAddedRatio'
] = a3_attack_added_ratio + mp.mpf(
weapon_effect['20020']['Param']['A3_AttackAddedRatio'][
self.weapon_rank - 1
]
)
return attribute_bonus
# 灵钥
class Passkey(BaseWeapon):
weapon_base_attributes: Dict
def __init__(self, weapon: DamageInstanceWeapon):
super().__init__(weapon)
async def check(self):
# 使装备者施放战技后额外恢复8点能量
pass
async def weapon_ability(
self, Ultra_Use: int, base_attr: Dict, attribute_bonus: Dict
):
return attribute_bonus
# 智库
class DataBank(BaseWeapon):
weapon_base_attributes: Dict
def __init__(self, weapon: DamageInstanceWeapon):
super().__init__(weapon)
async def check(self):
# 使装备者终结技造成的伤害提高28%。
pass
async def weapon_ability(
self, Ultra_Use: int, base_attr: Dict, attribute_bonus: Dict
):
ultra_dmg_add = attribute_bonus.get('UltraDmgAdd', 0)
attribute_bonus['UltraDmgAdd'] = ultra_dmg_add + (
mp.mpf(
weapon_effect['20006']['Param']['r_dmg'][self.weapon_rank - 1]
)
)
return attribute_bonus
class Weapon:
@classmethod
def create(cls, weapon: DamageInstanceWeapon):
@ -1189,7 +1601,64 @@ class Weapon:
21015,
21008,
21001,
23005,
24002,
21030,
21023,
21016,
21009,
21002,
20017,
20010,
20003,
20016,
20009,
20002,
20018,
20011,
20004,
20020,
20013,
20006,
]:
if weapon.id_ == 20006:
return DataBank(weapon)
if weapon.id_ == 20013:
return Passkey(weapon)
if weapon.id_ == 20020:
return Sagacity(weapon)
if weapon.id_ == 20004:
return Void(weapon)
if weapon.id_ == 20011:
return Loop(weapon)
if weapon.id_ == 20018:
return HiddenShadow(weapon)
if weapon.id_ == 20002:
return CollapsingSky(weapon)
if weapon.id_ == 20009:
return ShatteredHome(weapon)
if weapon.id_ == 20016:
return MutualDemise(weapon)
if weapon.id_ == 20003:
return Amber(weapon)
if weapon.id_ == 20010:
return Defense(weapon)
if weapon.id_ == 20017:
return Pioneering(weapon)
if weapon.id_ == 21002:
return DayOneofMyNewLife(weapon)
if weapon.id_ == 21009:
return LandausChoice(weapon)
if weapon.id_ == 21016:
return TrendoftheUniversalMarket(weapon)
if weapon.id_ == 21023:
return WeAreWildfire(weapon)
if weapon.id_ == 21030:
return ThisIsMe(weapon)
if weapon.id_ == 24002:
return TextureofMemories(weapon)
if weapon.id_ == 23005:
return MomentofVictory(weapon)
if weapon.id_ == 23011:
return SheAlreadyShutHerEyes(weapon)
if weapon.id_ == 21001:

View File

@ -51,6 +51,9 @@ async def merge_attribute(base_attr: Dict, attribute_bonus: Dict) -> Dict:
elif attribute == 'Normal_buff':
attr_value = base_attr.get(attribute, 0)
merged_attr[attribute] = attr_value + attribute_bonus[attribute]
elif attribute == 'shield_added_ratio':
attr_value = base_attr.get(attribute, 0)
merged_attr[attribute] = attr_value + attribute_bonus[attribute]
else:
continue
return merged_attr

View File

@ -262,12 +262,17 @@ async def draw_rogue_img(
based_h = based_h + detail_h
# 获取查询者数据
if floor:
if floor > 6:
return '世界不能大于第世界!'
if floor > 7:
return '世界不能大于第世界!'
if floor not in detail_list:
return '你还没有挑战该模拟宇宙!'
elif raw_rogue_data['current_record']['basic']['finish_cnt'] == 0:
else:
if schedule_type == '3':
if raw_rogue_data['current_record']['basic']['finish_cnt'] == 0:
return '你还没有挑战本期模拟宇宙!\n可以使用[sr上期模拟宇宙]命令查询上期~'
else:
if raw_rogue_data['last_record']['basic']['finish_cnt'] == 0:
return '你还没有挑战上期模拟宇宙!\n可以使用[sr模拟宇宙]命令查询本期~'
# 获取背景图片各项参数
based_w = 900

View File

@ -163,7 +163,9 @@
],
"1213": [
"丹恒•饮月",
"饮月君"
"饮月君",
"饮月",
"龙丹"
],
"8000": [
"开拓者",