Beispiel #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)
Beispiel #2
0
    def from_css(css: CrossServerSkill) -> 'ActiveSkill':
        jp_skill = css.jp_skill
        na_skill = css.na_skill
        kr_skill = css.kr_skill

        jp_as_converter = JpASTextConverter()
        ja_description = jp_skill.full_text(jp_as_converter)

        en_as_converter = EnASTextConverter()
        en_description = jp_skill.full_text(en_as_converter)

        skill_type_tags = skill_text_typing.parse_as_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 ActiveSkill(active_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,
                           turn_max=jp_skill.turn_max,
                           turn_min=jp_skill.turn_min,
                           tags=tags)
Beispiel #3
0
    def from_css(css: CrossServerSkill) -> 'ActiveSkill':
        jp_skill = css.jp_skill
        na_skill = css.na_skill
        kr_skill = css.kr_skill
        cur_skill = css.cur_skill

        desc_ja = cur_skill.full_text(JaASTextConverter())
        desc_en = cur_skill.full_text(EnASTextConverter())
        desc_ko = cur_skill.full_text(KoASTextConverter())
        desc_templated_ja = cur_skill.templated_text(JaASTextConverter())
        desc_templated_en = cur_skill.templated_text(EnASTextConverter())
        desc_templated_ko = cur_skill.templated_text(KoASTextConverter())

        skill_type_tags = skill_text_typing.parse_as_conditions(css)
        tags = skill_text_typing.format_conditions(skill_type_tags)

        return ActiveSkill(
            active_skill_id=jp_skill.skill_id,
            compound_skill_type_id=cur_skill.compound_skill_type,
            name_ja=jp_skill.name,
            name_en=na_skill.name,
            name_ko=kr_skill.name,
            desc_ja=desc_ja,
            desc_en=desc_en,
            desc_ko=desc_ko,
            desc_templated_ja=desc_templated_ja,
            desc_templated_en=desc_templated_en,
            desc_templated_ko=desc_templated_ko,
            desc_official_ja=jp_skill.raw_description,
            desc_official_en=na_skill.raw_description,
            desc_official_ko=kr_skill.raw_description,
            cooldown_turns_max=cur_skill.cooldown_turns_max,
            cooldown_turns_min=cur_skill.cooldown_turns_min,
            tags=tags)
Beispiel #4
0
    def from_as(act: ASSkill) -> 'ActiveSubskill':
        desc_ja = act.full_text(JaASTextConverter())
        desc_en = act.full_text(EnASTextConverter())
        desc_ko = act.full_text(KoASTextConverter())
        desc_templated_ja = act.templated_text(JaASTextConverter())
        desc_templated_en = act.templated_text(EnASTextConverter())
        desc_templated_ko = act.templated_text(KoASTextConverter())

        skill_type_tags = skill_text_typing.parse_as_conditions(act, True)
        tags = skill_text_typing.format_conditions(skill_type_tags)

        return ActiveSubskill(
            active_subskill_id=act.skill_id,
            # TODO: Figure out how to do names
            name_ja="",
            name_en="",
            name_ko="",
            desc_ja=desc_ja,
            desc_en=desc_en,
            desc_ko=desc_ko,
            desc_templated_ja=desc_templated_ja,
            desc_templated_en=desc_templated_en,
            desc_templated_ko=desc_templated_ko,
            board_65=act.board.to_6x5(),
            board_76=act.board.to_7x6(),
            cooldown=act.cooldown_turns_max or -1,
            tags=tags)
Beispiel #5
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)
Beispiel #6
0
    def from_as(act: ASSkill) -> 'ActivePart':
        desc_ja = act.full_text(JaASTextConverter())
        desc_en = act.full_text(EnASTextConverter())
        desc_ko = act.full_text(KoASTextConverter())
        desc_templated_ja = act.templated_text(JaASTextConverter())
        desc_templated_en = act.templated_text(EnASTextConverter())
        desc_templated_ko = act.templated_text(KoASTextConverter())

        skill_type_tags = skill_text_typing.parse_as_conditions(act, True)
        tags = skill_text_typing.format_conditions(skill_type_tags)

        return ActivePart(active_part_id=act.skill_id,
                          active_skill_type_id=act.skill_type,
                          desc_ja=desc_ja,
                          desc_en=desc_en,
                          desc_ko=desc_ko,
                          desc_templated_ja=desc_templated_ja,
                          desc_templated_en=desc_templated_en,
                          desc_templated_ko=desc_templated_ko,
                          tags=tags)
Beispiel #7
0
    def from_css(css: CrossServerSkill) -> 'ActiveSkill':
        jp_skill = css.jp_skill
        na_skill = css.na_skill
        kr_skill = css.kr_skill

        na_description = css.en_text
        tags = skill_text_typing.format_conditions(css.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 ActiveSkill(active_skill_id=jp_skill.skill_id,
                           name_jp=jp_skill.name,
                           name_na=na_skill.name,
                           name_kr=kr_name,
                           desc_jp=jp_skill.raw_description,
                           desc_na=na_description,
                           desc_kr=kr_desc,
                           turn_max=jp_skill.turn_max,
                           turn_min=jp_skill.turn_min,
                           tags=tags)