def stats(cls, base_mon: "MonsterModel", transformed_mon: "MonsterModel"): base_hp, base_atk, base_rcv, base_weighted = base_mon.stats() tf_hp, tf_atk, tf_rcv, tf_weighed = transformed_mon.stats() return Box( LabeledText('HP', _get_tf_stat_diff_text(base_hp, tf_hp)), LabeledText('ATK', _get_tf_stat_diff_text(base_atk, tf_atk)), LabeledText('RCV', _get_tf_stat_diff_text(base_rcv, tf_rcv)))
def stats(cls, m: "MonsterModel", previous_evolutions, query_settings: QuerySettings): plus = cls.get_plus_status(previous_evolutions, query_settings.cardplus) multiplayer = query_settings.cardmode == CardModeModifier.coop lb_level = 110 if query_settings.cardlevel == CardLevelModifier.lv110 else 120 hp, atk, rcv, weighted = m.stats(plus=plus, multiplayer=multiplayer) lb_hp, lb_atk, lb_rcv, lb_weighted = (None, None, None, None) if m.limit_mult > 0: lb_hp, lb_atk, lb_rcv, lb_weighted = m.stats( plus=plus, lv=lb_level, multiplayer=multiplayer) return Box( LabeledText( 'HP', _get_stat_text(hp, lb_hp, _get_awakening_emoji_for_stats(m, 1))), LabeledText( 'ATK', _get_stat_text(atk, lb_atk, _get_awakening_emoji_for_stats(m, 2))), LabeledText( 'RCV', _get_stat_text(rcv, lb_rcv, _get_awakening_emoji_for_stats(m, 3))), LabeledText('Fodder EXP', "{:,}".format(m.fodder_exp)) if _monster_is_enhance(m) else None)
def stats(m: "MonsterModel"): hp, atk, rcv, weighted = m.stats() lb_hp, lb_atk, lb_rcv, lb_weighted = m.stats(lv=110) if m.limit_mult > 0 else (None, None, None, None) return Box( LabeledText('HP', _get_stat_text(hp, lb_hp, _get_awakening_emoji_for_stats(m, 1))), LabeledText('ATK', _get_stat_text(atk, lb_atk, _get_awakening_emoji_for_stats(m, 2))), LabeledText('RCV', _get_stat_text(rcv, lb_rcv, _get_awakening_emoji_for_stats(m, 3))), LabeledText('Fodder EXP', "{:,}".format(m.fodder_exp)) if _monster_is_enhance(m) else None )
def card_info(base_mon: "MonsterModel", transformed_mon: "MonsterModel", acquire_raw): rarity = Box(LabeledText( 'Rarity', '{} -> {}'.format(base_mon.rarity, transformed_mon.rarity)), Text("" if base_mon.orb_skin_id is None else "(Orb Skin)"), delimiter=' ') cost = LabeledText('Cost', '{} -> {}'.format(base_mon.cost, transformed_mon.cost)) acquire = BoldText(acquire_raw) if acquire_raw else None return Box(rarity, cost, acquire)
def misc_info(m: "MonsterModel", true_evo_type_raw: str, acquire_raw: str, base_rarity: str): rarity = Box( LabeledText('Rarity', str(m.rarity)), Text('({})'.format(LabeledText('Base', str(base_rarity)).to_markdown())), Text("" if m.orb_skin_id is None else "(Orb Skin)"), delimiter=' ' ) cost = LabeledText('Cost', str(m.cost)) acquire = BoldText(acquire_raw) if acquire_raw else None valid_true_evo_types = ("Reincarnated", "Assist", "Pixel", "Super Reincarnated") true_evo_type = BoldText(true_evo_type_raw) if true_evo_type_raw in valid_true_evo_types else None return Box(rarity, cost, acquire, true_evo_type)
def get_description(score: int): return Box( LabeledText( 'Total score', str(round(score, 2)) ) )
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) )
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), )
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) ])
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))
def embed(state: OtherInfoViewState): m = state.monster return EmbedView( EmbedMain(color=state.color, title=MonsterHeader.long_v2(m).to_markdown(), url=puzzledragonx(m)), embed_footer=pad_info_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=' '))) ])