Exemple #1
0
def base_info(m: "MonsterModel"):
    return Box(
        Box('\N{DOWN-POINTING RED TRIANGLE}',
            IdView.normal_awakenings_row(m) if len(m.awakenings) != 0 else Box(
                Text('No Awakenings')),
            delimiter=' '),
        IdView.super_awakenings_row(m),
        # the transform base of the base is the same
        IdView.killers_row(m, m))
Exemple #2
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)
Exemple #3
0
 def id_control(state: IdViewState):
     if state is None:
         return None
     reaction_list = state.reaction_list
     return EmbedControl(
         [IdView.embed(state)], reaction_list
         or [emoji_cache.get_by_name(e) for e in IdMenuPanes.emoji_names()])
Exemple #4
0
 def id_control(state: IdViewState):
     if state is None:
         return None
     return EmbedControl(
         [IdView.embed(state)],
         state.reaction_list or NaDiffMenuPanes.emoji_names()
     )
Exemple #5
0
def leader_header(m: "MonsterModel", is_base: bool):
    if is_base:
        emoji = BASE_EMOJI
        label = 'Base'
    else:
        emoji = TRANSFORM_EMOJI
        label = 'Transform'
    leader_skill = m.leader_skill

    return Box(emoji,
               BoldText(label),
               IdView.leader_skill_header(m).to_markdown(),
               delimiter=' ')
Exemple #6
0
 async def make_id_embed(self, m: "MonsterModel"):
     color = await self.get_user_embed_color(self.ctx.bot.get_cog("PadInfo")
                                             )
     transform_base, true_evo_type_raw, acquire_raw, base_rarity, alt_monsters = \
         await IdViewState.query(self.dgcog, m)
     state = IdViewState("",
                         "TODO",
                         "todo",
                         "",
                         color,
                         m,
                         transform_base,
                         true_evo_type_raw,
                         acquire_raw,
                         base_rarity,
                         alt_monsters,
                         use_evo_scroll=settings.checkEvoID(
                             self.ctx.author.id))
     e = IdView.embed(state)
     return e.to_embed()
Exemple #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(
                    IdView.normal_awakenings_row(transformed_mon)
                    if len(transformed_mon.awakenings) != 0 else Box(
                        Text('No Awakenings')), base_info(base_mon)),
            ),
            EmbedField('Card info',
                       IdView.misc_info(transformed_mon,
                                        state.true_evo_type_raw,
                                        state.acquire_raw, state.base_rarity),
                       inline=True),
            EmbedField(IdView.stats_header(transformed_mon).to_markdown(),
                       IdView.stats(transformed_mon),
                       inline=True),
            EmbedField(
                IdView.active_skill_header(transformed_mon).to_markdown() +
                base_skill(base_mon),
                Text(transformed_mon.active_skill.desc if transformed_mon.
                     active_skill else 'None')),
            EmbedField(
                IdView.leader_skill_header(transformed_mon).to_markdown(),
                Text(transformed_mon.leader_skill.desc if transformed_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=pad_info_footer_with_state(state),
                         embed_fields=fields)
Exemple #8
0
 def id_control(state: IdViewState):
     return EmbedWrapper(IdView.embed(state),
                         LeaderSkillMenuPanes.emoji_names())
Exemple #9
0
def base_info(m: "MonsterModel"):
    return Box(
        Box(BASE_EMOJI,
            IdView.normal_awakenings_row(m) if len(m.awakenings) != 0 else Box(
                Text('No Awakenings')),
            delimiter=' '), IdView.super_awakenings_row(m))
Exemple #10
0
 def id_control(state: IdViewState, reaction_list):
     return EmbedWrapper(IdView.embed(state), reaction_list)
Exemple #11
0
 def id_control(state: IdViewState):
     return EmbedControl(
         [IdView.embed(state)],
         [emoji_cache.get_by_name(e) for e in emoji_button_names]
     )
Exemple #12
0
 def id_control(state: IdViewState):
     return EmbedControl(
         [IdView.embed(state)],
         [emoji_cache.get_by_name(e) for e in LeaderSkillSingleMenuPanes.emoji_names()]
     )
 def id_control(state: IdViewState):
     if state is None:
         return None
     reaction_list = state.reaction_list
     return EmbedControl([IdView.embed(state)], reaction_list)
 def id_control(state: IdViewState):
     return EmbedControl([IdView.embed(state)],
                         LeaderSkillMenuPanes.emoji_names())
Exemple #15
0
def base_active_header(m: "MonsterModel"):
    return Box(BASE_EMOJI,
               BoldText('Base'),
               IdView.active_skill_header(m, m),
               delimiter=' ')
 def id_control(state: IdViewState, reaction_list):
     return EmbedControl(
         [IdView.embed(state)],
         reaction_list
     )
Exemple #17
0
 def id_control(state: IdViewState):
     if state is None:
         return None
     return EmbedWrapper(IdView.embed(state), state.reaction_list
                         or IdMenuPanes.emoji_names())