mirror of
https://github.com/baiqwerdvd/StarRailUID.git
synced 2025-05-05 19:23:45 +08:00
修改遗器评分算法
This commit is contained in:
parent
e8ce7fab47
commit
ab830a40b8
@ -19,7 +19,6 @@ from ..utils.map.SR_MAP_PATH import (
|
|||||||
RelicId2Rarity,
|
RelicId2Rarity,
|
||||||
AvatarRelicScore,
|
AvatarRelicScore,
|
||||||
avatarId2Name,
|
avatarId2Name,
|
||||||
avatarId2DamageType,
|
|
||||||
)
|
)
|
||||||
from ..utils.resource.RESOURCE_PATH import (
|
from ..utils.resource.RESOURCE_PATH import (
|
||||||
RELIC_PATH,
|
RELIC_PATH,
|
||||||
@ -488,7 +487,6 @@ async def draw_char_img(char_data: Dict, sr_uid: str, msg: str):
|
|||||||
# 主属性
|
# 主属性
|
||||||
main_value = relic['MainAffix']['Value']
|
main_value = relic['MainAffix']['Value']
|
||||||
main_name: str = relic['MainAffix']['Name']
|
main_name: str = relic['MainAffix']['Name']
|
||||||
main_property: str = relic['MainAffix']['Property']
|
|
||||||
main_level: int = relic['Level']
|
main_level: int = relic['Level']
|
||||||
|
|
||||||
if main_name in ['攻击力', '生命值', '防御力', '速度']:
|
if main_name in ['攻击力', '生命值', '防御力', '速度']:
|
||||||
@ -530,21 +528,8 @@ async def draw_char_img(char_data: Dict, sr_uid: str, msg: str):
|
|||||||
main_value,
|
main_value,
|
||||||
char.char_name,
|
char.char_name,
|
||||||
True,
|
True,
|
||||||
|
relic['Type'],
|
||||||
)
|
)
|
||||||
if main_property.__contains__('AddedRatio') and relic['Type'] == 5:
|
|
||||||
attr_name = main_property.split('AddedRatio')[0]
|
|
||||||
if attr_name == avatarId2DamageType[str(char.char_id)]:
|
|
||||||
weight_dict = {}
|
|
||||||
for item in AvatarRelicScore:
|
|
||||||
if item['role'] == char.char_name:
|
|
||||||
weight_dict = item
|
|
||||||
add_value = (
|
|
||||||
(main_value + 1)
|
|
||||||
* 1
|
|
||||||
* weight_dict.get('AttributeAddedRatio', 0)
|
|
||||||
* 10
|
|
||||||
)
|
|
||||||
single_relic_score += add_value
|
|
||||||
single_relic_score += main_value_score
|
single_relic_score += main_value_score
|
||||||
for index, i in enumerate(relic['SubAffixList']):
|
for index, i in enumerate(relic['SubAffixList']):
|
||||||
subName: str = i['Name']
|
subName: str = i['Name']
|
||||||
@ -553,7 +538,7 @@ async def draw_char_img(char_data: Dict, sr_uid: str, msg: str):
|
|||||||
subProperty = i['Property']
|
subProperty = i['Property']
|
||||||
|
|
||||||
tmp_score = await get_relic_score(
|
tmp_score = await get_relic_score(
|
||||||
subProperty, subValue, char.char_name, False
|
subProperty, subValue, char.char_name, False, relic['Type']
|
||||||
)
|
)
|
||||||
single_relic_score += tmp_score
|
single_relic_score += tmp_score
|
||||||
|
|
||||||
@ -601,13 +586,13 @@ async def draw_char_img(char_data: Dict, sr_uid: str, msg: str):
|
|||||||
relic_img, RELIC_POS[str(relic['Type'])], relic_img
|
relic_img, RELIC_POS[str(relic['Type'])], relic_img
|
||||||
)
|
)
|
||||||
relic_score += single_relic_score
|
relic_score += single_relic_score
|
||||||
if relic_score > 270:
|
if relic_score > 230:
|
||||||
relic_value_level = Image.open(TEXT_PATH / 'CommonIconSSS.png')
|
relic_value_level = Image.open(TEXT_PATH / 'CommonIconSSS.png')
|
||||||
char_info.paste(relic_value_level, (825, 963), relic_value_level)
|
char_info.paste(relic_value_level, (825, 963), relic_value_level)
|
||||||
elif relic_score > 240:
|
elif relic_score > 210:
|
||||||
relic_value_level = Image.open(TEXT_PATH / 'CommonIconSS.png')
|
relic_value_level = Image.open(TEXT_PATH / 'CommonIconSS.png')
|
||||||
char_info.paste(relic_value_level, (825, 963), relic_value_level)
|
char_info.paste(relic_value_level, (825, 963), relic_value_level)
|
||||||
elif relic_score > 200:
|
elif relic_score > 180:
|
||||||
relic_value_level = Image.open(TEXT_PATH / 'CommonIconS.png')
|
relic_value_level = Image.open(TEXT_PATH / 'CommonIconS.png')
|
||||||
char_info.paste(relic_value_level, (825, 963), relic_value_level)
|
char_info.paste(relic_value_level, (825, 963), relic_value_level)
|
||||||
elif relic_score > 150:
|
elif relic_score > 150:
|
||||||
@ -782,7 +767,7 @@ async def get_char_data(
|
|||||||
|
|
||||||
|
|
||||||
async def get_relic_score(
|
async def get_relic_score(
|
||||||
subProperty: str, subValue, char_name: str, is_main: bool
|
subProperty: str, subValue, char_name: str, is_main: bool, relicType: int
|
||||||
) -> float:
|
) -> float:
|
||||||
relic_score = 0
|
relic_score = 0
|
||||||
weight_dict = {}
|
weight_dict = {}
|
||||||
@ -791,54 +776,60 @@ async def get_relic_score(
|
|||||||
weight_dict = item
|
weight_dict = item
|
||||||
if weight_dict == {}:
|
if weight_dict == {}:
|
||||||
return 0
|
return 0
|
||||||
if subProperty == 'CriticalDamageBase':
|
if is_main:
|
||||||
add_value = (subValue + 1) * 1 * weight_dict['CriticalDamageBase'] * 10
|
if relicType in [3, 4, 5, 6]:
|
||||||
relic_score += add_value
|
if subProperty.__contains__('AddedRatio') and relicType == 5:
|
||||||
if subProperty == 'CriticalChanceBase':
|
subProperty = 'AttributeAddedRatio'
|
||||||
add_value = (subValue + 1) * 2 * weight_dict['CriticalChanceBase'] * 10
|
if weight_dict.get(subProperty, 0) > 0:
|
||||||
relic_score += add_value
|
relic_score += 5.83
|
||||||
if subProperty == 'AttackDelta' and not is_main:
|
if relicType in [3, 5]:
|
||||||
add_value = subValue * 0.3 * 0.5 * weight_dict['AttackDelta'] * 0.1
|
relic_score += 10
|
||||||
relic_score += add_value
|
else:
|
||||||
if subProperty == 'DefenceDelta' and not is_main:
|
if subProperty == 'CriticalDamageBase':
|
||||||
add_value = subValue * 0.3 * 0.5 * weight_dict['DefenceDelta'] * 0.1
|
add_value = subValue * 1 * weight_dict['CriticalDamageBase'] * 100
|
||||||
relic_score += add_value
|
relic_score += add_value
|
||||||
if subProperty == 'HPDelta' and not is_main:
|
if subProperty == 'CriticalChanceBase':
|
||||||
add_value = subValue * 0.3 * 0.5 * weight_dict['HPDelta'] * 0.1
|
add_value = subValue * 2 * weight_dict['CriticalChanceBase'] * 100
|
||||||
relic_score += add_value
|
relic_score += add_value
|
||||||
if subProperty == 'AttackAddedRatio':
|
if subProperty == 'AttackDelta':
|
||||||
add_value = (subValue + 1) * 1.5 * weight_dict['AttackAddedRatio'] * 10
|
add_value = subValue * 0.3 * 0.5 * weight_dict['AttackDelta'] * 1.0
|
||||||
relic_score += add_value
|
relic_score += add_value
|
||||||
if subProperty == 'DefenceAddedRatio':
|
if subProperty == 'DefenceDelta':
|
||||||
add_value = (
|
add_value = subValue * 0.3 * 0.5 * weight_dict['DefenceDelta'] * 1.0
|
||||||
(subValue + 1) * 1.19 * weight_dict['DefenceAddedRatio'] * 10
|
relic_score += add_value
|
||||||
)
|
if subProperty == 'HPDelta':
|
||||||
relic_score += add_value
|
add_value = subValue * 0.158 * 0.5 * weight_dict['HPDelta'] * 1.0
|
||||||
if subProperty == 'HPAddedRatio':
|
relic_score += add_value
|
||||||
add_value = (subValue + 1) * 1.5 * weight_dict['HPAddedRatio'] * 10
|
if subProperty == 'AttackAddedRatio':
|
||||||
relic_score += add_value
|
add_value = subValue * 1.5 * weight_dict['AttackAddedRatio'] * 100
|
||||||
if subProperty == 'SpeedDelta' and not is_main:
|
relic_score += add_value
|
||||||
add_value = subValue * 2.53 * weight_dict['SpeedDelta']
|
if subProperty == 'DefenceAddedRatio':
|
||||||
relic_score += add_value
|
add_value = (
|
||||||
elif subProperty == 'SpeedDelta' and is_main:
|
subValue * 1.19 * weight_dict['DefenceAddedRatio'] * 100
|
||||||
add_value = subValue * 2.53 * weight_dict['SpeedDelta'] * 0.1
|
)
|
||||||
relic_score += add_value
|
relic_score += add_value
|
||||||
if subProperty == 'BreakDamageAddedRatioBase':
|
if subProperty == 'HPAddedRatio':
|
||||||
add_value = (
|
add_value = subValue * 1.5 * weight_dict['HPAddedRatio'] * 100
|
||||||
(subValue + 1)
|
relic_score += add_value
|
||||||
* 1.0
|
if subProperty == 'SpeedDelta':
|
||||||
* weight_dict['BreakDamageAddedRatioBase']
|
add_value = subValue * 2.53 * weight_dict['SpeedDelta']
|
||||||
* 10
|
relic_score += add_value
|
||||||
)
|
if subProperty == 'BreakDamageAddedRatioBase':
|
||||||
relic_score += add_value
|
add_value = (
|
||||||
if subProperty == 'StatusProbabilityBase':
|
subValue
|
||||||
add_value = (
|
* 1.0
|
||||||
(subValue + 1) * 1.49 * weight_dict['StatusProbabilityBase'] * 10
|
* weight_dict['BreakDamageAddedRatioBase']
|
||||||
)
|
* 100
|
||||||
relic_score += add_value
|
)
|
||||||
if subProperty == 'StatusResistanceBase':
|
relic_score += add_value
|
||||||
add_value = (
|
if subProperty == 'StatusProbabilityBase':
|
||||||
(subValue + 1) * 1.49 * weight_dict['StatusResistanceBase'] * 10
|
add_value = (
|
||||||
)
|
subValue * 1.49 * weight_dict['StatusProbabilityBase'] * 100
|
||||||
relic_score += add_value
|
)
|
||||||
|
relic_score += add_value
|
||||||
|
if subProperty == 'StatusResistanceBase':
|
||||||
|
add_value = (
|
||||||
|
subValue * 1.49 * weight_dict['StatusResistanceBase'] * 100
|
||||||
|
)
|
||||||
|
relic_score += add_value
|
||||||
return relic_score
|
return relic_score
|
||||||
|
Loading…
x
Reference in New Issue
Block a user