mirror of
https://github.com/PaiGramTeam/EnkaNetwork.py.git
synced 2024-09-28 03:26:09 +00:00
Fix stats show DigitType wrong
This commit is contained in:
parent
8236b9a6ba
commit
887d0e458d
@ -21,13 +21,11 @@ class EquipmentsStats(BaseModel):
|
||||
prop_id: str = ""
|
||||
type: DigitType = DigitType.NUMBER
|
||||
name: str = ""
|
||||
value: int = 0
|
||||
value: Union[int, float] = Field(0, alias="statValue")
|
||||
|
||||
def __init__(self, **data: Any) -> None:
|
||||
super().__init__(**data)
|
||||
|
||||
self.value = data["statValue"]
|
||||
|
||||
LOGGER.debug("=== Fight prop ===")
|
||||
|
||||
if "mainPropId" in data:
|
||||
@ -39,7 +37,8 @@ class EquipmentsStats(BaseModel):
|
||||
|
||||
prod_id = ["HURT", "CRITICAL", "EFFICIENCY", "PERCENT", "ADD"]
|
||||
|
||||
if isinstance(self.value, float) or self.prop_id.split("_")[-1] in prod_id:
|
||||
if self.prop_id.split("_")[-1] in prod_id:
|
||||
self.value = float(data["statValue"])
|
||||
self.type = DigitType.PERCENT
|
||||
|
||||
if not fight_prop:
|
||||
|
Loading…
Reference in New Issue
Block a user