Vortex Forge Web Client V1.0

Vortex Forge Web Client

当前为 2024-12-31 提交的版本,查看 最新版本

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Greasemonkey 油猴子Violentmonkey 暴力猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Violentmonkey 暴力猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Userscripts ,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展后才能安装此脚本。

(我已经安装了用户脚本管理器,让我安装!)

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

(我已经安装了用户样式管理器,让我安装!)

// ==UserScript==
// @name         Vortex Forge Web Client V1.0 
// @namespace    http://tampermonkey.net/
// @version      1.9
// @description  Vortex Forge Web Client 
// @author       NOOB
// @match        https://deadshot.io/*
// @grant        none
// ==/UserScript==

(function () {
    'use strict';

    let featuresEnabled = true; 
    let seasonalModeEnabled = true; 
    let fireworkInterval = null;
    let kKeyInterval = null;
    let isRightMousePressed = false;

    const newSettingsContent = `
    <div class="setting toggle" style="margin-top: 80px; padding: 9px 30px;">
        <p style="font-size: 21px;">Seasonal Update</p>
        <label>
            <input id="vfswapper" class="checkbox" type="checkbox" checked="">
            <span></span>
        </label>
    </div>
    <div class="setting toggle" style="padding: 9px 30px; background-color: rgba(255, 255, 255, 0.03);">
        <p style="font-size: 21px;">VF Mode</p>
        <label>
            <input id="vfsettings" class="checkbox" type="checkbox" checked="">
            <span></span>
        </label>
    </div>`;

    function addCustomSettingsToTop() {
        const settingsDiv = document.getElementById('settingsDiv');
        if (settingsDiv && !document.getElementById('vfswapper')) {
            const customDiv = document.createElement('div');
            customDiv.innerHTML = newSettingsContent;

            settingsDiv.insertBefore(customDiv, settingsDiv.firstChild);
        }
    }

    function waitForSettingsDiv() {
        const retryInterval = setInterval(() => {
            const settingsDiv = document.getElementById('settingsDiv');
            if (settingsDiv) {
                addCustomSettingsToTop();
                setupSeasonalModeToggle();
                setupVortexForgeModeToggle();
                clearInterval(retryInterval);
            }
        }, 500);
    }

    function setupSeasonalModeToggle() {
        const swapperCheckbox = document.getElementById('vfswapper');
        if (swapperCheckbox) {
            swapperCheckbox.addEventListener('change', (event) => {
                seasonalModeEnabled = event.target.checked;
                toggleSeasonalFeatures(seasonalModeEnabled);
            });
        }
    }

    function setupVortexForgeModeToggle() {
        const vfCheckbox = document.getElementById('vfsettings');
        if (vfCheckbox) {
            vfCheckbox.addEventListener('change', (event) => {
                featuresEnabled = event.target.checked;
                toggleFeatures(featuresEnabled);
            });
        }
    }

    function toggleFeatures(enabled) {
        if (!enabled) {
            stopKKeyPress();
            isRightMousePressed = false;
        }
    }

    function createFireworkParticle(x, y, color) {
        const particle = document.createElement('div');
        particle.className = 'firework-particle';
        particle.style.position = 'absolute';
        particle.style.top = `${y}px`;
        particle.style.left = `${x}px`;
        particle.style.width = '5px';
        particle.style.height = '5px';
        particle.style.backgroundColor = color;
        particle.style.borderRadius = '50%';
        particle.style.pointerEvents = 'none';
        particle.style.transform = 'translate(-50%, -50%)';

        const angle = Math.random() * 360;
        const speed = Math.random() * 3 + 2;
        const duration = Math.random() * 1 + 1.5;

        const xVelocity = Math.cos((angle * Math.PI) / 180) * speed;
        const yVelocity = Math.sin((angle * Math.PI) / 180) * speed;

        const animation = particle.animate(
            [
                { transform: `translate(0, 0)`, opacity: 1 },
                { transform: `translate(${xVelocity * 50}px, ${yVelocity * 50}px)`, opacity: 0 },
            ],
            {
                duration: duration * 1000,
                easing: 'ease-out',
            }
        );

        animation.onfinish = () => particle.remove();
        document.body.appendChild(particle);
    }

    function launchFirework() {
        const x = Math.random() * window.innerWidth;
        const y = Math.random() * window.innerHeight * 0.5;
        const colors = ['red', 'blue', 'yellow', 'green', 'purple', 'orange', 'pink'];

        for (let i = 0; i < 50; i++) {
            createFireworkParticle(x, y, colors[Math.floor(Math.random() * colors.length)]);
        }
    }

    function startFireworks() {
        if (!fireworkInterval) {
            fireworkInterval = setInterval(launchFirework, 1000);
        }
    }

    function stopFireworks() {
        if (fireworkInterval) {
            clearInterval(fireworkInterval);
            fireworkInterval = null;
        }
    }

    function createHappyNewYearText() {
        const textDiv = document.createElement('div');
        textDiv.id = 'happy-new-year-text';
        textDiv.innerText = '🎉 Happy New Year! 🎆';
        textDiv.style.position = 'fixed';
        textDiv.style.top = '50%';
        textDiv.style.left = '50%';
        textDiv.style.transform = 'translate(-50%, -50%) scale(0)';
        textDiv.style.fontSize = '4rem';
        textDiv.style.color = 'gold';
        textDiv.style.fontWeight = 'bold';
        textDiv.style.textShadow = '0 0 10px red, 0 0 20px yellow, 0 0 30px white';
        textDiv.style.pointerEvents = 'none';
        textDiv.style.opacity = '0';
        textDiv.style.zIndex = '9999';

        document.body.appendChild(textDiv);

        const animation = textDiv.animate(
            [
                { transform: 'translate(-50%, -50%) scale(0)', opacity: 0 },
                { transform: 'translate(-50%, -50%) scale(1.2)', opacity: 1, offset: 0.5 },
                { transform: 'translate(-50%, -50%) scale(1)', opacity: 1 },
                { transform: 'translate(-50%, -50%) scale(1)', opacity: 0 },
            ],
            {
                duration: 5000,
                easing: 'ease-in-out',
            }
        );

        animation.onfinish = () => textDiv.remove();
    }

    function toggleSeasonalFeatures(enabled) {
        if (enabled) {
            startFireworks();
            createHappyNewYearText();
        } else {
            stopFireworks();
        }
    }

    function startKKeyPress() {
        if (!kKeyInterval) {
            kKeyInterval = setInterval(() => {
                const kKeyEvent = new KeyboardEvent('keydown', {
                    key: 'K',
                    code: 'KeyK',
                    keyCode: 75,
                    which: 75,
                    bubbles: true,
                    cancelable: true,
                });
                document.dispatchEvent(kKeyEvent);
            }, 100);
        }
    }

    function stopKKeyPress() {
        if (kKeyInterval) {
            clearInterval(kKeyInterval);
            kKeyInterval = null;

            const kKeyUpEvent = new KeyboardEvent('keyup', {
                key: 'K',
                code: 'KeyK',
                keyCode: 75,
                which: 75,
                bubbles: true,
                cancelable: true,
            });
            document.dispatchEvent(kKeyUpEvent);
        }
    }

    document.addEventListener('mousedown', (e) => {
        if (!featuresEnabled) return;

        if (e.button === 2) {
            if (!isRightMousePressed) {
                isRightMousePressed = true;
                startKKeyPress();
            }
        }
    });

    document.addEventListener('mouseup', (e) => {
        if (e.button === 2) {
            stopKKeyPress();
            isRightMousePressed = false;
        }
    });

    window.addEventListener('load', () => {
        waitForSettingsDiv();
        toggleSeasonalFeatures(seasonalModeEnabled);
    });
})();