diff --git a/data/usermap.json b/data/usermap.json index 8354c33..0864ef5 100644 --- a/data/usermap.json +++ b/data/usermap.json @@ -7,7 +7,7 @@ "invicjusz": "invicjusz", "mrsean.": "sean", "ibenni": "ayana", - "zephyr_74135": "zephyr", + "izephyrxy": "zephyr", "eat.jim.sleep": "keira", "mar1n1987": "marin", "coba5539": "cobain" diff --git a/messages/emojis.json b/messages/emojis.json index 21e27e5..426f173 100644 --- a/messages/emojis.json +++ b/messages/emojis.json @@ -34,7 +34,6 @@ "wrank_down_5": "<:wrank_down_5:1512125030765691072>", "wrank_neutral": "<:wrank_neutral:1511950713713070160>", "wrank_neutral_0": "<:wrank_neutral_0:1511950717290545354>", - "wrank_no_rank": "<:wrank_no_rank:1511956384177062018>", "wrank_no_dash": "<:wrank_no_dash:1511956379403943979>", "wrank_up_1": "<:wrank_up_1:1512125132242554890>", "wrank_up_10": "<:wrank_up_10:1512125136445243503>", @@ -101,5 +100,7 @@ "wrank_6_gold": "<:wrank_6_gold:1512125115956203601>", "wrank_7_gold": "<:wrank_7_gold:1512125120204771338>", "wrank_8_gold": "<:wrank_8_gold:1512125123874918661>", - "wrank_9_gold": "<:wrank_9_gold:1512125128299905104>" + "wrank_9_gold": "<:wrank_9_gold:1512125128299905104>", + "wrank_no_rank": "<:wrank_no_rank:1512261782205628606>", + "wrank_no_rank_delta": "<:wrank_no_rank_delta:1512263603519229982>" } \ No newline at end of file diff --git a/messages/users/dey.json b/messages/users/dey.json index a079b5e..5526aca 100644 --- a/messages/users/dey.json +++ b/messages/users/dey.json @@ -1,15 +1,21 @@ { "public": { "yes": [ - { "clicks": 1, "random": true, "messages": ["Dey is in", "Dey is in... for now", "Welcome indeed!", "A bit of this, a bit of that."]}, - { "clicks": 2, "random": true, "messages": ["Courageous now, new account afterall"] }, + { "clicks": 1, "random": true, "messages": [ + "Dey is in", + "Dey is in... for now", + "Welcome indeed!", + "A bit of this, a bit of that.", + "Come and see what goods I offer" + ]}, { "clicks": 10, "random": true, "messages": ["Now you're just asking for it."] } ], "no": [ { "clicks": 1, "random": true, "messages": [ "Everything's for sale", "Dey roaching out 🪳", - "Dey said no... shocking" + "Dey said no... shocking", + "No more... I yield!" ] } ] diff --git a/messages/users/flash.json b/messages/users/flash.json index 2242eed..323fb2e 100644 --- a/messages/users/flash.json +++ b/messages/users/flash.json @@ -4,9 +4,11 @@ { "clicks": 1, "random": true, - "messages": ["Flash? Flash? Flash!!", "The King has arrived. 👑", "Flash is in, bow down.","{alias[0]} is in"] - }, - { "clicks": 2, "random": true, "messages": ["Flash? Flash? Flash!!"] } + "messages": [ + "<:wi:1511906503647563807>+<:storm_bringer:1511906496097554594>=<:kd:1511906474497146983>", + "<:wi:1511906503647563807> Powaaaaaaaaa" + ] + } ], "no": [ { "clicks": 1, "random": true, "messages": [ diff --git a/src/subcommands/rank/post.ts b/src/subcommands/rank/post.ts index 8981b3c..c6ec08b 100644 --- a/src/subcommands/rank/post.ts +++ b/src/subcommands/rank/post.ts @@ -49,15 +49,6 @@ export async function handleRankPost(interaction: ChatInputCommandInteraction): ) .setTimestamp(); - // const embed = new EmbedBuilder() - // .setTitle(`⚔️ W.Rank Leaderboard — ${weekKey}`) - // .setColor(0xe8a317) - // .addFields( - // { name: "🔵 Capella", value: formatNation("capella"), inline: true }, - // { name: "🔴 Procyon", value: formatNation("procyon"), inline: true }, - // ) - // .setTimestamp(); - const channelId = cfg("resultsChannelId") || cfg("pollChannelId"); const channel = await interaction.client.channels.fetch(channelId) as TextChannel; await channel.send({ embeds: [embed] }); diff --git a/src/systems/format.ts b/src/systems/format.ts index fe5b6bb..3af6630 100644 --- a/src/systems/format.ts +++ b/src/systems/format.ts @@ -111,11 +111,13 @@ function wrankFull(entry: WRankEntry, options: WRankDisplayOptions): string { * Output: — ( [] — ) */ function wrankNoRank(): string { - const dash = getEmoji("wrank_no_dash") || "—"; + const norank = getEmoji("wrank_no_dash") || "—"; + const dash = getEmoji("wrank_no_rank_delta") || "—"; const square = getEmoji("wrank_no_dash") || "■"; - return `${dash} (${square} ${dash})`; + return `${norank} (${square}${dash})`; } + // ─── Namespace export ───────────────────────────────────────────────────────── export const format = { diff --git a/src/systems/history.ts b/src/systems/history.ts index 9ca89e8..2a8423e 100644 --- a/src/systems/history.ts +++ b/src/systems/history.ts @@ -42,7 +42,7 @@ export function upsertScore(score: TGScore): void { // Overwrite existing score for this player+slot result.scores = result.scores.filter( - (s) => !(s.userKey === score.userKey && s.slot === score.slot && s.date === score.date) + (s) => !(s.userKey === score.userKey && s.characterName === score.characterName && s.slot === score.slot && s.date === score.date) ); result.scores.push(score); saveResult(result); diff --git a/src/systems/wrank.ts b/src/systems/wrank.ts index 63f6a0a..3c7e919 100644 --- a/src/systems/wrank.ts +++ b/src/systems/wrank.ts @@ -99,12 +99,16 @@ export function recordScore( } function recomputeRanks(week: WRankWeek, nation: Nation): void { - const list = week.entries[nation.toLowerCase() as "capella" | "procyon"]; + const list = week.entries[nation.toLowerCase() as "capella" | "procyon"]; const sorted = [...list].sort((a, b) => b.weeklyPoints - a.weeklyPoints); sorted.forEach((entry, i) => { - const live = list.find((e) => e.characterName === entry.characterName)!; - live.previousRank = live.currentRank || undefined; - live.currentRank = i + 1; + const live = list.find((e) => e.characterName === entry.characterName)!; + const newRank = i + 1; + // Only snapshot previousRank when rank actually changes + if (live.currentRank !== 0 && live.currentRank !== newRank) { + live.previousRank = live.currentRank; + } + live.currentRank = newRank; }); } @@ -146,6 +150,8 @@ export function getBringer(nation: Nation): string | null { export function getEntry(characterName: string, nation: Nation): WRankEntry | null { const week = getCurrentWeek(); const list = week.entries[nation.toLowerCase() as "capella" | "procyon"]; + console.log(`[getEntry] weekKey=${week.weekKey} nation=${nation} listLength=${list?.length} looking for=${characterName}`); + console.log(`[getEntry] available:`, list?.map(e => e.characterName)); return list.find((e) => e.characterName === characterName) ?? null; }