コード例 #1
0
    def from_css(css: CrossServerSkill) -> 'LeaderSkill':
        jp_skill = css.jp_skill
        na_skill = css.na_skill
        kr_skill = css.kr_skill

        en_ls_converter = EnLSTextConverter()
        jp_ls_converter = JpLSTextConverter()
        en_description = jp_skill.full_text(
            en_ls_converter) or na_skill.raw_description
        ja_description = jp_skill.full_text(
            jp_ls_converter) or jp_skill.raw_description
        skill_type_tags = skill_text_typing.parse_ls_conditions(css)
        tags = skill_text_typing.format_conditions(skill_type_tags)

        # In the event that we don't have KR data, use the NA name and calculated description.
        kr_name = kr_skill.name if jp_skill != kr_skill else na_skill.name
        ko_desc = kr_skill.raw_description if jp_skill != kr_skill else en_description

        return LeaderSkill(leader_skill_id=jp_skill.skill_id,
                           name_ja=jp_skill.name,
                           name_en=na_skill.name,
                           name_ko=kr_name,
                           desc_ja=ja_description,
                           desc_en=en_description,
                           desc_ko=ko_desc,
                           max_hp=jp_skill.hp,
                           max_atk=jp_skill.atk,
                           max_rcv=jp_skill.rcv,
                           max_shield=jp_skill.shield,
                           max_combos=jp_skill.extra_combos,
                           mult_bonus_damage=jp_skill.mult_bonus_damage,
                           bonus_damage=jp_skill.bonus_damage,
                           extra_time=jp_skill.extra_time,
                           tags=tags)
コード例 #2
0
    def from_css(css: CrossServerSkill) -> 'LeaderSkill':
        jp_skill = css.jp_skill
        na_skill = css.na_skill
        kr_skill = css.kr_skill

        en_ls_converter = EnLSTextConverter()
        jp_ls_converter = JpLSTextConverter()
        na_description = jp_skill.full_text(
            en_ls_converter) or na_skill.raw_description
        jp_description = jp_skill.full_text(
            jp_ls_converter) or jp_skill.raw_description
        skill_type_tags = skill_text_typing.parse_ls_conditions(css)
        tags = skill_text_typing.format_conditions(skill_type_tags)

        # In the event that we don't have KR data, use the NA name and calculated description.
        kr_name = kr_skill.name if jp_skill != kr_skill else na_skill.name
        kr_desc = kr_skill.raw_description if jp_skill != kr_skill else na_description

        return LeaderSkill(leader_skill_id=jp_skill.skill_id,
                           name_jp=jp_skill.name,
                           name_na=na_skill.name,
                           name_kr=kr_name,
                           desc_jp=jp_description,
                           desc_na=na_description,
                           desc_kr=kr_desc,
                           max_hp=jp_skill.hp,
                           max_atk=jp_skill.atk,
                           max_rcv=jp_skill.rcv,
                           max_shield=jp_skill.shield,
                           tags=tags)
コード例 #3
0
    def __init__(self, jp_database: Database, na_database: Database,
                 kr_database: Database):
        self.all_cards = build_cross_server_cards(
            jp_database, na_database,
            kr_database)  # type: List[CrossServerCard]
        self.ownable_cards = list(
            filter(lambda c: 0 < c.monster_id < 19999,
                   self.all_cards))  # type: List[CrossServerCard]

        self.leader_skills = build_cross_server_skills(
            jp_database.leader_skills, na_database.leader_skills,
            kr_database.leader_skills)

        ls_converter = EnLsTextConverter()
        for ls in self.leader_skills:
            ls.en_text = ls.jp_skill.full_text(ls_converter)
            ls.skill_type_tags = list(
                skill_text_typing.parse_ls_conditions(ls.en_text))
            ls.skill_type_tags.sort(key=lambda x: x.value)

        self.active_skills = build_cross_server_skills(
            jp_database.active_skills, na_database.active_skills,
            kr_database.active_skills)

        as_converter = EnAsTextConverter()
        for ask in self.active_skills:
            ask.en_text = ask.jp_skill.full_text(as_converter)
            ask.skill_type_tags = list(
                skill_text_typing.parse_as_conditions(ask.en_text))
            ask.skill_type_tags.sort(key=lambda x: x.value)

        self.dungeons = build_cross_server_dungeons(
            jp_database, na_database,
            kr_database)  # type: List[CrossServerDungeon]

        self.enemy_skills = build_cross_server_enemy_skills(
            jp_database.enemy_skills, na_database.enemy_skills,
            kr_database.enemy_skills)

        self.jp_bonuses = jp_database.bonuses
        self.na_bonuses = na_database.bonuses
        self.kr_bonuses = kr_database.bonuses

        self.jp_exchange = jp_database.exchange
        self.na_exchange = na_database.exchange
        self.kr_exchange = kr_database.exchange

        self.jp_egg_machines = jp_database.egg_machines
        self.na_egg_machines = na_database.egg_machines
        self.kr_egg_machines = kr_database.egg_machines

        self.jp_exchange = jp_database.exchange
        self.na_exchange = na_database.exchange
        self.kr_exchange = kr_database.exchange

        self.monster_id_to_card = {c.monster_id: c for c in self.all_cards}
        self.leader_id_to_leader = {s.skill_id: s for s in self.leader_skills}
        self.active_id_to_active = {s.skill_id: s for s in self.active_skills}
        self.dungeon_id_to_dungeon = {d.dungeon_id: d for d in self.dungeons}

        self.hq_image_monster_ids = []  # type: List[MonsterId]
        self.animated_monster_ids = []  # type: List[MonsterId]

        for csc in self.ownable_cards:
            if csc.leader_skill:
                csc.leader_skill = self.leader_id_to_leader[
                    csc.leader_skill.skill_id]
            if csc.active_skill:
                csc.active_skill = self.active_id_to_active[
                    csc.active_skill.skill_id]
            csc.load_text()