made achievments easier to discern
This commit is contained in:
+34
-35
@@ -652,7 +652,7 @@ async function evaluateAchievements(
|
||||
definitions.filter(
|
||||
definition =>
|
||||
definition.measure !==
|
||||
"achievementPercentage" &&
|
||||
"achievementPercentage" &&
|
||||
Boolean(definition.stat)
|
||||
);
|
||||
|
||||
@@ -664,7 +664,7 @@ async function evaluateAchievements(
|
||||
definition =>
|
||||
Boolean(
|
||||
unlocked[
|
||||
definition.achievementId
|
||||
definition.achievementId
|
||||
]
|
||||
)
|
||||
).length;
|
||||
@@ -672,7 +672,7 @@ async function evaluateAchievements(
|
||||
const achievementPercentage =
|
||||
totalCollectible > 0
|
||||
? unlockedCollectible /
|
||||
totalCollectible
|
||||
totalCollectible
|
||||
: 0;
|
||||
|
||||
for (const definition of collectorDefinitions) {
|
||||
@@ -781,19 +781,18 @@ async function sendAchievementNotification(
|
||||
await interaction.followUp({
|
||||
embeds: [
|
||||
new EmbedBuilder()
|
||||
.setTitle(
|
||||
"🏆 Achievement Unlocked!"
|
||||
)
|
||||
.setTitle("🏆 Achievement Unlocked!")
|
||||
.setDescription(
|
||||
[
|
||||
`${achievement.emoji} **${achievement.name}**`,
|
||||
`<@${userId}> earned an achievement!`,
|
||||
"",
|
||||
`**${achievement.name}**`,
|
||||
achievement.description
|
||||
].join("\n")
|
||||
)
|
||||
]
|
||||
});
|
||||
} catch {}
|
||||
} catch { }
|
||||
}
|
||||
|
||||
async function evaluateBadges(
|
||||
@@ -901,13 +900,13 @@ async function evaluateBadges(
|
||||
|
||||
if (
|
||||
event.type ===
|
||||
"game_result" &&
|
||||
"game_result" &&
|
||||
event.game ===
|
||||
"blackjack" &&
|
||||
"blackjack" &&
|
||||
event.natural ===
|
||||
true &&
|
||||
true &&
|
||||
event.result ===
|
||||
"win"
|
||||
"win"
|
||||
) {
|
||||
await tryClaimBadge(
|
||||
interaction,
|
||||
@@ -918,13 +917,13 @@ async function evaluateBadges(
|
||||
|
||||
if (
|
||||
event.type ===
|
||||
"game_result" &&
|
||||
"game_result" &&
|
||||
event.game ===
|
||||
"blackjack" &&
|
||||
"blackjack" &&
|
||||
event.allIn ===
|
||||
true &&
|
||||
true &&
|
||||
event.result ===
|
||||
"win"
|
||||
"win"
|
||||
) {
|
||||
await tryClaimBadge(
|
||||
interaction,
|
||||
@@ -935,13 +934,13 @@ async function evaluateBadges(
|
||||
|
||||
if (
|
||||
event.type ===
|
||||
"game_result" &&
|
||||
"game_result" &&
|
||||
event.game ===
|
||||
"roulette" &&
|
||||
"roulette" &&
|
||||
event.zero ===
|
||||
true &&
|
||||
true &&
|
||||
event.result ===
|
||||
"win"
|
||||
"win"
|
||||
) {
|
||||
await tryClaimBadge(
|
||||
interaction,
|
||||
@@ -952,13 +951,13 @@ async function evaluateBadges(
|
||||
|
||||
if (
|
||||
event.type ===
|
||||
"game_result" &&
|
||||
"game_result" &&
|
||||
event.game ===
|
||||
"roulette" &&
|
||||
"roulette" &&
|
||||
event.allIn ===
|
||||
true &&
|
||||
true &&
|
||||
event.result ===
|
||||
"win"
|
||||
"win"
|
||||
) {
|
||||
await tryClaimBadge(
|
||||
interaction,
|
||||
@@ -1036,7 +1035,7 @@ async function evaluateCollectorBadges(
|
||||
achievement =>
|
||||
Boolean(
|
||||
unlocked[
|
||||
achievement.achievementId
|
||||
achievement.achievementId
|
||||
]
|
||||
)
|
||||
).length;
|
||||
@@ -1097,7 +1096,7 @@ async function tryClaimBadge(
|
||||
if (
|
||||
metadata &&
|
||||
typeof metadata ===
|
||||
"object"
|
||||
"object"
|
||||
) {
|
||||
update.metadata = metadata;
|
||||
}
|
||||
@@ -1121,7 +1120,7 @@ async function tryClaimBadge(
|
||||
if (
|
||||
!badge ||
|
||||
badge.ownerId !==
|
||||
userId
|
||||
userId
|
||||
) {
|
||||
return false;
|
||||
}
|
||||
@@ -1132,7 +1131,7 @@ async function tryClaimBadge(
|
||||
`<@${userId}> claimed a guild-unique badge!`,
|
||||
"",
|
||||
badge.description ??
|
||||
"A unique badge has been claimed.",
|
||||
"A unique badge has been claimed.",
|
||||
"",
|
||||
"*This badge can no longer be earned by another player.*"
|
||||
];
|
||||
@@ -1140,10 +1139,10 @@ async function tryClaimBadge(
|
||||
if (
|
||||
badge.metadata
|
||||
?.unlockedAchievements !==
|
||||
undefined &&
|
||||
undefined &&
|
||||
badge.metadata
|
||||
?.availableAchievements !==
|
||||
undefined
|
||||
undefined
|
||||
) {
|
||||
description.splice(
|
||||
description.length - 1,
|
||||
@@ -1623,7 +1622,7 @@ async function buildAchievementsEmbed(
|
||||
definition =>
|
||||
Boolean(
|
||||
unlocked[
|
||||
definition.achievementId
|
||||
definition.achievementId
|
||||
]
|
||||
)
|
||||
).length;
|
||||
@@ -1631,7 +1630,7 @@ async function buildAchievementsEmbed(
|
||||
const collectorPercentage =
|
||||
collectibleDefinitions.length > 0
|
||||
? unlockedCollectible /
|
||||
collectibleDefinitions.length
|
||||
collectibleDefinitions.length
|
||||
: 0;
|
||||
|
||||
const lines = [];
|
||||
@@ -1641,7 +1640,7 @@ async function buildAchievementsEmbed(
|
||||
const complete =
|
||||
Boolean(
|
||||
unlocked[
|
||||
achievement.achievementId
|
||||
achievement.achievementId
|
||||
]
|
||||
);
|
||||
|
||||
@@ -1743,7 +1742,7 @@ async function buildAchievementsEmbed(
|
||||
achievement =>
|
||||
Boolean(
|
||||
unlocked[
|
||||
achievement.achievementId
|
||||
achievement.achievementId
|
||||
]
|
||||
)
|
||||
).length;
|
||||
@@ -2080,7 +2079,7 @@ function paginateLines(
|
||||
|
||||
if (
|
||||
candidate.length >
|
||||
maxLength &&
|
||||
maxLength &&
|
||||
current.length
|
||||
) {
|
||||
pages.push(
|
||||
|
||||
Reference in New Issue
Block a user