🚨修复遗器主属性错误问题

This commit is contained in:
qwerdvd 2023-05-28 14:47:49 +08:00
parent f3273bfec4
commit f117bc56eb
5 changed files with 19 additions and 21 deletions

View File

@ -47,6 +47,7 @@ class BaseAvatar:
self.avatar_attribute_bonus = char['attribute_bonus'] self.avatar_attribute_bonus = char['attribute_bonus']
self.avatar_extra_ability = char['extra_ability'] self.avatar_extra_ability = char['extra_ability']
self.avatar_attribute = {} self.avatar_attribute = {}
self.get_attribute()
def get_attribute(self): def get_attribute(self):
promotion = AvatarPromotion[str(self.avatar_id)][ promotion = AvatarPromotion[str(self.avatar_id)][

View File

@ -170,12 +170,12 @@ class RelicSet:
self.set_id_counter: List = Counter(set_id_list).most_common() self.set_id_counter: List = Counter(set_id_list).most_common()
self.check_set() self.check_set()
self.get_attribute()
def get_attribute(self): def get_attribute(self):
for item in self.__dict__: for item in self.__dict__:
if type(self.__dict__[item]) != SingleRelic: if type(self.__dict__[item]) == SingleRelic:
break self.__dict__[item].get_attribute_()
self.__dict__[item].get_attribute_()
def check_set(self): def check_set(self):
for item in self.set_id_counter: for item in self.set_id_counter:

View File

@ -29,7 +29,6 @@ class RoleInstance:
self.cal_weapon_attr_add() self.cal_weapon_attr_add()
def cal_role_base_attr(self): def cal_role_base_attr(self):
self.avatar.get_attribute()
avatar_attribute = self.avatar.__dict__['avatar_attribute'] avatar_attribute = self.avatar.__dict__['avatar_attribute']
for attribute in avatar_attribute: for attribute in avatar_attribute:
if attribute in self.base_attr: if attribute in self.base_attr:
@ -37,7 +36,6 @@ class RoleInstance:
else: else:
self.base_attr[attribute] = avatar_attribute[attribute] self.base_attr[attribute] = avatar_attribute[attribute]
self.weapon.get_attribute()
weapon_attribute = self.weapon.__dict__['weapon_base_attribute'] weapon_attribute = self.weapon.__dict__['weapon_base_attribute']
for attribute in weapon_attribute: for attribute in weapon_attribute:
if attribute in self.base_attr: if attribute in self.base_attr:
@ -47,20 +45,18 @@ class RoleInstance:
def cal_relic_attr_add(self): def cal_relic_attr_add(self):
# 单件属性 # 单件属性
self.relic_set.get_attribute()
for relic_type in self.relic_set.__dict__: for relic_type in self.relic_set.__dict__:
if type(self.relic_set.__dict__[relic_type]) != SingleRelic: if type(self.relic_set.__dict__[relic_type]) == SingleRelic:
break relic: SingleRelic = self.relic_set.__dict__[relic_type]
relic: SingleRelic = self.relic_set.__dict__[relic_type] for attribute in relic.relic_attribute_bonus:
for attribute in relic.relic_attribute_bonus: if attribute in self.attribute_bonus:
if attribute in self.attribute_bonus: self.attribute_bonus[
self.attribute_bonus[ attribute
attribute ] += relic.relic_attribute_bonus[attribute]
] += relic.relic_attribute_bonus[attribute] else:
else: self.attribute_bonus[
self.attribute_bonus[ attribute
attribute ] = relic.relic_attribute_bonus[attribute]
] = relic.relic_attribute_bonus[attribute]
# 套装面板加成属性 # 套装面板加成属性
for set_skill in self.relic_set.SetSkill: for set_skill in self.relic_set.SetSkill:

View File

@ -17,6 +17,7 @@ class BaseWeapon:
self.weapon_promotion = weapon['promotion'] self.weapon_promotion = weapon['promotion']
self.weapon_base_attribute = {} self.weapon_base_attribute = {}
self.weapon_attribute = {} self.weapon_attribute = {}
self.get_attribute()
self.weapon_property_ability() self.weapon_property_ability()
@abstractmethod @abstractmethod

6
poetry.lock generated
View File

@ -2,14 +2,14 @@
[[package]] [[package]]
name = "asgiref" name = "asgiref"
version = "3.7.1" version = "3.7.2"
description = "ASGI specs, helper code, and adapters" description = "ASGI specs, helper code, and adapters"
category = "dev" category = "dev"
optional = false optional = false
python-versions = ">=3.7" python-versions = ">=3.7"
files = [ files = [
{file = "asgiref-3.7.1-py3-none-any.whl", hash = "sha256:33958cb2e4b3cd8b1b06ef295bd8605cde65b11df51d3beab39e2e149a610ab3"}, {file = "asgiref-3.7.2-py3-none-any.whl", hash = "sha256:89b2ef2247e3b562a16eef663bc0e2e703ec6468e2fa8a5cd61cd449786d4f6e"},
{file = "asgiref-3.7.1.tar.gz", hash = "sha256:8de379fcc383bcfe4507e229fc31209ea23d4831c850f74063b2c11639474dd2"}, {file = "asgiref-3.7.2.tar.gz", hash = "sha256:9e0ce3aa93a819ba5b45120216b23878cf6e8525eb3848653452b4192b92afed"},
] ]
[package.dependencies] [package.dependencies]