Exemple #1
0
    async def get_slayer_embed(self, ctx, player : skypy.Player):
        player.load_skills_slayers(False)
        if not player.enabled_api["skills"]:
            return await Embed(self.bot, ctx.author, title="Error", description="Your skills API is disabled. Please enable it and try again.").set_requested_by_footer()

        slayerNames = {"zombie": "Revenent Horror", "spider": "Tarantula Broodfather", "wolf": "Sven Packmaster"}
        embed = await Embed(self.bot, ctx.author, title=f"{self.format_name(player.uname)} slayer stats on {player.profile_name}").set_requested_by_footer()
        for slayer in player.slayers:
            embed.add_field(name=f"{slayerNames[slayer]}\nLEVEL {player.slayers[slayer]}", value=f"{player.slayers_needed[slayer]:,} XP\nto next level")
        for slayer in player.slayers:
            string = ''
            for i, bossLevel in enumerate(player.slayer_boss_kills[slayer]):
                string += f"\n**Tier {i + 1}** Kills: {player.slayer_boss_kills[slayer][bossLevel]}"
            embed.add_field(name="\u200b", value=string)
        embed.add_field(name="Total Slayer XP", value=f"{player.total_slayer_xp:,} XP")
        embed.add_field(name="Total Boss Kills",  value=f"{player.total_boss_kills} kills")
        embed.add_field(name="Total Spend", value=f"{player.slayer_total_spend:,} coins")
        return embed
Exemple #2
0
    async def get_stats_embed(self, ctx, player : skypy.Player):
        player.load_banking(False)
        player.load_misc(False)
        player.load_skills_slayers(False)

        name = self.format_name(player.uname)

        percentages = ["crit_chance", "speed", "crit_damage", "bonus_attack_speed", "sea_creature_chance"]
        icons = {
                'health': "❤️", 'defense': "🛡️", 'effective_health': "💕", 'strength': "⚔️",
                'speed': "🏃‍♂️", 'crit_chance': "🎲", 'crit_damage': "☠️", 'bonus_attack_speed': "🗯️",
                'intelligence': "🧠", 'sea_creature_chance': "🎣", 'magic_find': "⭐", 'pet_luck': "🦜"}

        if player.enabled_api["skills"]:
            description = f"Average skill level: {player.skill_average}"
        else:
            description = "Average skill level: Skills Api disabled"
        embed = Embed(self.bot, ctx.author, title=f"{name} Stats on {player.profile_name}", description=description)
        await embed.set_patron_footer()
        embed.set_thumbnail(url=player.avatar())

        for name, stat in player.stats.items():
            if name == "damage" or name == "damage_increase": continue
            if name in percentages:
                stat = str(stat) + "%"
            else:
                stat = f"{stat:,}"
            embed.add_field(name=f"{icons[name]} " + name.replace("_", " ").capitalize(), value=stat)

        embed.add_field(name="🌈 Fairy souls", value=player.fairy_souls_collected)
        if player.enabled_api["banking"]:
            embed.add_field(name="🏦 Bank Balance", value=f"{round(player.bank_balance):,}")
            embed.add_field(name="💰 Purse", value=f"{round(player.purse):,}")
        online = await player.is_online()
        embed.add_field(name="🟢 Currently online" if online else "🔴Currently online", value="Yes" if online else "No")
        embed.add_field(name="🚪 Join date", value=str(player.join_date.strftime("%Y-%m-%d")))
        embed.add_field(name="⏰ Last update", value=str(player.last_save.strftime("%Y-%m-%d")))
        embed.add_field(name=":money_with_wings: Estimated networth", value=f"{round(player.networth['total'] + player.slayer_total_spend):,}")

        return embed