Skip to content

Commit

Permalink
Merge pull request #2308 from SkyCryptWebsite/development
Browse files Browse the repository at this point in the history
merge development into production
  • Loading branch information
Shiiyu authored Nov 1, 2024
2 parents 80f525b + 23d3f8f commit 6bf34ff
Show file tree
Hide file tree
Showing 5 changed files with 27 additions and 13 deletions.
1 change: 1 addition & 0 deletions src/constants/accessories.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 = [
Expand Down
5 changes: 4 additions & 1 deletion src/stats/missing.js
Original file line number Diff line number Diff line change
Expand Up @@ -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,
};
Expand Down
2 changes: 1 addition & 1 deletion views/sections/stats/items/accessories.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ function itemIcon(item, classes) { %>
<span style='color: var(--§6);' class='grey-text'>3 MP</span> × <span style='color: var(--§c);' class='grey-text'><%= rarities.special.amount %> Accs.</span> = <span style='color: var(--§6);' class='grey-text'><%= rarities.special.magical_power.toLocaleString() %> MP</span><br>
<span style='color: var(--§6);' class='grey-text'>5 MP</span> × <span style='color: var(--§c);' class='grey-text'><%= rarities.very_special.amount %> Accs.</span> = <span style='color: var(--§6);' class='grey-text'><%= rarities.very_special.magical_power.toLocaleString() %> MP</span><br>
<br>
<% if (calculated.accessories.magical_power.abiphone) { %>
<% if (calculated.accessories.magical_power.abiphone && items.accessories.accessory_ids.find((a) => a.id === "ABICASE")) { %>
<span style='color: var(--§<%= constants.RARITY_COLORS["rare"] %>);' class='grey-text'>Abicase</span> = <span style='color: var(--§6);' class='grey-text'>+<%= calculated.accessories.magical_power.abiphone %> MP</span><br>
<% } %>
Expand Down
26 changes: 15 additions & 11 deletions views/sections/stats/misc/end_island.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<p class="stat-raw-values">
<!-- Most Damage -->
<% 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") {
Expand All @@ -19,34 +19,37 @@
tooltip += `<span class="stat-name">${helper.capitalizeFirstLetter(key)}: </span><span class="stat-value">${Math.floor(calculated.misc.dragons.most_damage[key]).toLocaleString()}</span><br>`;
} %>
<span data-tippy-content='<%= tooltip %>'>
<% if (tooltip) { %><span data-tippy-content='<%= tooltip %>'><% } else { %><span><% } %>
<span class="stat-name">Most Damage: </span>
<span class="stat-value"><%= Math.floor(calculated.misc.dragons.most_damage.best).toLocaleString() %></span>
</span>
<br>
<% } %>
<!-- Fastest Kill -->
<% if (calculated.misc.dragons.fastest_kill !== undefined) { %>
<% 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 += `<span class="stat-name">${helper.capitalizeFirstLetter(key)}: </span><span class="stat-value">${moment.duration(calculated.misc.dragons.fastest_kill[key], "milliseconds").format("m:ss.SSS")}s</span><br>`;
tooltip += `<span class="stat-name">${helper.capitalizeFirstLetter(key)}: </span><span class="stat-value">${formatTime(calculated.misc.dragons.fastest_kill[key])}</span><br>`;
} %>
<span data-tippy-content='<%= tooltip %>'>
<% if (tooltip) { %><span data-tippy-content='<%= tooltip %>'><% } else { %><span><% } %>
<span class="stat-name">Fastest Kill: </span>
<span class="stat-value"><%= moment.duration(calculated.misc.dragons.fastest_kill.best, "milliseconds").format("m:ss.SSS") %>s</span>
<span class="stat-value"><%= formatTime(calculated.misc.dragons.fastest_kill.best) %></span>
</span>
<br>
<% } %>
<!-- Last Hits (Kills) -->
<% 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") {
Expand All @@ -56,15 +59,15 @@
tooltip += `<span class="stat-name">${helper.capitalizeFirstLetter(key)}: </span><span class="stat-value">${calculated.misc.dragons.kills[key].toLocaleString()}</span><br>`;
} %>
<span data-tippy-content='<%= tooltip %>'>
<% if (tooltip) { %><span data-tippy-content='<%= tooltip %>'><% } else { %><span><% } %>
<span class="stat-name">Last Hits: </span>
<span class="stat-value"><%= calculated.misc.dragons.kills.total.toLocaleString() %></span>
</span>
<br>
<% } %>
<!-- Deaths -->
<% 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") {
Expand All @@ -73,7 +76,8 @@
tooltip += `<span class="stat-name">${helper.capitalizeFirstLetter(key)}: </span><span class="stat-value">${calculated.misc.dragons.deaths[key].toLocaleString()}</span><br>`;
} %>
<span data-tippy-content='<%= tooltip %>'>
<% if (tooltip) { %><span data-tippy-content='<%= tooltip %>'><% } else { %><span><% } %>
<span class="stat-name">Deaths: </span>
<span class="stat-value"><%= calculated.misc.dragons.deaths.total.toLocaleString() %></span>
</span>
Expand All @@ -99,4 +103,4 @@
<span class="stat-value"><%= calculated.misc.endstone_protector.deaths.toLocaleString() %></span>
<br>
</p>
<% } %>
<% } %>
6 changes: 6 additions & 0 deletions views/stats.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -387,6 +387,12 @@ const metaDescription = getMetaDescription()
<strong>Please report the error on our <a href="https://discord.gg/cNgADv2kEQ" target="_blank" rel="noreferrer">Discord</a>.</strong>
</p>
</figure>
<% } else { %>
<figure class="banner" style="padding: 20px;">
<h2>
Please consider donating to the SkyCrypt <strong><a href="https://www.patreon.com/shiiyu" style="color:#2E76FF;">Patreon</a></strong> in order to keep the website running.
</h2>
</figure>
<% } %>
<div id="player_profile"><span class="text-stats-for">Stats for</span>
Expand Down

0 comments on commit 6bf34ff

Please sign in to comment.