Skip to content

Commit 5ece471

Browse files
committed
feat: leaderboard and ranked for deathbattle
1 parent 3797d2a commit 5ece471

File tree

7 files changed

+322
-48
lines changed

7 files changed

+322
-48
lines changed

src/commands/aura.ts

Lines changed: 26 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,11 @@ import {
33
SlashCommandBuilder,
44
EmbedBuilder,
55
} from "discord.js";
6-
import { generateFighter, calculateAuraPercentage, calculateAuraLevel } from "../utils/fighterGenerator.js";
6+
import {
7+
generateFighter,
8+
calculateAuraPercentage,
9+
calculateAuraLevel,
10+
} from "../utils/fighterGenerator.js";
711

812
// prettier-ignore
913
const auraLevelNames = [
@@ -55,7 +59,9 @@ const flavorSets = [flavorSet1, flavorSet2];
5559

5660
export const data = new SlashCommandBuilder()
5761
.setName("aura")
58-
.setDescription("Calculate aura and fighter stats based on one's display name")
62+
.setDescription(
63+
"Calculate aura and fighter stats based on one's display name",
64+
)
5965
.addUserOption((option) =>
6066
option
6167
.setName("user")
@@ -81,29 +87,34 @@ export async function execute(
8187
const fighter = generateFighter(targetUser, displayName);
8288

8389
const chosenSet = flavorSets[Math.floor(Math.random() * flavorSets.length)];
84-
const flavorText = chosenSet[Math.max(0, Math.min(level, chosenSet.length - 1))];
90+
const flavorText =
91+
chosenSet[Math.max(0, Math.min(level, chosenSet.length - 1))];
8592

86-
const levelName = auraLevelNames[Math.max(0, Math.min(level, auraLevelNames.length - 1))];
93+
const levelName =
94+
auraLevelNames[Math.max(0, Math.min(level, auraLevelNames.length - 1))];
8795

8896
const embed = new EmbedBuilder()
89-
.setColor(level === 0 ? "#2F2F2F" : level === 11 ? "#ad32ffff" : "#800080")
97+
.setColor(level === 0 ? "#2F2F2F" : level === 11 ? "#ad32ff" : "#800080")
9098
.setTitle("🔮 Aura Reading")
9199
.setDescription(`The mystical aura of **${displayName}** has been divined!`)
92100
.addFields(
93101
{ name: "🌟 Aura Strength", value: `${percentage}%`, inline: true },
94102
{ name: "📊 Aura Level", value: `${level} (${levelName})`, inline: true },
95103
{ name: "⚔️ Fighter Class", value: getFighterClass(level), inline: true },
96-
{ name: "💪 Combat Statistics", value:
97-
`**HP:** ${fighter.hp}\n` +
98-
`**ATK:** ${fighter.attack}\n` +
99-
`**DEF:** ${fighter.defense}\n` +
100-
`**SPD:** ${fighter.speed}\n` +
101-
`**CRIT:** ${Math.round(fighter.critChance * 100)}%`,
102-
inline: true
104+
{
105+
name: "💪 Combat Statistics",
106+
value:
107+
`**HP:** ${fighter.hp}\n` +
108+
`**ATK:** ${fighter.attack}\n` +
109+
`**DEF:** ${fighter.defense}\n` +
110+
`**SPD:** ${fighter.speed}\n` +
111+
`**CRIT:** ${Math.round(fighter.critChance * 100)}%`,
112+
inline: true,
103113
},
104-
{ name: "🎯 Special Abilities", value:
105-
`• ${fighter.abilities[0]}\n• ${fighter.abilities[1]}`,
106-
inline: true
114+
{
115+
name: "🎯 Special Abilities",
116+
value: `• ${fighter.abilities[0]}\n• ${fighter.abilities[1]}`,
117+
inline: true,
107118
},
108119
{ name: "📝 Verdict", value: flavorText, inline: false },
109120
)

0 commit comments

Comments
 (0)