@@ -59,23 +59,34 @@ async def set_unique_growth_unit(self):
5959 await self .client .set_growth_item_unique (self .unit_id , ball [1 ])
6060
6161 async def is_growth_unit (self ) -> Union [GrowthParameter , None ]:
62- if self .unit_id not in self .client .data .unit :
63- raise AbortError (f"未解锁角色{ self .unit_name } " )
64- if self .unit_id not in self .client .data .growth_unit :
65- return None
66- growth_id = list (set (self .client .data .growth_unit [self .unit_id ].growth_parameter_list .growth_id_list ) & set (db .growth_parameter .keys ()))
67- if not growth_id :
68- return None
69- if len (growth_id ) > 1 :
70- raise ValueError (f"{ self .unit_name } 怎么装了多个辉光球?" + ',' .join (map (str , growth_id )))
71- growth_limit = db .growth_parameter [growth_id [0 ]]
72- return growth_limit
62+ def old ():
63+ if self .unit_id not in self .client .data .unit :
64+ raise AbortError (f"未解锁角色{ self .unit_name } " )
65+ if self .unit_id not in self .client .data .growth_unit :
66+ return None
67+ if not self .client .data .growth_unit [self .unit_id ].growth_parameter_list :
68+ return None
69+ if not self .client .data .growth_unit [self .unit_id ].growth_parameter_list .growth_id_list :
70+ return None
71+ growth_id = list (set (self .client .data .growth_unit [self .unit_id ].growth_parameter_list .growth_id_list ) & set (db .growth_parameter .keys ()))
72+ if not growth_id :
73+ return None
74+ if len (growth_id ) > 1 :
75+ raise ValueError (f"{ self .unit_name } 怎么装了多个辉光球?" + ',' .join (map (str , growth_id )))
76+ growth_limit = db .growth_parameter [growth_id [0 ]]
77+ return growth_limit
78+ ret = old ()
79+ return ret if ret else self .client .data .get_synchro_parameter ()
7380
7481 async def is_unique_growth_unit (self ) -> Union [GrowthParameterUnique , None ]:
7582 if self .unit_id not in self .client .data .unit :
7683 raise AbortError (f"未解锁角色{ self .unit_name } " )
7784 if self .unit_id not in self .client .data .growth_unit :
7885 return None
86+ if not self .client .data .growth_unit [self .unit_id ].growth_parameter_list :
87+ return None
88+ if not self .client .data .growth_unit [self .unit_id ].growth_parameter_list .growth_id_list :
89+ return None
7990 growth_id = list (set (self .client .data .growth_unit [self .unit_id ].growth_parameter_list .growth_id_list ) & set (db .growth_parameter_unique .keys ()))
8091 if not growth_id :
8192 return None
@@ -811,7 +822,9 @@ async def do_task(self, client: pcrclient):
811822 target_unique1_level = target_unique1_level ,
812823 target_unique2_level = target_unique2_level )
813824 except Exception as e :
814- self ._warn (str (e ))
825+ msg = f"拉{ unit_id } 练度失败: { e } "
826+ logger .exception (msg )
827+ self ._warn (msg )
815828 continue
816829
817830@description ('''角色ID 角色名字 角色等级 角色星级 好感度 Rank 左上 右上 左中 右中 左下 右下 UB 技能1 技能2 EX技能 专武1 专武2 EX武器 EX武器等级 EX防具 EX防具等级 EX首饰 EX首饰等级 高级设置
@@ -886,7 +899,9 @@ async def do_task(self, client: pcrclient):
886899 cb_ex = cb_ex )
887900
888901 except Exception as e :
889- self ._warn (str (e ))
902+ msg = f"拉{ unit_text } 练度失败: { e } "
903+ logger .exception (msg )
904+ self ._warn (msg )
890905 continue
891906
892907@name ('购买记忆碎片' )
@@ -958,7 +973,9 @@ async def do_task(self, client: pcrclient):
958973 summary .append (f"{ gap } 片{ unit_name } 记忆碎片" + ",但不购买" if gap > uplimit else "" )
959974
960975 except Exception as e :
961- self ._warn (str (e ))
976+ msg = f"购买{ unit_text } 记忆碎片失败: { e } "
977+ logger .exception (msg )
978+ self ._warn (msg )
962979 continue
963980
964981 if summary :
0 commit comments