Esempio n. 1
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.long_maybe_tsubaki(
                                       state.monster,
                                       state.alt_monsters[0].monster.monster_id
                                       == cls.TSUBAKI).to_markdown(),
                                   url=puzzledragonx(state.monster)),
                         embed_thumbnail=EmbedThumbnail(
                             MonsterImage.icon(state.monster)),
                         embed_footer=embed_footer_with_state(state),
                         embed_fields=fields)
Esempio n. 2
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),
                    IdView.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).to_markdown(),
                       IdView.stats(m),
                       inline=True),
            EmbedField(
                IdView.active_skill_header(m,
                                           state.transform_base).to_markdown(),
                Text(m.active_skill.desc if m.active_skill else 'None')),
            EmbedField(
                IdView.leader_skill_header(m).to_markdown(),
                Text(m.leader_skill.desc if m.leader_skill else 'None')),
            evos_embed_field(state)
        ]

        return EmbedView(EmbedMain(color=state.color,
                                   title=MonsterHeader.long_maybe_tsubaki(
                                       m,
                                       state.alt_monsters[0].monster.monster_id
                                       == cls.TSUBAKI).to_markdown(),
                                   url=puzzledragonx(m)),
                         embed_thumbnail=EmbedThumbnail(MonsterImage.icon(m)),
                         embed_footer=embed_footer_with_state(state),
                         embed_fields=fields)
Esempio n. 3
0
 def embed(state: LeaderSkillSingleViewState):
     ls = state.mon.leader_skill
     return EmbedView(
         embed_main=EmbedMain(
             title=createSingleMultiplierText(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))
Esempio n. 4
0
 def embed(state, props: IdTracebackViewProps):
     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)),
     ]
     return EmbedView(EmbedMain(color=state.color,
                                title=get_title(props.monster),
                                description=get_description(props.score)),
                      embed_footer=embed_footer_with_state(state),
                      embed_fields=fields)
Esempio n. 5
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)
Esempio n. 6
0
    def embed(state: MonsterListViewState):
        fields = [
            EmbedField(state.title,
                       Box(state.subtitle,
                           *_monster_list(state.monster_list))),
            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)
Esempio n. 7
0
    def embed(state: TransformInfoViewState):
        base_mon = state.base_mon
        transformed_mon = state.transformed_mon

        fields = [
            EmbedField(
                '/'.join(['{}'.format(t.name) for t in transformed_mon.types]),
                Box(
                    Box(TRANSFORM_EMOJI,
                        IdView.normal_awakenings_row(transformed_mon)
                        if len(transformed_mon.awakenings) != 0 else Box(
                            Text('No Awakenings')),
                        delimiter=' '), base_info(base_mon),
                    IdView.killers_row(base_mon, base_mon)),
            ),
            EmbedField(BoldText(transformat('Card info')),
                       card_info(base_mon, transformed_mon, state.acquire_raw),
                       inline=True),
            EmbedField(BoldText('Stats -> ' + transformat('Transform')),
                       stats(base_mon, transformed_mon),
                       inline=True),
            EmbedField(
                transformat(
                    transform_active_header(transformed_mon).to_markdown()),
                Box(
                    Text(transformed_mon.active_skill.desc if transformed_mon.
                         active_skill else 'None'),
                    base_active_header(base_mon).to_markdown(),
                    Text(base_mon.active_skill.desc if base_mon.
                         active_skill else 'None'))),
            EmbedField(
                transformat(
                    leader_header(transformed_mon, False).to_markdown()),
                Box(
                    Text(transformed_mon.leader_skill.desc if transformed_mon.
                         leader_skill else 'None'),
                    leader_header(base_mon, True).to_markdown(),
                    Text(base_mon.leader_skill.desc if base_mon.
                         leader_skill else 'None')))
        ]

        return EmbedView(EmbedMain(
            color=state.color,
            title=MonsterHeader.long_v2(transformed_mon).to_markdown(),
            url=puzzledragonx(transformed_mon)),
                         embed_thumbnail=EmbedThumbnail(
                             MonsterImage.icon(transformed_mon)),
                         embed_footer=embed_footer_with_state(state),
                         embed_fields=fields)
Esempio n. 8
0
    def embed(state, props: AwakeningHelpViewProps):
        monster = props.monster

        fields = [
            EmbedField('Normal Awakenings', normal_awakenings(monster)),
            EmbedField('Super Awakenings', 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)
Esempio n. 9
0
    def embed(cls, state: PantheonViewState):
        fields = [EmbedField(
            'Pantheon: {}'.format(state.series_name),
            Box(*_pantheon_lines(state.pantheon_list, state.base_monster))
        ),
            evos_embed_field(state)]

        return EmbedView(
            EmbedMain(
                color=state.color,
                title=MonsterHeader.long_maybe_tsubaki(state.monster,
                                                       state.alt_monsters[0].monster.monster_id == cls.TSUBAKI
                                                       ).to_markdown(),
                url=puzzledragonx(state.monster)),
            embed_footer=embed_footer_with_state(state),
            embed_fields=fields,
            embed_thumbnail=EmbedThumbnail(MonsterImage.icon(state.monster)),
        )
Esempio n. 10
0
 def embed(cls, state: OtherInfoViewState):
     m: "MonsterModel" = state.monster
     return EmbedView(
         EmbedMain(color=state.color,
                   title=MonsterHeader.long_maybe_tsubaki(
                       state.monster,
                       state.alt_monsters[0].monster.monster_id ==
                       cls.TSUBAKI).to_markdown(),
                   url=puzzledragonx(m)),
         embed_footer=embed_footer_with_state(state),
         embed_fields=[
             EmbedField(
                 "Stats at +297:",
                 Box(
                     Text(statsbox(m)), LabeledText("JP Name", m.name_ja),
                     LinksView.linksbox(m),
                     LabeledText("History", m.history_us)
                     if m.history_us 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(
                         "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=' '))),
             evos_embed_field(state)
         ])
Esempio n. 11
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)
Esempio n. 12
0
    def embed(cls, state: PicViewState):
        url = MonsterImage.picture(state.monster)
        animated = state.monster.has_animation
        fields = [EmbedField(
            'Extra Links',
            Box(
                Box(
                    Text('Animation:'),
                    LinkedText('(MP4)', MonsterImage.video(state.monster)),
                    Text('|'),
                    LinkedText('(GIF)', MonsterImage.gif(state.monster)),
                    delimiter=' '
                ) if animated else None,
                Box(
                    Text('Orb Skin:'),
                    LinkedText('Regular', MonsterImage.orb_skin(state.monster)),
                    Text('|'),
                    LinkedText('Color Blind', MonsterImage.orb_skin_colorblind(state.monster)),
                    delimiter=' '
                ) if state.monster.orb_skin_id else None,
            )
        ),
            evos_embed_field(state)
        ]

        return EmbedView(
            EmbedMain(
                color=state.color,
                title=MonsterHeader.long_maybe_tsubaki(state.monster,
                                                       state.alt_monsters[0].monster.monster_id == cls.TSUBAKI
                                                       ).to_markdown(),
                url=puzzledragonx(state.monster)),
            embed_footer=embed_footer_with_state(state),
            embed_fields=fields,
            embed_body_image=EmbedBodyImage(url),
        )
Esempio n. 13
0
 def embed(state: SimpleTextViewState):
     return EmbedView(
         EmbedMain(color=state.color, description=state.message),
         embed_footer=embed_footer_with_state(state),
     )