def linksbox(m): return Box( LinkedText('YouTube', youtube_search(m)), LinkedText('Skyozora', skyozora(m)), LinkedText('PDX', puzzledragonx(m)), LinkedText('Ilmina', ilmina(m)), delimiter=' | ')
def embed(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, )) ] return EmbedView( EmbedMain(color=state.color, title=MonsterHeader.long_v2(state.monster).to_markdown(), url=puzzledragonx(state.monster)), embed_footer=pad_info_footer_with_state(state), embed_fields=fields, embed_body_image=EmbedBodyImage(url), )
def embed_fields(cls, dungeons): ret = [] for dungeon in dungeons: ret.append( LinkedText(cls.escape_name(dungeon['name']), cls.dungeon_link.format(dungeon['idx']))) for subdungeon in dungeon['subdungeons']: ret.append( Box("\u200b \u200b \u200b \u200b \u200b ", LinkedText( cls.escape_name(subdungeon['name']), cls.subdungeon_link.format(subdungeon['idx'])), delimiter='')) return [EmbedField('Dungeons', Box(*ret, delimiter='\n'))]
def evos_embed_field(state: ViewStateBaseId): field_text = "**Evos**" help_text = "" # this isn't used right now, but maybe later if discord changes the api for embed titles...? help_link = "https://github.com/TsubakiBotPad/pad-cogs/wiki/Evolutions-mini-view" legend_parts = [] if any([ alt_evo.evolution and not alt_evo.evolution.reversible for alt_evo in state.alt_monsters ]): legend_parts.append("⌊Irreversible⌋") if any([alt_evo.monster.is_equip for alt_evo in state.alt_monsters]): legend_parts.append("⌈Equip⌉") if legend_parts: help_text = ' – Help: {}'.format(" ".join(legend_parts)) return EmbedField( field_text + help_text, HighlightableLinks( links=[ LinkedText(alt_fmt(me, state), puzzledragonx(me.monster)) for me in state.alt_monsters ], highlighted=next( i for i, me in enumerate(state.alt_monsters) if state.monster.monster_id == me.monster.monster_id)))
def short_with_emoji(m: "MonsterModel", link=True, prefix=None): msg = f"{m.monster_no_na} - {m.name_en}" return Box(prefix, Text(get_attribute_emoji_by_monster(m)), LinkedText(msg, puzzledragonx(m)) if link else Text(msg), Text(MonsterHeader.jp_suffix(m, False)), delimiter=' ')
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), )
def embed(state: IdViewState): m = state.monster fields = [ EmbedField( '/'.join(['{}'.format(t.name) for t in m.types]), Box( IdView.all_awakenings_row(m), 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).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') ), EmbedField( "Alternate Evos", HighlightableLinks( links=[LinkedText(str(m.monster_no_na), puzzledragonx(m)) for m in state.alt_monsters], highlighted=next(i for i, mon in enumerate(state.alt_monsters) if m.monster_id == mon.monster_id) ) ) ] return EmbedView( EmbedMain( color=state.color, title=MonsterHeader.long_v2(m).to_markdown(), url=puzzledragonx(m)), embed_thumbnail=EmbedThumbnail(MonsterImage.icon(m)), embed_footer=pad_info_footer_with_state(state), embed_fields=fields)
def skillup_field(mons, sec, link): text = None text2 = None if len(mons) == 0: text = "None" if sec: text2 = Box( f"({max(len(mons) - MAX_MONS_TO_SHOW, 0) + sec} ", LinkedText(f"more monster{'s' if max(len(mons) - MAX_MONS_TO_SHOW, 0) + sec > 1 else ''}", link), f", incl. {sec} alt evo{'s' if sec > 1 else ''})", delimiter="") elif len(mons) > MAX_MONS_TO_SHOW: text2 = f"({len(mons) - MAX_MONS_TO_SHOW} more monsters)" return EmbedField( "Skillups", Box(*(MonsterHeader.short_with_emoji(em) for em in mons[:MAX_MONS_TO_SHOW]), text, text2))
def long_v2(m: "MonsterModel", link=False): msg = '[{}] {}{}'.format(m.monster_no_na, m.name_en, MonsterHeader.jp_suffix(m)) return LinkedText(msg, puzzledragonx(m)) if link else Text(msg)
def name(cls, m: "MonsterModel", link=False, show_jp=False): msg = '[{}] {}{}'.format(m.monster_no_na, m.name_en, cls.jp_suffix(m) if show_jp else '') return LinkedText(msg, puzzledragonx(m)) if link else Text(msg)
def linksbox(m): return Box(LinkedText('YouTube', MonsterLink.youtube_search(m)), LinkedText('Skyozora', MonsterLink.skyozora(m)), LinkedText('PADIndex', MonsterLink.padindex(m)), LinkedText('Ilmina', MonsterLink.ilmina(m)), delimiter=' | ')