Module genshin.models.honkai.chronicle.battlesuits

Honkai chronicle battlesuits.

Classes

class BattlesuitWeapon (**data: Any)

Battlesuit weapon.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

Expand source code
class BattlesuitWeapon(Equipment):
    """Battlesuit weapon."""

Ancestors

Class variables

var icon : str
var id : int
var max_rarity : int
var model_computed_fields
var model_config : pydantic.config.ConfigDict
var model_fields
var name : str
var rarity : int

Inherited members

class Equipment (**data: Any)

Battlesuit equipment.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

Expand source code
class Equipment(APIModel, Unique):
    """Battlesuit equipment."""

    id: int
    name: str
    rarity: int
    max_rarity: int
    icon: str

    @property
    def type(self) -> str:
        """The type of the equipment"""
        match = re.search(r"/(\w+)Icons/", self.icon)
        base_type = match[1] if match else ""
        if not base_type or base_type == "Stigmata":
            return base_type

        match = re.search(r"/Weapon_([A-Za-z]+?)_", self.icon)
        return match[1] if match else "Weapon"

Ancestors

Subclasses

Class variables

var icon : str
var id : int
var max_rarity : int
var model_computed_fields
var model_config : pydantic.config.ConfigDict
var model_fields
var name : str
var rarity : int

Instance variables

prop type : str

The type of the equipment

Expand source code
@property
def type(self) -> str:
    """The type of the equipment"""
    match = re.search(r"/(\w+)Icons/", self.icon)
    base_type = match[1] if match else ""
    if not base_type or base_type == "Stigmata":
        return base_type

    match = re.search(r"/Weapon_([A-Za-z]+?)_", self.icon)
    return match[1] if match else "Weapon"
class FullBattlesuit (**data: Any)

Battlesuit complete with equipped weapon and stigmata.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

Expand source code
class FullBattlesuit(battlesuit.Battlesuit):
    """Battlesuit complete with equipped weapon and stigmata."""

    level: int
    weapon: BattlesuitWeapon
    stigmata: typing.Sequence[Stigma] = Aliased("stigmatas")

    @pydantic.model_validator(mode="before")
    def __unnest_char_data(cls, values: dict[str, typing.Any]) -> dict[str, typing.Any]:
        if isinstance(values.get("character"), typing.Mapping):
            values.update(values["character"])

        values.update(values.get("avatar", {}))

        return values

    @pydantic.field_validator("stigmata")
    def __remove_unequipped_stigmata(cls, value: typing.Sequence[Stigma]) -> typing.Sequence[Stigma]:
        return [stigma for stigma in value if stigma.id != 0]

Ancestors

Class variables

var level : int
var model_computed_fields
var model_config : pydantic.config.ConfigDict
var model_fields
var stigmata : Sequence[Stigma]
var weaponBattlesuitWeapon

Inherited members

class Stigma (**data: Any)

Battlesuit stigma.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

Expand source code
class Stigma(Equipment):
    """Battlesuit stigma."""

Ancestors

Class variables

var icon : str
var id : int
var max_rarity : int
var model_computed_fields
var model_config : pydantic.config.ConfigDict
var model_fields
var name : str
var rarity : int

Inherited members