Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: 🐛 add enchanted glint to golden apples #1850

Open
wants to merge 3 commits into
base: development
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions public/resources/ts/stats-defer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,11 @@ export function isEnchanted(item: Item): boolean {
return true;
}

// enchanted golden apple
if (item.id === 322 && item.Damage === 1) {
return true;
}

//potions with actual effects (not water bottles)
if (item.id === 373 && item.Damage !== 0) {
return true;
Expand Down
65 changes: 35 additions & 30 deletions views/stats.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,11 @@ function isEnchanted(item) {
return true;
}

// enchanted golden apple
if (item.id === 322 && item.Damage === 1) {
return true;
}

// potions potions with actual effects (not water bottles)
if (item.id === 373 && item.Damage !== 0) {
return true;
Expand All @@ -119,7 +124,7 @@ function itemIcon(item, classes) { %>
icon-<%= item.id %>_<%= item.Damage %>
">
</div>
<% }
<% }

function jerriefy(rank) {
if (extra.isFoolsDay) {
Expand Down Expand Up @@ -380,7 +385,7 @@ const metaDescription = getMetaDescription()
<% for (let error in calculated.errors) { %>
<% console.log(calculated.errors[error]) %>
<%- calculated.errors[error] %>

<br>
<% } %>
<br>
Expand Down Expand Up @@ -438,7 +443,7 @@ const metaDescription = getMetaDescription()
<% for (let profile_id in calculated.profiles) {
const _profile = calculated.profiles[profile_id]; %>
<li>
<a class="goto" href="/stats/<%= calculated.uuid %>/<%= _profile.profile_id %><%= Object.keys(req.query).length > 0 ? '?' + new URLSearchParams(req.query).toString() : '' %>">
<a class="goto" href="/stats/<%= calculated.uuid %>/<%= _profile.profile_id %><%= Object.keys(req.query).length > 0 ? '?' + new URLSearchParams(req.query).toString() : '' %>">
<span class="profile-name"><%= _profile.cute_name %></span>

<% if (_profile.game_mode == 'ironman') { %>
Expand Down Expand Up @@ -468,40 +473,40 @@ const metaDescription = getMetaDescription()

<!-- Placnke Button-->
<a href="https://plancke.io/hypixel/player/stats/<%= calculated.display_name %>" target="_blank" rel="noreferrer" class="additional-player-stat external-link">Plancke</a>

<div id="additional_socials">
<!-- Copy UUID Button -->
<button data-copy-text="<%= calculated.uuid %>" class="copy-text additional-player-stat">Copy UUID</button>

<% if ('social' in calculated && Object.keys(calculated.social).length > 0) { %>
<!-- Discord Button -->
<% if ('DISCORD' in calculated.social) { %>
<button data-copy-text="<%= calculated.social.DISCORD %>" class="additional-player-stat copy-text external-discord external-icon"><%= calculated.social.DISCORD %></button>
<% if ('DISCORD' in calculated.social) { %>
<button data-copy-text="<%= calculated.social.DISCORD %>" class="additional-player-stat copy-text external-discord external-icon"><%= calculated.social.DISCORD %></button>
<% } %>

<!-- Twitter Button -->
<% if ('TWITTER' in calculated.social) { %>
<a data-tippy-content="Twitter" href="<%= calculated.social.TWITTER %>" target="_blank" rel="noreferrer" class="additional-player-stat external-link external-icon external-twitter"></a>
<% if ('TWITTER' in calculated.social) { %>
<a data-tippy-content="Twitter" href="<%= calculated.social.TWITTER %>" target="_blank" rel="noreferrer" class="additional-player-stat external-link external-icon external-twitter"></a>
<% } %>

<!-- Youtube Button -->
<% if ('YOUTUBE' in calculated.social) { %>
<a data-tippy-content="YouTube" href="<%= calculated.social.YOUTUBE %>" target="_blank" rel="noreferrer" class="additional-player-stat external-link external-icon external-youtube"></a>
<% if ('YOUTUBE' in calculated.social) { %>
<a data-tippy-content="YouTube" href="<%= calculated.social.YOUTUBE %>" target="_blank" rel="noreferrer" class="additional-player-stat external-link external-icon external-youtube"></a>
<% } %>

<!-- Instagram Button -->
<% if ('INSTAGRAM' in calculated.social) { %>
<a data-tippy-content="Instagram" href="<%= calculated.social.INSTAGRAM %>" target="_blank" rel="noreferrer" class="additional-player-stat external-link external-icon external-instagram"></a>
<% if ('INSTAGRAM' in calculated.social) { %>
<a data-tippy-content="Instagram" href="<%= calculated.social.INSTAGRAM %>" target="_blank" rel="noreferrer" class="additional-player-stat external-link external-icon external-instagram"></a>
<% } %>

<!-- Twitch Button -->
<% if ('TWITCH' in calculated.social) { %>
<a data-tippy-content="Twitch" href="<%= calculated.social.TWITCH %>" target="_blank" rel="noreferrer" class="additional-player-stat external-link external-icon external-twitch"></a>
<% if ('TWITCH' in calculated.social) { %>
<a data-tippy-content="Twitch" href="<%= calculated.social.TWITCH %>" target="_blank" rel="noreferrer" class="additional-player-stat external-link external-icon external-twitch"></a>
<% } %>

<!-- Hypixel Button -->
<% if ('HYPIXEL' in calculated.social) { %>
<a data-tippy-content="Hypixel Forums" href="<%= calculated.social.HYPIXEL %>" target="_blank" rel="noreferrer" class="additional-player-stat external-link external-icon external-hypixel"></a>
<% if ('HYPIXEL' in calculated.social) { %>
<a data-tippy-content="Hypixel Forums" href="<%= calculated.social.HYPIXEL %>" target="_blank" rel="noreferrer" class="additional-player-stat external-link external-icon external-hypixel"></a>
<% } %>

<button class="additional-player-stat" id="reveal_socials" aria-label="reveal socials"></button>
Expand Down Expand Up @@ -572,27 +577,27 @@ const metaDescription = getMetaDescription()
<% } %>

<% if (calculated.profile.game_mode == 'ironman') { %>
<% if (notAvailable.length > 0) { %>
<br>
<% if (notAvailable.length > 0) { %>
<br>
<% } %>

This is an <strong>Ironman</strong> profile. The player cannot use the auction house, bazaar, or trade with other players.
<% } %>


<% if (calculated.profile.game_mode == 'bingo') { %>
<% if (notAvailable.length > 0) { %>
<br>
<% if (notAvailable.length > 0) { %>
<br>
<% } %>

This is a <strong>Bingo</strong> profile. The player cannot spend gems, use the auction house, bazaar or trade with other players.
<% } %>

<% if (calculated.profile.game_mode == 'island') { %>
<% if (notAvailable.length > 0) { %>
<% if (notAvailable.length > 0) { %>
<br>
<% } %>

This is a <strong>Stranded</strong> profile. The player cannot leave their skyblock island or trade with other players.
<% } %>
</div>
Expand Down Expand Up @@ -630,22 +635,22 @@ const metaDescription = getMetaDescription()
<!-- Inventories (Inventory, Storage, Ender Chest, Vault, Accessories, Pots, Fish, Quiver) -->
<%- include('./sections/stats/items/inventory.ejs', { getRarityUpgradeClass, rarityOrder, isEnchanted }); %>
<% } %>

<!-- Skills -->
<%- include('./sections/stats/skills.ejs', { getRarityUpgradeClass, rarityOrder, isEnchanted }); %>

<!-- Dungeons -->
<% if (calculated.dungeons !== undefined) { %>
<%- include('./sections/stats/dungeons.ejs', { skillItems }); %>
<% } %>
<% } %>

<!-- Slayer -->
<% if (calculated.slayer !== undefined) { %>
<%- include('./sections/stats/slayer.ejs', {}); %>
<% } %>

<!-- Minions -->
<% if (calculated.minions.unlockedTiers > 0) { %>
<% if (calculated.minions.unlockedTiers > 0) { %>
<%- include('./sections/stats/minions.ejs', { skillItems }); %>
<% } %>

Expand All @@ -659,7 +664,7 @@ const metaDescription = getMetaDescription()
<% } %>

<!-- Crimson Isle -->
<% if (calculated.crimson_isle !== undefined) { %>
<% if (calculated.crimson_isle !== undefined) { %>
<%- include('./sections/stats/crimson_isle.ejs', {}); %>
<% } %>

Expand All @@ -672,8 +677,8 @@ const metaDescription = getMetaDescription()
<% if (calculated.profile.game_mode === "bingo" && calculated.bingo !== undefined) { %>
<%- include('./sections/stats/bingo.ejs', {}); %>
<% } %>
<!-- Miscellaneous -->

<!-- Miscellaneous -->
<% if (calculated.misc !== undefined) { %>
<%- include('./sections/stats/misc.ejs', { rarityOrder }); %>
<% } %>
Expand Down
Loading