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

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_extra_ability = char['extra_ability']
self.avatar_attribute = {}
self.get_attribute()
def get_attribute(self):
promotion = AvatarPromotion[str(self.avatar_id)][

View File

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

View File

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

View File

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

6
poetry.lock generated
View File

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