Пример #1
0
    def to_dict(self, minimal: bool = False) -> dict:
        minimal_dict = BaseMixin.to_dict(self, minimal)

        if minimal:
            return minimal_dict

        materials = []
        for i in range(1, 7):
            material_code = getattr(self, f"material_{i}_code")
            if material_code:
                materials.append({
                    "item":
                    getattr(self, f"material_{i}").to_dict(),
                    "quantity":
                    getattr(self, f"material_{i}_quantity"),
                })

        return {
            **minimal_dict,
            "result_item": self.result_item.to_dict(),
            "result_item_quantity": self.result_item_quantity,
            "materials": materials,
            **DroppedByMixin.to_dict(self),
            **SoldByMixin.to_dict(self),
            **RandomBoxMixin.to_dict(self),
        }
Пример #2
0
    def to_dict(self, minimal: bool = False) -> dict:
        minimal_dict = BaseMixin.to_dict(self, minimal)

        if minimal:
            return minimal_dict

        return {
            **minimal_dict,
            **DroppedByMixin.to_dict(self),
            **SoldByMixin.to_dict(self),
        }
Пример #3
0
    def to_dict(self, minimal: bool = False) -> dict:
        minimal_dict = BaseMixin.to_dict(self, minimal)

        if minimal:
            return minimal_dict

        return {
            **minimal_dict,
            "skill": self.skill_data.to_dict(),
            **DroppedByMixin.to_dict(self),
            **RandomBoxMixin.to_dict(self),
        }
Пример #4
0
    def to_dict(self, minimal: bool = False) -> dict:
        minimal_dict = BaseMixin.to_dict(self, minimal)

        if minimal:
            return minimal_dict

        return {
            **minimal_dict,
            "efficiency": self.efficiency,
            **DroppedByMixin.to_dict(self),
            **RandomBoxMixin.to_dict(self),
        }
Пример #5
0
    def to_dict(self, minimal: bool = False) -> dict:
        minimal_dict = ExtraEquipmentMixin.to_dict(self, minimal)

        if minimal:
            return minimal_dict

        return {
            **minimal_dict,
            **DroppedByMixin.to_dict(self),
            **ProducedByMixin.to_dict(self),
            **RandomBoxMixin.to_dict(self),
        }
Пример #6
0
    def to_dict(self, minimal: bool = False) -> dict:
        minimal_dict = BaseMixin.to_dict(self, minimal)

        if minimal:
            return minimal_dict

        return {
            **minimal_dict,
            "description": self.description,
            **DroppedByMixin.to_dict(self),
            **RandomBoxMixin.to_dict(self),
        }
Пример #7
0
    def to_dict(self, minimal: bool = False) -> dict:
        minimal_dict = BaseMixin.to_dict(self, minimal)

        if minimal:
            return minimal_dict

        return {
            **minimal_dict,
            "quest":
            self.quest.to_dict(minimal=True) if self.quest else None,
            **SoldByMixin.to_dict(self),
            **DroppedByMixin.to_dict(self),
        }
Пример #8
0
    def to_dict(self, minimal: bool = False) -> dict:
        minimal_dict = BaseMixin.to_dict(self)

        if minimal:
            return minimal_dict

        return {
            **minimal_dict,
            "level": self.level,
            "damage": self.damage,
            "explosion_range": self.explosion_range,
            **DroppedByMixin.to_dict(self),
            **SoldByMixin.to_dict(self),
        }
Пример #9
0
    def to_dict(self, minimal: bool = False) -> dict:
        minimal_dict = BaseMixin.to_dict(self, minimal)

        if minimal:
            return minimal_dict

        return {
            **minimal_dict,
            **NeededForMixin.to_dict(self),
            **ProducedByMixin.to_dict(self),
            **DroppedByMixin.to_dict(self),
            **SoldByMixin.to_dict(self),
            **RandomBoxMixin.to_dict(self),
        }
Пример #10
0
    def to_dict(self, minimal: bool = False) -> dict:
        minimal_dict = BaseMixin.to_dict(self, minimal)

        if minimal:
            return minimal_dict

        return {
            **minimal_dict,
            "inital_courage": self.inital_courage,
            "inital_patience": self.inital_patience,
            "inital_wisdom": self.inital_wisdom,
            "is_unlimited": self.is_unlimited,
            **DroppedByMixin.to_dict(self),
            **RandomBoxMixin.to_dict(self),
        }
Пример #11
0
    def to_dict(self, minimal: bool = False) -> dict:
        minimal_dict = ShipBaseMixin.to_dict(self)

        if minimal:
            return minimal_dict

        return {
            **minimal_dict,
            "protection": self.protection,
            "balance": self.balance,
            **DroppedByMixin.to_dict(self),
            **ProducedByMixin.to_dict(self),
            **NeededForMixin.to_dict(self),
            **RandomBoxMixin.to_dict(self),
            **SoldByMixin.to_dict(self),
        }
Пример #12
0
    def to_dict(self, minimal: bool = False) -> dict:
        minimal_dict = WeaponEquipmentMixin.to_dict(self, minimal)

        if minimal:
            return minimal_dict

        return {
            **minimal_dict,
            **UpgradeRuleMixin.to_dict(self),
            **ItemSetMixin.to_dict(self),
            **DroppedByMixin.to_dict(self),
            **ProducedByMixin.to_dict(self),
            **NeededForMixin.to_dict(self),
            **RandomBoxMixin.to_dict(self),
            **SoldByMixin.to_dict(self),
        }
Пример #13
0
    def to_dict(self, minimal: bool = False) -> dict:
        minimal_dict = ShipBaseMixin.to_dict(self)

        if minimal:
            return minimal_dict

        return {
            **minimal_dict,
            "turning_power": self.turning_power,
            "deceleration": self.deceleration,
            "balance": self.balance,
            **DroppedByMixin.to_dict(self),
            **ProducedByMixin.to_dict(self),
            **NeededForMixin.to_dict(self),
            **RandomBoxMixin.to_dict(self),
            **SoldByMixin.to_dict(self),
        }
Пример #14
0
    def to_dict(self, minimal: bool = False) -> dict:
        minimal_dict = ShipBaseMixin.to_dict(self)

        if minimal:
            return minimal_dict

        return {
            **minimal_dict,
            "favorable_wind": self.favorable_wind,
            "adverse_wind": self.adverse_wind,
            "turning_power": self.turning_power,
            "balance": self.balance,
            **DroppedByMixin.to_dict(self),
            **ProducedByMixin.to_dict(self),
            **NeededForMixin.to_dict(self),
            **RandomBoxMixin.to_dict(self),
            **SoldByMixin.to_dict(self),
        }
Пример #15
0
    def to_dict(self, minimal: bool = False) -> dict:
        minimal_dict = {
            **ExtraEquipmentMixin.to_dict(self, minimal),
            "accessory_type":
            self.accessory_type.to_dict(),
        }

        if minimal:
            return minimal_dict

        return {
            **minimal_dict,
            **ItemSetMixin.to_dict(self),
            **DroppedByMixin.to_dict(self),
            **ProducedByMixin.to_dict(self),
            **NeededForMixin.to_dict(self),
            **RandomBoxMixin.to_dict(self),
            **SoldByMixin.to_dict(self),
        }
Пример #16
0
    def to_dict(self, minimal: bool = False) -> dict:
        minimal_dict = {
            **BaseMixin.to_dict(self, minimal),
            **BonusMixin.to_dict(self),
            "equip_type": self.equip_type.to_dict(),
            "is_core_essence": self.is_core_essence,
            "required_weapon_level": self.required_weapon_level,
        }

        if minimal:
            return minimal_dict

        return {
            **minimal_dict,
            **DroppedByMixin.to_dict(self),
            **ProducedByMixin.to_dict(self),
            **NeededForMixin.to_dict(self),
            **RandomBoxMixin.to_dict(self),
        }
Пример #17
0
    def to_dict(self, minimal: bool = False) -> dict:
        minimal_dict = ShipBaseMixin.to_dict(self)

        if minimal:
            return minimal_dict

        return {
            **minimal_dict,
            "physical_defense": self.physical_defense,
            "protection": self.protection,
            "dp": self.dp,
            "guns_front": self.guns_front,
            "guns_side": self.guns_side,
            "crew_size": self.crew_size,
            **DroppedByMixin.to_dict(self),
            **ProducedByMixin.to_dict(self),
            **NeededForMixin.to_dict(self),
            **RandomBoxMixin.to_dict(self),
            **SoldByMixin.to_dict(self),
        }
Пример #18
0
    def to_dict(self, minimal: bool = False) -> dict:
        minimal_dict = BaseMixin.to_dict(self, minimal)

        if minimal:
            return minimal_dict

        return {
            **minimal_dict,
            "level_land": self.level_land,
            "level_sea": self.level_sea,
            "cooldown": self.cooldown,
            "cast_time": self.cast_time,
            "efficiency": self.efficiency,
            "description": self.description,
            **NeededForMixin.to_dict(self),
            **ProducedByMixin.to_dict(self),
            **DroppedByMixin.to_dict(self),
            **SoldByMixin.to_dict(self),
            **RandomBoxMixin.to_dict(self),
        }
Пример #19
0
    def to_dict(self, minimal: bool = False) -> dict:
        minimal_dict = ShipBaseMixin.to_dict(self)

        if minimal:
            return minimal_dict

        return {
            **minimal_dict,
            "damage": self.damage,
            "range": self.range,
            "critical": self.critical,
            "reloadspeed": self.reloadspeed,
            "hitrange": self.hitrange,
            "balance": self.balance,
            **DroppedByMixin.to_dict(self),
            **ProducedByMixin.to_dict(self),
            **NeededForMixin.to_dict(self),
            **RandomBoxMixin.to_dict(self),
            **SoldByMixin.to_dict(self),
        }
Пример #20
0
    def to_dict(self, minimal: bool = False) -> dict:
        minimal_dict = {
            **BaseMixin.to_dict(self, minimal),
            "level_land": self.level_land,
            "level_sea": self.level_sea,
        }

        if minimal:
            return minimal_dict

        items = []
        for i in range(0, 62):
            item_code = getattr(self, f"item_{i}_code")
            if item_code:
                if item_code == "money":
                    item = {
                        "code": "money",
                        "name": "Gelt",
                        "icon": "def004.png",
                        "rare_grade": 0,
                        "table": None,
                    }
                else:
                    item = getattr(self, f"item_{i}").to_dict()

                items.append({
                    "item": item,
                    "quantity": getattr(self, f"item_{i}_quantity"),
                })

        return {
            **minimal_dict,
            "items": items,
            **NeededForMixin.to_dict(self),
            **ProducedByMixin.to_dict(self),
            **DroppedByMixin.to_dict(self),
            **SoldByMixin.to_dict(self),
            **RandomBoxMixin.to_dict(self),
        }
Пример #21
0
    def to_dict(self, minimal: bool = False) -> dict:
        minimal_dict = {
            "code": self.code,
            "name": self.name,
            "icon": self.icon,
        }

        if minimal:
            return minimal_dict

        quest_objectives = self.quest_missions + self.quest_give_items

        return {
            **minimal_dict,
            "stack_size":
            self.stack_size,
            "quests": [
                quest_objective.quest.to_dict(minimal=True)
                for quest_objective in quest_objectives
            ],
            **DroppedByMixin.to_dict(self),
        }