mirror of
https://github.com/baiqwerdvd/StarRailUID.git
synced 2025-05-05 11:13:45 +08:00
🚨修复遗器属性未被计入的bug
This commit is contained in:
parent
965de7721f
commit
2b07f786b8
@ -17,6 +17,7 @@ async def cal(char_data: Dict):
|
|||||||
raw_data['avatar']['level'] = char.char_level
|
raw_data['avatar']['level'] = char.char_level
|
||||||
raw_data['avatar']['rank'] = char.char_rank
|
raw_data['avatar']['rank'] = char.char_rank
|
||||||
raw_data['avatar']['promotion'] = char.char_promotion
|
raw_data['avatar']['promotion'] = char.char_promotion
|
||||||
|
raw_data['avatar']['attribute_bonus'] = char.attribute_bonus
|
||||||
|
|
||||||
raw_data['weapon']['id'] = char.equipment['equipmentID']
|
raw_data['weapon']['id'] = char.equipment['equipmentID']
|
||||||
raw_data['weapon']['level'] = char.equipment['equipmentLevel']
|
raw_data['weapon']['level'] = char.equipment['equipmentLevel']
|
||||||
@ -28,4 +29,5 @@ async def cal(char_data: Dict):
|
|||||||
role = RoleInstance(raw_data)
|
role = RoleInstance(raw_data)
|
||||||
await role.cal_role_base_attr()
|
await role.cal_role_base_attr()
|
||||||
await role.cal_relic_attr_add()
|
await role.cal_relic_attr_add()
|
||||||
|
await role.cal_avatar_attr_add()
|
||||||
return '还没写完呢'
|
return '还没写完呢'
|
||||||
|
@ -37,6 +37,7 @@ class BaseAvatar:
|
|||||||
self.avatar_rank = char['rank']
|
self.avatar_rank = char['rank']
|
||||||
self.avatar_promotion = char['promotion']
|
self.avatar_promotion = char['promotion']
|
||||||
self.avatar_attribute = {}
|
self.avatar_attribute = {}
|
||||||
|
self.avatar_attribute_bonus = char['attribute_bonus']
|
||||||
|
|
||||||
async def get_attribute(self):
|
async def get_attribute(self):
|
||||||
promotion = AvatarPromotion[str(self.avatar_id)][
|
promotion = AvatarPromotion[str(self.avatar_id)][
|
||||||
|
@ -65,4 +65,6 @@ class RelicSet:
|
|||||||
|
|
||||||
async def get_attribute(self):
|
async def get_attribute(self):
|
||||||
for relic in self.__dict__:
|
for relic in self.__dict__:
|
||||||
|
if relic == 'set_id_counter':
|
||||||
|
break
|
||||||
await self.__dict__[relic].get_attribute_()
|
await self.__dict__[relic].get_attribute_()
|
||||||
|
@ -1,9 +1,13 @@
|
|||||||
from typing import Dict
|
from typing import Dict
|
||||||
|
|
||||||
|
from mpmath import mp
|
||||||
|
|
||||||
from .Avatar import Avatar
|
from .Avatar import Avatar
|
||||||
from .Weapon import Weapon
|
from .Weapon import Weapon
|
||||||
from .Relic import RelicSet, SingleRelic
|
from .Relic import RelicSet, SingleRelic
|
||||||
|
|
||||||
|
mp.dps = 14
|
||||||
|
|
||||||
|
|
||||||
class RoleInstance:
|
class RoleInstance:
|
||||||
def __init__(self, raw_data: Dict):
|
def __init__(self, raw_data: Dict):
|
||||||
@ -32,7 +36,6 @@ class RoleInstance:
|
|||||||
self.base_attr[attribute] += weapon_attribute[attribute]
|
self.base_attr[attribute] += weapon_attribute[attribute]
|
||||||
else:
|
else:
|
||||||
self.base_attr[attribute] = weapon_attribute[attribute]
|
self.base_attr[attribute] = weapon_attribute[attribute]
|
||||||
print(self.base_attr)
|
|
||||||
|
|
||||||
async def cal_relic_attr_add(self):
|
async def cal_relic_attr_add(self):
|
||||||
await self.relic_set.get_attribute()
|
await self.relic_set.get_attribute()
|
||||||
@ -49,4 +52,14 @@ class RoleInstance:
|
|||||||
self.attribute_bonus[
|
self.attribute_bonus[
|
||||||
attribute
|
attribute
|
||||||
] = relic.relic_attribute_bonus[attribute]
|
] = relic.relic_attribute_bonus[attribute]
|
||||||
print(self.attribute_bonus)
|
|
||||||
|
async def cal_avatar_attr_add(self):
|
||||||
|
attribute_bonus = self.avatar.avatar_attribute_bonus
|
||||||
|
for bonus in attribute_bonus:
|
||||||
|
status_add = bonus['statusAdd']
|
||||||
|
bonus_property = status_add['property']
|
||||||
|
value = mp.mpf(status_add['value'])
|
||||||
|
if bonus_property in self.attribute_bonus:
|
||||||
|
self.attribute_bonus[bonus_property] += value
|
||||||
|
else:
|
||||||
|
self.attribute_bonus[bonus_property] = value
|
||||||
|
Loading…
x
Reference in New Issue
Block a user