Exemplo n.º 1
0
 def load_text(self):
     self.en_ls_text = self.leader_skill.jp_skill.full_text(
         EnLsTextConverter()) if self.leader_skill else None
     self.en_as_text = self.active_skill.jp_skill.full_text(
         EnAsTextConverter()) if self.active_skill else None
Exemplo n.º 2
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()