Obelisk Boons Display

Inserts images below selections

目前為 2025-01-30 提交的版本,檢視 最新版本

您需要先安裝使用者腳本管理器擴展,如 TampermonkeyGreasemonkeyViolentmonkey 之後才能安裝該腳本。

You will need to install an extension such as Tampermonkey to install this script.

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyViolentmonkey 後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyUserscripts 後才能安裝該腳本。

你需要先安裝一款使用者腳本管理器擴展,比如 Tampermonkey,才能安裝此腳本

您需要先安裝使用者腳本管理器擴充功能後才能安裝該腳本。

(我已經安裝了使用者腳本管理器,讓我安裝!)

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

(我已經安裝了使用者樣式管理器,讓我安裝!)

// ==UserScript==
// @name         Obelisk Boons Display
// @description  Inserts images below selections
// @version      2025.01.30
// @license      GNU GPLv3
// @match        https://www.neopets.com/prehistoric/battleground/
// @author       Posterboy
// @namespace    https://youtube.com/@Neo_PosterBoy
// @icon         https://images.neopets.com/new_shopkeepers/t_1900.gif
// @grant        none
// ==/UserScript==

(function() {
    'use strict';

    const itemNames = ['Awakened', 'Brutes', 'Order', 'Seekers', 'Sway', 'Thieves'];

    // Function to create display
    function createDisplay(itemName) {
        const displayDiv = document.createElement('div');
        displayDiv.className = 'item-display';

        // Images for each boon depeneding on faction
        let images = [];
        if (itemName === 'Brutes') {
            images = [
                'https://www.jellyneo.net/images/articles/boon_doppelgaenger.png',
                'https://images.neopets.com/prehistoric/obelisk/doppelganger_y2g78rgu/title.png',
                'https://www.jellyneo.net/images/articles/boon_equipallthethings.png',
                'https://images.neopets.com/prehistoric/obelisk/equipall_th54u28g/title.png',
                'https://www.jellyneo.net/images/articles/boon_grrraaaahhhhhh.png',
                'https://images.neopets.com/prehistoric/obelisk/grrraaaahhhhhh_q5g48y9v/title.png',
                'https://www.jellyneo.net/images/articles/boon_rightroundroundround.png',
                'https://images.neopets.com/prehistoric/obelisk/rightround_eh938urw/title.png',
                'https://www.jellyneo.net/images/articles/boon_scratchmaster.png',
                'https://images.neopets.com/prehistoric/obelisk/scratchmaster_43hu98n9/title.png'
            ];
        } else if (itemName === 'Order') {
            images = [
                'https://www.jellyneo.net/images/articles/boon_cartogriphication.png',
                'https://images.neopets.com/prehistoric/obelisk/cartogriphication_bhjei43v/title.png',
                'https://www.jellyneo.net/images/articles/boon_doctorwho.png',
                'https://images.neopets.com/prehistoric/obelisk/doctorwho_iy98der8/title.png',
                'https://www.jellyneo.net/images/articles/boon_doppelgaenger.png',
                'https://images.neopets.com/prehistoric/obelisk/doppelganger_y2g78rgu/title.png',
                'https://www.jellyneo.net/images/articles/boon_doublebubble.png',
                'https://images.neopets.com/prehistoric/obelisk/doublebubble_a45h9i3r/title.png',
                'https://www.jellyneo.net/images/articles/boon_refreshedquestrequest.png',
                'https://images.neopets.com/prehistoric/obelisk/refreshquest_bh3y98ur/title.png'
            ];
        } else if (itemName === 'Seekers') {
            images = [
                'https://www.jellyneo.net/images/articles/boon_bankbribery.png',
                'https://images.neopets.com/prehistoric/obelisk/bankbribery_o34y928v/title.png',
                'https://www.jellyneo.net/images/articles/boon_booksmarts.png',
                'https://images.neopets.com/prehistoric/obelisk/booksmarts_0y7u4erw/title.png',
                'https://www.jellyneo.net/images/articles/boon_doctorwho.png',
                'https://images.neopets.com/prehistoric/obelisk/doctorwho_iy98der8/title.png',
                'https://www.jellyneo.net/images/articles/boon_rightroundroundround.png',
                'https://images.neopets.com/prehistoric/obelisk/rightround_eh938urw/title.png',
                'https://www.jellyneo.net/images/articles/boon_strengthofmind.png',
                'https://images.neopets.com/prehistoric/obelisk/strengthmind_g459ub47/title.png'
            ];
        } else if (itemName === 'Sway') {
            images = [
                'https://www.jellyneo.net/images/articles/boon_bankbribery.png',
                'https://images.neopets.com/prehistoric/obelisk/bankbribery_o34y928v/title.png',
                'https://www.jellyneo.net/images/articles/boon_blackmarketgoods.png',
                'https://images.neopets.com/prehistoric/obelisk/blackmarket_q54xw47c/title.png',
                'https://www.jellyneo.net/images/articles/boon_cheaperbythedozen.png',
                'https://images.neopets.com/prehistoric/obelisk/cheaperdozen_p4h2tuv6/title.png',
                'https://www.jellyneo.net/images/articles/boon_refreshedquestrequest.png',
                'https://images.neopets.com/prehistoric/obelisk/refreshquest_bh3y98ur/title.png',
                'https://www.jellyneo.net/images/articles/boon_thatmillionairefeeling.png',
                'https://images.neopets.com/prehistoric/obelisk/millionairefeeling_z34yue5y/title.png'
            ];
        } else if (itemName === 'Thieves') {
            images = [
                'https://www.jellyneo.net/images/articles/boon_cheaperbythedozen.png',
                'https://images.neopets.com/prehistoric/obelisk/cheaperdozen_p4h2tuv6/title.png',
                'https://www.jellyneo.net/images/articles/boon_doppelgaenger.png',
                'https://images.neopets.com/prehistoric/obelisk/doppelganger_y2g78rgu/title.png',
                'https://www.jellyneo.net/images/articles/boon_fivefingerdiscount.png',
                'https://images.neopets.com/prehistoric/obelisk/fivefinger_uy68huy1/title.png',
                'https://www.jellyneo.net/images/articles/boon_lolavies.png',
                'https://images.neopets.com/prehistoric/obelisk/lolavies_u347qr2i/title.png',
                'https://www.jellyneo.net/images/articles/boon_scratchmaster.png',
                'https://images.neopets.com/prehistoric/obelisk/scratchmaster_43hu98n9/title.png'
            ];
        } else {
            // Question marks for Awakened, since it's randomly chosen
            for (let i = 0; i < 5; i++) {
                images.push('https://images.neopets.com/charity/2017/unknown.gif',
                           'https://images.neopets.com/prehistoric/outskirts/numbers.png');
            }
        }

        // Loads images below faction button
        images.forEach((imageUrl, index) => {
            const img = document.createElement('img');
            img.src = imageUrl;
            img.alt = `${itemName} Image ${index + 1}`;
            img.style.width = '180px';
            img.style.display = 'block';
            img.style.margin = '0 auto';
            displayDiv.appendChild(img);
        });

        const textDiv = document.createElement('div');
        textDiv.textContent = `Boons if ${itemName} wins`;
        displayDiv.appendChild(textDiv);

        return displayDiv;
    }

    // Function to process each list item
    function processListItems() {
        const listItems = document.querySelectorAll('li');

        listItems.forEach((li) => {
            itemNames.forEach((itemName) => {
                if (li.innerHTML.includes(itemName)) {
                    const display = createDisplay(itemName);
                    li.appendChild(display);
                }
            });
        });
    }

    // Run the process when the page is loaded
    window.addEventListener('load', processListItems);
})();