From bed86b7fd9e904ec10c7241b220b5106d0ce60a6 Mon Sep 17 00:00:00 2001 From: Averi Date: Mon, 14 Oct 2024 10:04:49 +0200 Subject: [PATCH 1/5] Fixed "Most Damage" being present and `NaN` when player didnt do any damage to dragons and empty tooltips being present --- views/sections/stats/misc/end_island.ejs | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/views/sections/stats/misc/end_island.ejs b/views/sections/stats/misc/end_island.ejs index 74b3042f11..939b7fc9ec 100644 --- a/views/sections/stats/misc/end_island.ejs +++ b/views/sections/stats/misc/end_island.ejs @@ -9,7 +9,7 @@

- <% if (calculated.misc.dragons.most_damage !== undefined) { %> + <% if (calculated.misc.dragons.most_damage !== undefined && Object.keys(calculated.misc.dragons.most_damage).length) { %> <% let tooltip = ""; for (const key in calculated.misc.dragons.most_damage) { if (key === "best") { @@ -19,7 +19,7 @@ tooltip += `${helper.capitalizeFirstLetter(key)}: ${Math.floor(calculated.misc.dragons.most_damage[key]).toLocaleString()}
`; } %> - + <% if (tooltip) { %><% } else { %><% } %> Most Damage: <%= Math.floor(calculated.misc.dragons.most_damage.best).toLocaleString() %> @@ -27,7 +27,7 @@ <% } %> - <% if (calculated.misc.dragons.fastest_kill !== undefined) { %> + <% if (calculated.misc.dragons.fastest_kill !== undefined && Object.keys(calculated.misc.dragons.fastest_kill).length) { %> <% tooltip = ""; for (const key in calculated.misc.dragons.fastest_kill) { if (key === "best") { @@ -37,7 +37,7 @@ tooltip += `${helper.capitalizeFirstLetter(key)}: ${moment.duration(calculated.misc.dragons.fastest_kill[key], "milliseconds").format("m:ss.SSS")}s
`; } %> - + <% if (tooltip) { %><% } else { %><% } %> Fastest Kill: <%= moment.duration(calculated.misc.dragons.fastest_kill.best, "milliseconds").format("m:ss.SSS") %>s @@ -46,7 +46,7 @@ - <% if (calculated.misc.dragons.kills !== undefined) { %> + <% if (calculated.misc.dragons.kills !== undefined && Object.keys(calculated.misc.dragons.kills).length) { %> <% tooltip = ""; for (const key in calculated.misc.dragons.kills) { if (key === "total") { @@ -56,7 +56,7 @@ tooltip += `${helper.capitalizeFirstLetter(key)}: ${calculated.misc.dragons.kills[key].toLocaleString()}
`; } %> - + <% if (tooltip) { %><% } else { %><% } %> Last Hits: <%= calculated.misc.dragons.kills.total.toLocaleString() %> @@ -64,7 +64,7 @@ <% } %> - <% if (calculated.misc.dragons.deaths !== undefined) { %> + <% if (calculated.misc.dragons.deaths !== undefined && Object.keys(calculated.misc.dragons.deaths).length) { %> <% tooltip = ""; for (const key in calculated.misc.dragons.deaths) { if (key === "total") { @@ -73,7 +73,8 @@ tooltip += `${helper.capitalizeFirstLetter(key)}: ${calculated.misc.dragons.deaths[key].toLocaleString()}
`; } %> - + + <% if (tooltip) { %><% } else { %><% } %> Deaths: <%= calculated.misc.dragons.deaths.total.toLocaleString() %> @@ -99,4 +100,4 @@ <%= calculated.misc.endstone_protector.deaths.toLocaleString() %>

-<% } %> \ No newline at end of file +<% } %> From 8e9de74f746313a18c621d2a7af1ce89de94d9a0 Mon Sep 17 00:00:00 2001 From: Averi Date: Mon, 14 Oct 2024 10:08:35 +0200 Subject: [PATCH 2/5] fixed time below 1s displaying as full seconds instead split second (SkyCryptWebsite/SkyCrypt#2250) --- views/sections/stats/misc/end_island.ejs | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/views/sections/stats/misc/end_island.ejs b/views/sections/stats/misc/end_island.ejs index 939b7fc9ec..0febfa8fdd 100644 --- a/views/sections/stats/misc/end_island.ejs +++ b/views/sections/stats/misc/end_island.ejs @@ -29,17 +29,20 @@ <% if (calculated.misc.dragons.fastest_kill !== undefined && Object.keys(calculated.misc.dragons.fastest_kill).length) { %> <% tooltip = ""; + + const formatTime = (ms) => (ms < 1000 ? `0.${ms}` : moment.duration(ms, "milliseconds").format("m:ss.SSS")) + "s"; + for (const key in calculated.misc.dragons.fastest_kill) { if (key === "best") { continue; } - tooltip += `${helper.capitalizeFirstLetter(key)}: ${moment.duration(calculated.misc.dragons.fastest_kill[key], "milliseconds").format("m:ss.SSS")}s
`; + tooltip += `${helper.capitalizeFirstLetter(key)}: ${formatTime(calculated.misc.dragons.fastest_kill[key])}
`; } %> - <% if (tooltip) { %><% } else { %><% } %> + <% if (tooltip) { %><% } else { %><% } %> Fastest Kill: - <%= moment.duration(calculated.misc.dragons.fastest_kill.best, "milliseconds").format("m:ss.SSS") %>s + <%= formatTime(calculated.misc.dragons.fastest_kill.best) %>
<% } %> From 966b1a97b9b41c35dfa1db86dda82998a853e633 Mon Sep 17 00:00:00 2001 From: Shiiyu <40838999+Shiiyu@users.noreply.github.com> Date: Thu, 31 Oct 2024 19:07:48 -0400 Subject: [PATCH 3/5] feat: add patreon banner --- views/stats.ejs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/views/stats.ejs b/views/stats.ejs index d7d91664d3..b2c82582bc 100644 --- a/views/stats.ejs +++ b/views/stats.ejs @@ -387,6 +387,12 @@ const metaDescription = getMetaDescription() Please report the error on our Discord.

+ <% } else { %> + <% } %>
Stats for From 2b5e626d97e3c2579ab9e8cf0a0fd42c0e345c42 Mon Sep 17 00:00:00 2001 From: Shiiyu <40838999+Shiiyu@users.noreply.github.com> Date: Fri, 1 Nov 2024 12:13:16 -0400 Subject: [PATCH 4/5] fix: fix abicase mp --- src/stats/missing.js | 5 ++++- views/sections/stats/items/accessories.ejs | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/stats/missing.js b/src/stats/missing.js index 47be842ff1..4854980e07 100644 --- a/src/stats/missing.js +++ b/src/stats/missing.js @@ -158,7 +158,10 @@ export async function getMissingAccessories(calculated, packs) { output.magical_power = { accessories: activeAccessories.reduce((a, b) => a + helper.getMagicalPower(b.rarity, helper.getId(b)), 0), - abiphone: abiphoneContacts ? Math.floor(abiphoneContacts / 2) : 0, + abiphone: + abiphoneContacts && calculated.items.accessories.accessory_ids.find((a) => a.id === "ABICASE") + ? Math.floor(abiphoneContacts / 2) + : 0, rift_prism: riftPrism ? 11 : 0, hegemony: hegemonyArtifact ? helper.getMagicalPower(hegemonyArtifact.rarity, hegemonyArtifact.id) : 0, }; diff --git a/views/sections/stats/items/accessories.ejs b/views/sections/stats/items/accessories.ejs index 899a0d2385..8fa1d52f85 100644 --- a/views/sections/stats/items/accessories.ejs +++ b/views/sections/stats/items/accessories.ejs @@ -107,7 +107,7 @@ function itemIcon(item, classes) { %> 3 MP × <%= rarities.special.amount %> Accs. = <%= rarities.special.magical_power.toLocaleString() %> MP
5 MP × <%= rarities.very_special.amount %> Accs. = <%= rarities.very_special.magical_power.toLocaleString() %> MP

- <% if (calculated.accessories.magical_power.abiphone) { %> + <% if (calculated.accessories.magical_power.abiphone && items.accessories.accessory_ids.find((a) => a.id === "ABICASE")) { %> Abicase = +<%= calculated.accessories.magical_power.abiphone %> MP
<% } %> From 968a452ec8aca131282518ec0ec674bd0b864c29 Mon Sep 17 00:00:00 2001 From: Shiiyu <40838999+Shiiyu@users.noreply.github.com> Date: Fri, 1 Nov 2024 12:14:00 -0400 Subject: [PATCH 5/5] feat: add haste ring to accessory upgrades --- src/constants/accessories.js | 1 + 1 file changed, 1 insertion(+) diff --git a/src/constants/accessories.js b/src/constants/accessories.js index fc2b7002a2..09273cb8f2 100644 --- a/src/constants/accessories.js +++ b/src/constants/accessories.js @@ -90,6 +90,7 @@ const accessoryUpgrades = [ ["SCAVENGER_TALISMAN", "SCAVENGER_RING", "SCAVENGER_ARTIFACT"], ["EMERALD_RING", "EMERALD_ARTIFACT"], ["MINERAL_TALISMAN", "GLOSSY_MINERAL_TALISMAN"], + ["HASTE_RING", "HASTE_ARTIFACT"], ]; const ignoredAccessories = [