Skip to content

Commit

Permalink
Module may not be present in assist char data
Browse files Browse the repository at this point in the history
For en arknights user doFx#0121 the currentEquip field is not present.
  • Loading branch information
thesadru authored Jun 11, 2024
1 parent f367e51 commit 284493b
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 5 deletions.
6 changes: 4 additions & 2 deletions arkprts/models/data.py
Original file line number Diff line number Diff line change
Expand Up @@ -283,7 +283,7 @@ class AssistChar(base.BaseModel):
"""Index of the operator."""
skill_index: int = pydantic.Field(alias="skillIndex")
"""Index of the selected skill."""
current_equip: typing.Optional[str] = pydantic.Field(alias="currentEquip")
current_equip: typing.Optional[str] = pydantic.Field(default=None, alias="currentEquip")
"""Currently equipped module."""
tmpl: typing.Mapping[str, base.DDict] = pydantic.Field(default_factory=base.DDict, repr=False)
"""Alternative operator class data. Only for Amiya."""
Expand All @@ -296,8 +296,10 @@ class Social(base.BaseModel):
"""Support operators."""
yesterday_reward: base.DDict = pydantic.Field(alias="yesterdayReward")
"""IDK. Clue exchange data."""
y_crisis_ss: typing.Union[str, typing.Any] = pydantic.Field(alias="yCrisisSs", repr=False)
y_crisis_ss: str = pydantic.Field(alias="yCrisisSs", repr=False)
"""IDK. Crisis refers to contingency contract. Always empty string."""
y_crisis_v2_ss: str = pydantic.Field(alias="yCrisisV2Ss", repr=False)
"""IDK. Crisis refers to contingency contract. Empty string when cc is not happening."""
medal_board: base.DDict = pydantic.Field(default_factory=base.DDict, alias="medalBoard")
"""Medal board."""

Expand Down
4 changes: 3 additions & 1 deletion arkprts/models/social.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,9 @@ class AssistChar(base.BaseModel):
level: int
"""Operator level."""
crisis_record: typing.Mapping[str, int] = pydantic.Field(alias="crisisRecord")
"""Maximum risk this operator was used as a support in. -1 if never used."""
"""Maximum risk this operator was used as a support in. Only for operations (before Pinch-Out). -1 if never used."""
crisis_v2_record: typing.Mapping[str, int] = pydantic.Field(alias="crisisV2Record")
"""Maximum risk this operator was used as a support in. Only for battleplans (after Pinch-Out). -1 if never used."""
current_equip: typing.Optional[str] = pydantic.Field(alias="currentEquip")
"""ID of the currently equipped module."""
equip: typing.Mapping[str, UniEquip]
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[project]
name = "arkprts"
requires-python = ">=3.9"
version = "0.3.6"
version = "0.3.7"
dynamic = [
"dependencies",
"description",
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

setup(
name="arkprts",
version="0.3.6",
version="0.3.7",
description="Arknights python wrapper.",
url="https://github.com/thesadru/arkprts",
packages=find_packages(exclude=["tests", "tests.*"]),
Expand Down

0 comments on commit 284493b

Please sign in to comment.