Skip to content

Held Item

py_unite_db.models.HeldItem

Bases: Item

Class representing a held item.

Get all held items from the api with UniteDb.held_items.

In the game, you can select up to 3 held items in battle. Held items can be upgraded up to level 30.

Source code in py_unite_db/models/held_item.py
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
class HeldItem(Item):
    """Class representing a held item.

    Get all held items from the api with
    [`UniteDb.held_items`][py_unite_db.UniteDb].

    In the game, you can select up to 3 held items in battle.
    Held items can be upgraded up to level 30.
    """

    effect: LevelItemEffect
    """The effect of the held item"""
    scaling_effects: list[ScalingItemEffect]

    @staticmethod
    def _transform(v: dict[str, Any]) -> dict[str, Any]:
        v["description"] = v.pop("description1")
        v["scaling_effects"] = v.pop("stats")
        # make base for main effect
        v["effect"] = {"label": v.get("description3", "")} | {
            k: v.get(k, "") for k in ("level1", "level10", "level20")
        }
        return v

description: str = Field(..., description='Description of this item.') class-attribute instance-attribute

display_name: str = Field(..., description='Display name of this item.') class-attribute instance-attribute

effect: LevelItemEffect instance-attribute

The effect of the held item

name: str = Field(..., description='Name of this item.') class-attribute instance-attribute

scaling_effects: list[ScalingItemEffect] instance-attribute

tier: Tier = Field(..., description='What tier unite-db consider this item to be.') class-attribute instance-attribute