Custom ShellShock Theme

Custom theme for ShellShock.io with background and skybox fixes

You will need to install an extension such as Tampermonkey, Greasemonkey or Violentmonkey to install this script.

Bạn sẽ cần cài đặt một tiện ích mở rộng như Tampermonkey hoặc Violentmonkey để cài đặt kịch bản này.

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

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

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

You will need to install a user script manager extension to install this script.

(Tôi đã có Trình quản lý tập lệnh người dùng, hãy cài đặt nó!)

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

(I already have a user style manager, let me install it!)

// ==UserScript==
// @name         Custom ShellShock Theme
// @namespace    http://tampermonkey.net/
// @version      1.1
// @description  Custom theme for ShellShock.io with background and skybox fixes
// @author       Anonymous
// @match        *://shellshock.io/*
// @grant        none
// ==/UserScript==

(function() {
    'use strict';

    // Ensure the custom background image is applied
    function setCustomBackground() {
        document.body.style.backgroundImage = "url('https://images.wallpapersden.com/image/download/obito-uchiha-cool-4k_bGllbm6UmZqaraWkpJRoa2lprWdlaW4.jpg')";
        document.body.style.backgroundSize = "cover";
        document.body.style.backgroundRepeat = "no-repeat";
        document.body.style.backgroundAttachment = "fixed";
    }
    setCustomBackground();

    // Ensure the skybox is set to the base64 image
    function setSkybox() {
        const sky = document.querySelector('.skybox'); // Adjust the selector based on the game's DOM
        if (sky) {
            sky.style.backgroundImage = "url('data:image/jpeg;base64,/9j/4AAQSkZJRgABAQAAAQABAAD/2wCEAAkGBxITEhISEhIVFRUWFRcVFRUVFRUVFRUVFRcYFhUVFRUYHSggGBolGxcVITEhJSkrLi4uFx8zODMtNygtLisBCgoKDg0OGhAQFy0dHR0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tKy0rKy0tLS0tLS0tNi0tLSstK//AABEIALEBHAMBIgACEQEDEQH/xAAbAAADAQEBAQEAAAAAAAAAAAADBAUCAQAGB//EADUQAAIBAgMFCAEEAgEFAAAAAAABAgMRBCExBUFRcYESIjJhkbHB8KETQtHhI3IzFFJigsL/xAAZAQADAQEBAAAAAAAAAAAAAAABAgMABAX/xAAhEQACAgMAAwADAQAAAAAAAAAAAQIRAyExEjJBBCJhQv/aAAwDAQACEQMRAD8A/...')";
            sky.style.backgroundSize = "cover";
            sky.style.backgroundRepeat = "no-repeat";
            sky.style.backgroundAttachment = "fixed";
        }
    }
    setSkybox();

    // Observer to apply the skybox fix whenever the skybox is re-rendered
    new MutationObserver(setSkybox).observe(document.body, { childList: true, subtree: true });

    // Modify the kill message
    const originalFunction = window.someKillFunction; // Replace `someKillFunction` with the actual function name that handles kill messages
    window.someKillFunction = function(killer, victim) {
        const message = `${killer} obliterated ${victim}`;
        originalFunction.call(this, killer, victim, message);
    };

    // Ensure scope colors are set for specific weapons
    const customScopeColor = "#880808";
    const css = `
        .scope-crackshot { border-color: ${customScopeColor} !important; }
        .scope-rpegg { border-color: ${customScopeColor} !important; }
        .scope-free-ranger { border-color: ${customScopeColor} !important; }
    `;
    const style = document.createElement("style");
    style.type = "text/css";
    style.appendChild(document.createTextNode(css));
    document.head.appendChild(style);
})();