Example #1
0
 def embed(cls, state: MaterialsViewState):
     # m: "MonsterModel", color, mats, usedin, gemid, gemusedin, skillups, skillup_evo_count, link
     return EmbedView(
         EmbedMain(
             color=state.color,
             title=MonsterHeader.fmt_id_header(
                 state.monster,
                 state.alt_monsters[0].monster.monster_id == cls.TSUBAKI,
                 state.is_jp_buffed).to_markdown(),
             url=puzzledragonx(state.monster)),
         embed_thumbnail=EmbedThumbnail(MonsterImage.icon(state.monster)),
         embed_footer=embed_footer_with_state(state),
         embed_fields=[
             f for f in [
                 mat_use_field(state.mats, "Evo materials") if state.mats
                 or not (state.monster.is_stackable or state.gem_override)
                 else None,
                 mat_use_field(state.usedin, "Material for", 10
                               ) if state.usedin else None,
                 mat_use_field(
                     state.gemusedin, "Evo gem ({}) is mat for".
                     format(state.gemid), 10 if state.gem_override else 5
                 ) if state.gemusedin else None,
                 skillup_field(state.skillups, state.
                               skillup_evo_count, state.link)
                 if not (state.monster.is_stackable or state.gem_override
                         ) else None
             ] if f is not None
         ] + [cls.evos_embed_field(state)])
Example #2
0
 def embed(cls, state: MaterialsViewState):
     # m: "MonsterModel", mats, usedin, gemid, gemusedin, skillups, skillup_evo_count, link
     return EmbedView(
         EmbedMain(color=state.query_settings.embedcolor,
                   title=MonsterHeader.menu_title(
                       state.monster,
                       is_tsubaki=state.alt_monsters[0].monster.monster_id
                       == cls.TSUBAKI,
                       is_jp_buffed=state.is_jp_buffed).to_markdown(),
                   url=MonsterLink.header_link(state.monster,
                                               state.query_settings)),
         embed_thumbnail=EmbedThumbnail(
             MonsterImage.icon(state.monster.monster_id)),
         embed_footer=embed_footer_with_state(state),
         embed_fields=[
             f for f in [
                 mat_use_field(state.mats,
                               "Evo materials",
                               query_settings=state.query_settings)
                 if state.mats or not (state.monster.is_stackable
                                       or state.gem_override) else None,
                 mat_use_field(state.usedin, "Material for", 10, state.
                               query_settings) if state.usedin else None,
                 mat_use_field(
                     state.gemusedin, "Evo gem ({}) is mat for".
                     format(state.gemid), 10 if state.gem_override else 5,
                     state.query_settings) if state.gemusedin else None,
                 skillup_field(state.skillups, state.skillup_evo_count,
                               state.link, state.query_settings)
                 if not (state.monster.is_stackable or state.gem_override
                         ) else None
             ] if f is not None
         ] + [cls.evos_embed_field(state)])
Example #3
0
    def embed(cls, state: ClosableEmbedViewState, props: ShowStatsViewProps):
        fields = []
        for mon, c in Counter(props.valid).most_common(
                cls.MAX_EXPANDED_RESULTS if len(props.valid) == cls.MAX_EXPANDED_RESULTS
                else cls.MAX_EXPANDED_RESULTS-1):
            fields.append(EmbedField(mon.name_en, Box(
                LabeledText("Net", ShowStatsView.get_count(props.total, mon)),
                LabeledText("Adj", ShowStatsView.get_count(props.adj, mon)),
                LabeledText("You", ShowStatsView.get_count(props.you, mon))
            ), inline=True))
        if len(props.valid) > cls.MAX_EXPANDED_RESULTS:
            fields.append(EmbedField("... & More",
                                     Box(f"+ {len(props.valid)-cls.MAX_EXPANDED_RESULTS-1} more monsters"),
                                     inline=True))

        return EmbedView(
            EmbedMain(
                color=state.query_settings.embedcolor,
                title=f"AdPEM Data for query: {state.raw_query}",
                description=Box(
                    LabeledText("Net", ShowStatsView.get_count(props.total, *props.valid)),
                    LabeledText("Adj", ShowStatsView.get_count(props.adj, *props.valid)),
                    LabeledText("You", ShowStatsView.get_count(props.you, *props.valid))
                ),
            ),
            embed_thumbnail=EmbedThumbnail(MonsterImage.icon(props.most_commmon.monster_id)),
            embed_fields=fields,
            embed_footer=embed_footer_with_state(state)
        )
Example #4
0
    def embed(cls, state: EvosViewState):
        fields = [
            EmbedField(
                ("{} evolution" if len(state.alt_versions) == 1 else
                 "{} evolutions").format(len(state.alt_versions)),
                Box(*EvosView._evo_lines(state.alt_versions, state.monster,
                                         state.query_settings)))
        ]

        if state.gem_versions:
            fields.append(
                EmbedField(
                    ("{} evolve gem" if len(state.gem_versions) == 1 else
                     "{} evolve gems").format(len(state.gem_versions)),
                    Box(*EvosView._evo_lines(state.gem_versions,
                                             state.monster))))

        return EmbedView(EmbedMain(
            color=state.query_settings.embedcolor,
            title=MonsterHeader.menu_title(
                state.monster,
                is_tsubaki=state.alt_monsters[0].monster.monster_id ==
                cls.TSUBAKI,
                is_jp_buffed=state.is_jp_buffed).to_markdown(),
            url=MonsterLink.header_link(state.monster, state.query_settings)),
                         embed_thumbnail=EmbedThumbnail(
                             MonsterImage.icon(state.monster.monster_id)),
                         embed_footer=embed_footer_with_state(state),
                         embed_fields=fields)
Example #5
0
    def embed(state: DungeonViewState):
        fields = []
        mb = MonsterBehavior()
        encounter_model = state.encounter
        if encounter_model.enemy_data is not None and encounter_model.enemy_data.behavior is not None:
            mb.ParseFromString(encounter_model.enemy_data.behavior)
        else:
            mb = None
        monster = process_monster(mb, encounter_model, state.database)

        monster_embed: Embed = DungeonView.make_embed(
            monster,
            verbose=state.verbose,
            spawn=[state.floor_index + 1, state.num_spawns],
            floor=[state.floor, state.num_floors],
            technical=state.technical)[state.page]

        hp = f'{monster.hp:,}'
        atk = f'{monster.atk:,}'
        defense = f'{monster.defense:,}'
        turns = f'{monster.turns:,}'
        title = monster_embed.title
        desc = monster_embed.description
        me_fields = monster_embed.fields

        for f in me_fields:
            fields.append(EmbedField(f.name, Box(*[f.value])))
        return EmbedView(EmbedMain(
            title=title,
            description=desc,
        ),
                         embed_fields=fields,
                         embed_footer=embed_footer_with_state(state))
Example #6
0
    def embed(cls, state: MonsterListViewState):
        fields = []
        if not cls.has_subqueries(state):
            fields.append(
                EmbedField(
                    state.title,
                    Box(*cls.monster_list(state.monster_list,
                                          state.current_monster_id,
                                          state.query_settings))))

        else:
            cur_subq_id = None
            cur_mon_list = []
            offset = 0
            i = 0
            for m in state.monster_list:
                subq_id = state.extra_info.get_subquery_mon(m.monster_id)
                if cur_mon_list and subq_id != cur_subq_id:
                    title = MonsterHeader.box_with_emoji(
                        state.extra_info.get_monster(cur_subq_id),
                        query_settings=state.query_settings,
                        link=False)
                    fields.append(
                        EmbedField(
                            title,
                            Box(*cls.monster_list(cur_mon_list,
                                                  state.current_monster_id,
                                                  state.query_settings,
                                                  offset=offset))))
                    cur_mon_list = []
                    offset += i
                    i = 0
                cur_mon_list.append(m)
                cur_subq_id = subq_id
                i += 1

            title = MonsterHeader.box_with_emoji(
                state.extra_info.get_monster(cur_subq_id),
                query_settings=state.query_settings,
                link=False)
            fields.append(
                EmbedField(
                    title,
                    Box(*cls.monster_list(cur_mon_list,
                                          state.current_monster_id,
                                          state.query_settings,
                                          offset=offset))))

        fields.append(
            EmbedField(BoldText('Page'),
                       Box('{} of {}'.format(state.current_page + 1,
                                             state.page_count)),
                       inline=True))

        return EmbedView(EmbedMain(
            title=cls.get_title(state),
            color=state.query_settings.embedcolor,
        ),
                         embed_footer=embed_footer_with_state(state),
                         embed_fields=fields)
Example #7
0
    def embed(cls, state: TransformInfoViewState):
        base_mon = state.base_mon
        transformed_mon = state.transformed_mon
        lsmultiplier = state.query_settings.lsmultiplier
        fields = [
            EmbedField(
                '/'.join(['{}'.format(t.name) for t in transformed_mon.types]),
                Box(
                    Box(get_emoji(cls.up_emoji_name),
                        cls.normal_awakenings_row(transformed_mon)
                        if len(transformed_mon.awakenings) != 0 else Box(
                            Text('No Awakenings')),
                        delimiter=' '), TransformInfoView.base_info(base_mon),
                    cls.killers_row(base_mon, base_mon)),
            ),
            EmbedField(BoldText(transformat('Card info')),
                       TransformInfoView.card_info(base_mon, transformed_mon,
                                                   state.acquire_raw),
                       inline=True),
            EmbedField(BoldText('Stats -> ' + transformat('Transform')),
                       TransformInfoView.stats(base_mon, transformed_mon),
                       inline=True),
            EmbedField(
                transformat(
                    TransformInfoView.transform_active_header(
                        transformed_mon).to_markdown()),
                Box(
                    Text(
                        cls.active_skill_text(transformed_mon.active_skill,
                                              state.awoken_skill_map)),
                    TransformInfoView.base_active_header(
                        base_mon).to_markdown(),
                    Text(
                        cls.active_skill_text(base_mon.active_skill,
                                              state.awoken_skill_map)))),
            EmbedField(
                transformat(
                    TransformInfoView.leader_header(transformed_mon, False,
                                                    lsmultiplier,
                                                    base_mon).to_markdown()),
                Box(
                    Text(transformed_mon.leader_skill.desc if transformed_mon.
                         leader_skill else 'None'),
                    TransformInfoView.leader_header(base_mon, True,
                                                    lsmultiplier,
                                                    base_mon).to_markdown(),
                    Text(base_mon.leader_skill.desc if base_mon.
                         leader_skill else 'None')))
        ]

        return EmbedView(EmbedMain(color=state.color,
                                   title=MonsterHeader.fmt_id_header(
                                       transformed_mon, False,
                                       state.is_jp_buffed).to_markdown(),
                                   url=puzzledragonx(transformed_mon)),
                         embed_thumbnail=EmbedThumbnail(
                             MonsterImage.icon(transformed_mon)),
                         embed_footer=embed_footer_with_state(state),
                         embed_fields=fields)
Example #8
0
 def embed(cls, state: ClosableEmbedViewState, props: PADleMonsterConfirmationViewProps):
     return EmbedView(
         EmbedMain(
             color=Color.red(),
             title=props.title,
         ),
         embed_footer=embed_footer_with_state(state, text="Click the X to close.")
     )
Example #9
0
 def embed(state: SimpleViewState):
     fields = [EmbedField("Title", Box(*["1", '2']))]
     return EmbedView(
         EmbedMain(color="black",
                   description=state.message_list[state.index]),
         embed_fields=fields,
         embed_footer=embed_footer_with_state(state),
     )
 def embed(state: LeaderSkillSingleViewState):
     ls = state.mon.leader_skill
     return EmbedView(embed_main=EmbedMain(
         title=ls_single_multiplier_text(ls),
         description=Box(
             BoldText(MonsterHeader.name(state.mon, link=True,
                                         show_jp=True)),
             Text(ls.desc if ls else 'None')),
         color=state.color),
                      embed_footer=embed_footer_with_state(state))
Example #11
0
 def embed(state: LeaderSkillSingleViewState):
     ls = state.mon.leader_skill
     return EmbedView(embed_main=EmbedMain(
         title=ls_single_multiplier_text(ls),
         description=Box(
             BoldText(
                 MonsterHeader.box_with_emoji(
                     state.mon, query_settings=state.query_settings)),
             Text(ls.desc if ls else 'None')),
         color=state.query_settings.embedcolor),
                      embed_footer=embed_footer_with_state(state))
Example #12
0
 def embed(state: GlobalStatsViewState):
     description = GlobalStatsView.get_description(state)
     if state.num_days == state.current_day:
         return EmbedView(
             EmbedMain(
                 title=BoldText(f"PADle #{state.current_day}"),
                 color=state.query_settings.embedcolor,
             ),
             embed_fields=[EmbedField("Stats", Box(description))],
             embed_footer=embed_footer_with_state(state, text=GlobalStatsView.get_pages_footer(state)))
     else:
         return EmbedView(
             EmbedMain(
                 title=BoldText(f"PADle #{state.current_day}"),
                 description=Box(BoldText(MonsterHeader.menu_title(state.monster).to_markdown())),
                 color=state.query_settings.embedcolor,
             ),
             embed_fields=[EmbedField("Stats", Box(description))],
             embed_footer=embed_footer_with_state(state, text=GlobalStatsView.get_pages_footer(state)),
             embed_thumbnail=EmbedThumbnail(MonsterImage.icon(state.monster.monster_id)))
Example #13
0
    def embed(state, props: WhichViewProps):
        name = props.name
        definition = props.definition
        timestamp = props.timestamp
        success = props.success

        fields = get_fields(definition) if success else []

        return EmbedView(EmbedMain(color=state.color,
                                   title='Which {}'.format(name),
                                   description=get_description(
                                       definition, timestamp, success)),
                         embed_footer=embed_footer_with_state(state),
                         embed_fields=fields)
Example #14
0
 def embed(cls, state: OtherInfoViewState):
     m: "MonsterModel" = state.monster
     return EmbedView(
         EmbedMain(
             color=state.color,
             title=MonsterHeader.fmt_id_header(
                 state.monster,
                 state.alt_monsters[0].monster.monster_id == cls.TSUBAKI,
                 state.is_jp_buffed).to_markdown(),
             url=puzzledragonx(m)),
         embed_footer=embed_footer_with_state(state),
         embed_fields=[
             EmbedField(
                 "Stats at +297:",
                 Box(
                     # need to put these on the same line to get around discord's insane
                     # whitespace margins around code blocks
                     Text(statsbox(m, plus=297) + 'Stats at +0:'),
                     Text(statsbox(m, plus=0)),
                     LabeledText("JP Name", m.name_ja),
                     LinksView.linksbox(m),
                     LabeledText("JP Added", str(m.reg_date))
                     if m.reg_date else None,
                     LabeledText("Series", m.series.name_en),
                     Box(LabeledText("Sell MP", '{:,}'.format(m.sell_mp)),
                         LabeledText("Buy MP", '{:,}'.format(m.buy_mp))
                         if m.buy_mp else None,
                         delimiter='  '),
                     Box(
                         LabeledText("Sell Gold",
                                     '{:,}'.format(m.sell_gold))),
                     Box(LabeledText(
                         "XP to Max",
                         '{:.1f}'.format(m.exp /
                                         1000000).rstrip('0').rstrip('.') +
                         'M' if m.exp >= 1000000 else '{:,}'.format(m.exp)),
                         LabeledText("Max Level", str(m.level)),
                         delimiter='  '),
                     Box(LabeledText("Weighted Stats", str(m.stats()[3])),
                         Text('LB {} (+{}%)'.format(
                             m.stats(lv=110)[3], m.limit_mult))
                         if m.limit_mult > 0 else None,
                         delimiter=' | '),
                     LabeledText("Fodder EXP", '{:,}'.format(m.fodder_exp)),
                     Box(LabeledText("Rarity", str(m.rarity)),
                         LabeledText("Cost", str(m.cost)),
                         delimiter=' '))),
             cls.evos_embed_field(state)
         ])
Example #15
0
    def embed(cls, state: AzurlaneViewState):
        c = state.c

        cid = c['id']
        name = c['name_en']
        image = c['images'][state.image_idx]
        image_title = image['title']

        url = image['url']

        return EmbedView(EmbedMain(color=state.query_settings.embedcolor,
                                   title=f'[{cid}] {name} - {image_title}',
                                   url=url),
                         embed_body_image=EmbedBodyImage(url),
                         embed_footer=embed_footer_with_state(state))
Example #16
0
    def embed(cls, state: MonsterListViewState):
        fields = [
            EmbedField(
                state.title,
                Box(*cls.monster_list(state.monster_list,
                                      state.current_monster_id))),
            EmbedField(BoldText('Page'),
                       Box('{} of {}'.format(state.current_page + 1,
                                             state.page_count)),
                       inline=True)
        ]

        return EmbedView(EmbedMain(color=state.color, ),
                         embed_footer=embed_footer_with_state(state),
                         embed_fields=fields)
Example #17
0
 def embed(state, props: IdTracebackViewProps):
     return EmbedView(
         EmbedMain(color=state.color,
                   title=MonsterHeader.fmt_id_header(props.monster,
                                                     use_emoji=True),
                   description=get_description(props.score)),
         embed_fields=[
             EmbedField('Matched Name Tokens', Box(props.name_tokens)),
             EmbedField('Matched Modifier Tokens',
                        Box(props.modifier_tokens)),
             EmbedField('Equally-scoring matches',
                        Box(props.lower_priority_monsters)),
         ],
         embed_footer=embed_footer_with_state(state),
     )
Example #18
0
 def embed(cls, state: ClosableEmbedViewState,
           props: PersonalStatsViewProps):
     return EmbedView(EmbedMain(
         title=f"{props.username}'s PADle Stats",
         description=
         (f"**Games Played**: {props.played}\n"
          f"**Win Rate**: {props.win_rate:.2%}\n"
          f"**Current Streak**: {props.cur_streak}\n"
          f"**Max Streak**: {props.max_streak}\n"
          f"**Favorite Guessed Monster**: {MonsterHeader.menu_title(props.monster).to_markdown()}"
          ),
         color=props.query_settings.embedcolor),
                      embed_thumbnail=EmbedThumbnail(
                          MonsterImage.icon(props.monster.monster_id)),
                      embed_footer=embed_footer_with_state(
                          state, text="Click the X to close."))
Example #19
0
 def embed(state, props: IdTracebackViewProps):
     return EmbedView(
         EmbedMain(color=state.query_settings.embedcolor,
                   title=MonsterHeader.menu_title(props.monster,
                                                  use_emoji=True),
                   description=Box(
                       LabeledText('Total score', str(round(props.score,
                                                            2))))),
         embed_fields=[
             EmbedField('Matched Name Tokens', Box(props.name_tokens)),
             EmbedField('Matched Modifier Tokens',
                        Box(props.modifier_tokens)),
             EmbedField('Equally-scoring matches',
                        Box(props.lower_priority_monsters)),
         ],
         embed_footer=embed_footer_with_state(state),
     )
Example #20
0
    def embed(cls, state: PantheonViewState):
        fields = [EmbedField(
            'Pantheon: {}'.format(state.series_name),
            Box(*_pantheon_lines(state.pantheon_list, state.base_monster, state.query_settings))
        ),
            cls.evos_embed_field(state)]

        return EmbedView(
            EmbedMain(
                color=state.query_settings.embedcolor,
                title=MonsterHeader.menu_title(state.monster,
                                               is_tsubaki=state.alt_monsters[0].monster.monster_id == cls.TSUBAKI,
                                               is_jp_buffed=state.is_jp_buffed).to_markdown(),
                url=MonsterLink.header_link(state.monster, state.query_settings)),
            embed_footer=embed_footer_with_state(state),
            embed_fields=fields,
            embed_thumbnail=EmbedThumbnail(MonsterImage.icon(state.monster.monster_id)),
        )
Example #21
0
    def embed(state: AwakeningListViewState):
        fields = [
            EmbedField(
                'Awakenings - by {}'.format(
                    'name' if state.sort_type ==
                    AwakeningListSortTypes.alphabetical else 'id number'),
                Box(*[
                    get_awoken_skill_description(awo)
                    for awo in state.paginated_skills[state.current_page]
                ])),
            EmbedField(
                'Page',
                Box('{} of {}'.format(str(state.current_page + 1),
                                      str(len(state.paginated_skills)))))
        ]

        return EmbedView(EmbedMain(color=state.color, ),
                         embed_footer=embed_footer_with_state(state),
                         embed_fields=fields)
Example #22
0
    def embed(cls, state: IdViewState):
        m = state.monster
        fields = [
            EmbedField(
                '/'.join(['{}'.format(t.name) for t in m.types]),
                Box(IdView.all_awakenings_row(m, state.transform_base),
                    cls.killers_row(m, state.transform_base))),
            EmbedField(
                'Inheritable' if m.is_inheritable else 'Not inheritable',
                IdView.misc_info(m, state.true_evo_type_raw, state.acquire_raw,
                                 state.base_rarity),
                inline=True),
            EmbedField(IdView.stats_header(m, state.previous_evolutions,
                                           state.query_settings).to_markdown(),
                       IdView.stats(m, state.previous_evolutions,
                                    state.query_settings),
                       inline=True),
            EmbedField(
                cls.active_skill_header(
                    m, state.previous_transforms).to_markdown(),
                Text(
                    cls.active_skill_text(m.active_skill,
                                          state.awoken_skill_map))),
            EmbedField(
                cls.leader_skill_header(m, state.query_settings.lsmultiplier,
                                        state.transform_base).to_markdown(),
                Text(m.leader_skill.desc if m.leader_skill else 'None')),
            cls.evos_embed_field(state)
        ]

        return EmbedView(
            EmbedMain(color=state.query_settings.embedcolor,
                      title=MonsterHeader.menu_title(
                          m,
                          is_tsubaki=state.alt_monsters[0].monster.monster_id
                          == cls.TSUBAKI,
                          is_jp_buffed=state.is_jp_buffed).to_markdown(),
                      url=MonsterLink.header_link(m, state.query_settings)),
            embed_thumbnail=EmbedThumbnail(MonsterImage.icon(m.monster_id)),
            embed_footer=embed_footer_with_state(state),
            embed_fields=fields)
Example #23
0
    def embed(state, props: AwakeningHelpViewProps):
        monster = props.monster

        fields = [
            EmbedField('Normal Awakenings', get_normal_awakenings(monster)),
            EmbedField('Super Awakenings', get_super_awakenings(monster))
        ]

        return EmbedView(
            EmbedMain(
                color=state.color,
                description='This monster has no awakenings.' if not monster.awakenings else ''
            ),
            embed_author=EmbedAuthor(
                MonsterHeader.long_v2(monster).to_markdown(),
                puzzledragonx(monster),
                MonsterImage.icon(monster)
            ),
            embed_footer=embed_footer_with_state(state),
            embed_fields=fields
        )
Example #24
0
    def embed(cls, state: PantheonViewState):
        fields = [
            EmbedField(
                'Pantheon: {}'.format(state.series_name),
                Box(*_pantheon_lines(state.pantheon_list,
                                     state.base_monster))),
            cls.evos_embed_field(state)
        ]

        return EmbedView(
            EmbedMain(
                color=state.color,
                title=MonsterHeader.fmt_id_header(
                    state.monster,
                    state.alt_monsters[0].monster.monster_id == cls.TSUBAKI,
                    state.is_jp_buffed).to_markdown(),
                url=puzzledragonx(state.monster)),
            embed_footer=embed_footer_with_state(state),
            embed_fields=fields,
            embed_thumbnail=EmbedThumbnail(MonsterImage.icon(state.monster)),
        )
Example #25
0
    def embed(state: ClosableEmbedViewState, props: AwakeningHelpViewProps):
        monster = props.monster
        show_help = state.query_settings.showhelp.value
        token_map = props.token_map
        fields = [
            EmbedField('Normal Awakenings',
                       get_normal_awakenings(monster, show_help, token_map)),
            EmbedField('Super Awakenings',
                       get_super_awakenings(monster, show_help, token_map))
        ]

        return EmbedView(
            EmbedMain(color=state.query_settings.embedcolor,
                      description='This monster has no awakenings.'
                      if not monster.awakenings else ''),
            embed_author=EmbedAuthor(
                MonsterHeader.menu_title(monster).to_markdown(),
                MonsterLink.header_link(monster,
                                        query_settings=state.query_settings),
                MonsterImage.icon(monster.monster_id)),
            embed_footer=embed_footer_with_state(state),
            embed_fields=fields)
Example #26
0
    def embed(cls, state: EvosViewState):
        fields = [
            EmbedField(
                ("{} evolution" if len(state.alt_versions) == 1 else "{} evolutions").format(len(state.alt_versions)),
                Box(*EvosView._evo_lines(state.alt_versions, state.monster)))]

        if state.gem_versions:
            fields.append(
                EmbedField(
                    ("{} evolve gem" if len(state.gem_versions) == 1 else "{} evolve gems").format(
                        len(state.gem_versions)),
                    Box(*EvosView._evo_lines(state.gem_versions, state.monster))))

        return EmbedView(
            EmbedMain(
                color=state.color,
                title=MonsterHeader.fmt_id_header(state.monster,
                                                  state.alt_monsters[0].monster.monster_id == cls.TSUBAKI,
                                                  state.is_jp_buffed).to_markdown(),
                url=puzzledragonx(state.monster)),
            embed_thumbnail=EmbedThumbnail(MonsterImage.icon(state.monster)),
            embed_footer=embed_footer_with_state(state),
            embed_fields=fields)
Example #27
0
    def embed(cls, state: PicViewState):
        url = MonsterImage.picture(state.monster.monster_id)
        animated = state.monster.has_animation
        fields = [EmbedField(
            'Extra Links',
            Box(
                Box(
                    Text('Animation:'),
                    LinkedText('(MP4)', MonsterImage.video(state.monster.monster_no_jp)),
                    Text('|'),
                    LinkedText('(GIF)', MonsterImage.gif(state.monster.monster_no_jp)),
                    delimiter=' '
                ) if animated else None,
                Box(
                    Text('Orb Skin:'),
                    LinkedText('Regular', MonsterImage.orb_skin(state.monster.orb_skin_id)),
                    Text('|'),
                    LinkedText('Color Blind', MonsterImage.orb_skin_colorblind(state.monster.orb_skin_id)),
                    delimiter=' '
                ) if state.monster.orb_skin_id else None,
            )
        ),
            cls.evos_embed_field(state)
        ]

        return EmbedView(
            EmbedMain(
                color=state.query_settings.embedcolor,
                title=MonsterHeader.menu_title(state.monster,
                                               is_tsubaki=state.alt_monsters[0].monster.monster_id == cls.TSUBAKI,
                                               is_jp_buffed=state.is_jp_buffed).to_markdown(),
                url=MonsterLink.header_link(state.monster, state.query_settings)
            ),
            embed_footer=embed_footer_with_state(state),
            embed_fields=fields,
            embed_body_image=EmbedBodyImage(url),
        )
Example #28
0
    def embed(state: SeriesScrollViewState):
        fields = [
            EmbedField(BoldText('Current rarity: {}'.format(state.rarity)),
                       Box(*SeriesScrollView._monster_list(
                           state.monster_list,
                           state.current_index))),
            EmbedField(BoldText('Rarities'),
                       Box(
                           SeriesScrollView._all_rarity_text(state),
                       ), inline=True
                       ),
            EmbedField(BoldText('Page'),
                       Box('{} of {}'.format(state.current_page + 1, state.pages_in_rarity)),
                       inline=True
                       )
        ]

        return EmbedView(
            EmbedMain(
                title=state.title,
                color=state.color,
            ),
            embed_footer=embed_footer_with_state(state),
            embed_fields=fields)
Example #29
0
 def embed(state: SimpleTextViewState):
     return EmbedView(
         EmbedMain(color=state.color, description=state.message),
         embed_footer=embed_footer_with_state(state),
     )
 def embed(state, props: ExperienceCurveViewProps):
     regular = get_normal_exp_difference(props.monster, props.low,
                                         props.high, props.offset)
     lb = get_lb_exp_difference(props.monster, props.low, props.high,
                                props.offset)
     slb = get_slb_exp_difference(props.monster, props.low, props.high,
                                  props.offset)
     is_light = props.monster.full_damage_attr.value == 3
     return EmbedView(
         EmbedMain(
             color=state.color,
             title=MonsterHeader.fmt_id_header(props.monster,
                                               use_emoji=True),
             url=puzzledragonx(props.monster),
             description=Text(f'lv{props.low} -> lv{props.high} (' +
                              (trunc_humanize(props.monster.exp_curve)
                               if props.monster.exp_curve else "no") +
                              f' curve)'),
         ),
         embed_thumbnail=EmbedThumbnail(MonsterImage.icon(props.monster)),
         embed_fields=[
             EmbedField(title='Exact',
                        body=Box(
                            LabeledText("Reg", humanize_number(regular)),
                            LabeledText("LB", humanize_number(lb)),
                            LabeledText("SLB", humanize_number(slb)),
                            LabeledText("Net",
                                        humanize_number(regular + lb +
                                                        slb))),
                        inline=True),
             EmbedField(title='Approx',
                        body=Box(
                            LabeledText("Reg", trunc_humanize(regular)),
                            LabeledText("LB", trunc_humanize(lb)),
                            LabeledText("SLB", trunc_humanize(slb)),
                            LabeledText("Net",
                                        trunc_humanize(regular + lb +
                                                       slb))),
                        inline=True),
             EmbedField(
                 title='Resources',
                 body=Box(
                     LabeledText(
                         "Globes " + emoji_cache.get_emoji(
                             f'orb_{props.monster.full_damage_attr.name.lower()}'
                         ),
                         str(
                             get_total_needed(
                                 props.monster, props.low, props.high,
                                 props.offset,
                                 ceil(1.5 * GLOBE_EXP[
                                     props.monster.full_damage_attr.value]),
                                 is_light))),
                     LabeledText(
                         "TA2",
                         str(
                             get_total_needed(props.monster, props.low,
                                              props.high, props.offset,
                                              TA2_EXP, is_light))),
                     LabeledText(
                         "TA3",
                         str(
                             get_total_needed(props.monster, props.low,
                                              props.high, props.offset,
                                              TA3_EXP, is_light))),
                 ),
                 inline=True)
         ],
         embed_footer=embed_footer_with_state(state))