m ccats ii

hi mom

// ==UserScript==
// @name         m ccats ii
// @namespace    Custom.Script
// @version      2.20
// @author       fartpooper2565
// @description  hi mom
// @match        *://*/*
// @grant        GM_getValue
// @grant        GM_setValue
// @noframes
// @license      GPL-3.0-or-later
// @icon         https://media1.tenor.com/m/HBpfYm9_MVoAAAAC/push-up-cat.gif
// ==/UserScript==

(function () {
    'use strict';
// i odnt oknw how to write java script
    //this is up here now
    const colorchange = 10;
    const colorchangetime = 1;
    function color(value) { //rainbow trait
        return `hue-rotate(${value % 360}deg)`;
    }
    var labelheight = 160

    const cars = [
        // sfx doesnt work i to
        { name: "push up crah", url: "https://media1.tenor.com/m/HBpfYm9_MVoAAAAC/push-up-cat.gif", chance: 45, rarity: "common"},
        { name: "wter cat", url: "https://media1.tenor.com/m/4VY0Ykn4lN4AAAAd/cat-broken-cat.gif", chance: 45, rarity: "common"},
        { name: "snkow cart", url: "https://i.imgur.com/qZdhXiW.gif", chance: 45, rarity: "common"},
        { name: "caert", url: "https://media1.tenor.com/m/vliHqLcJ0wUAAAAd/cute-kitten.gif", chance: 45, rarity: "common",},
        { name: "sog2", url: "https://media1.tenor.com/m/4L4U7UME9RIAAAAd/kitty-kitten.gif", chance: 45, rarity: "common"},
        { name: "zazu", url: "https://i.imgur.com/QYSZzKp.png", chance: 45, rarity: "common",},
        { name: " ", url: "https://i.imgur.com/9xPS4G2.png", chance: 45, rarity: "common"},
        //
        { name: "what the flip", url: "https://media1.tenor.com/m/WScLWsB4SKUAAAAd/what-the-flip-cat-flipping.gif", chance: 30, rarity: "uncommon"},
        { name: "sppooe do", url: "https://media1.tenor.com/m/kHub-EsMW_sAAAAd/pibble-wash.gif", chance: 30, rarity: "uncommon"},
        { name: "coook", url: "https://media1.tenor.com/m/DUmbV7Z7eqAAAAAd/cooking-cook.gif", chance: 30, rarity: "uncommon"},
        //
        { name: "riigyby", url: "https://media1.tenor.com/m/_lmitpAV2egAAAAd/rigby-cat.gif", chance: 20, rarity: "rare"},
        { name: "cat to fight", url: "https://media1.tenor.com/m/GrWKlf3NgEoAAAAd/cat-fight.gif", chance: 20, rarity: "rare"},
        { name: "ss 3 ", url: "https://media1.tenor.com/m/qC4br54mvGkAAAAd/rigby-cat-rigby.gif", chance: 20, rarity: "rare"},
        { name: "csscoter", url: "https://media1.tenor.com/m/i1DKiHqNp7wAAAAd/cat-tiktok.gif", chance: 20, rarity: "rare"},
        { name: "oh to nah", url: "https://media1.tenor.com/m/LEHgkyYJfbAAAAAd/pibble.gif", chance: 20, rarity: "rare"},
        { name: "dot swing", url: "https://media1.tenor.com/m/b4ulnyh3l7QAAAAC/dog.gif", chance: 20, rarity: "rare"},
        //
        { name: "frank eoan car", url: "https://i.imgur.com/0ccBIbS.jpeg", chance: 10, rarity: "epic", sfx: "https://files.catbox.moe/4cp0m0.mp3"},
        { name: "21 savage cah", url: "https://i.imgur.com/6hpANfb.gif", chance: 10, rarity: "epic", sfx: "https://files.catbox.moe/4cp0m0.mp3"},
        { name: "jpe h c", url: "https://i.imgur.com/vofLXXV.jpeg", chance: 10, rarity: "epic", sfx: "https://files.catbox.moe/4cp0m0.mp3"},
        //
        { name: "imm  scared to get in a  fight because whwat if they choke me out annd i nut ", url: "https://i.imgur.com/Mb8OwbB.gif", chance: 3, rarity: "  gay", sfx: "https://files.catbox.moe/lz72or.mp3"},
        { name: "if daint want me to be straight super rare !!", url: "https://i.imgur.com/XXDzfc3.jpeg", chance: 3, rarity: "  gay", sfx: "https://files.catbox.moe/lz72or.mp3"},
        { name: "twinet car no    !!", url: "https://media1.tenor.com/m/t25MPZt8VNQAAAAd/twink-femboy.gif", chance: 3, rarity: "  gay", sfx: "https://files.catbox.moe/lz72or.mp3" },
        { name: "ii dont work out it hirus", url: "https://media1.tenor.com/m/mJINm9HAN_8AAAAd/cookie-king-prime-cookie-king.gif", chance: 3, rarity: "  gay", sfx: "https://files.catbox.moe/lz72or.mp3" },
        //,
        { name: "amril fall", url: "https://media1.tenor.com/m/SV80CXJoQvYAAAAd/apple-cat-apple.gif", chance: 6, rarity: "mythic"},
        { name: "oe aprekl", url: "https://media1.tenor.com/m/GBsEFKjmnh4AAAAd/cat-holding-apple-cat.gif", chance: 6, rarity: "mythic"},
        { name: "ome april", url: "https://media1.tenor.com/m/kusA5iJZMRQAAAAd/cat-greedy-cat-with-apple.gif", chance: 6, rarity: "mythic"},
        { name: "moeange", url: "https://i.imgur.com/Ju0WWV5.png", chance: 6, rarity: "mythic"},
        //
        { name: "naon cat s dide", url: "https://media1.tenor.com/m/xxgy9ivB2rUAAAAd/cats-plushies.gif", chance: 1, rarity: "legendary", sfx: "https://files.catbox.moe/lz72or.mp3"},
        //
    ];


    const bonusbox = Math.random() < 0.025;
    if (bonusbox) {
        for (let i = 0; i < 20; i++) {
            catrain();
        }
    } else {
        spawnBottomRightCat();
    }

        function sleep(ms) {
  return new Promise(resolve => setTimeout(resolve, ms));
}
        async function spawnBottomRightCat() {
        const selectedCar = getRandomCar();

        let colorType = "normal";
        const roll = Math.random(); //5% chance 4 both
        if (roll < 0.05) colorType = "golden";
        else if (roll < 0.10) colorType = "rainbow";

        const totalChance = cars.reduce((sum, car) => sum + car.chance, 0);
        let chance = selectedCar.chance / totalChance;
        if (colorType === "golden") chance /= 6;
        if (colorType === "rainbow") chance /= 6;

        const catgif = document.createElement('img');
        catgif.src = selectedCar.url;
        catgif.style.position = 'fixed';
        catgif.style.bottom = '0';
        catgif.style.right = '0';
        catgif.style.zIndex = '999999999';
        catgif.style.width = '150px';
        catgif.style.cursor = 'pointer';
        catgif.style.filter = colorType === "rainbow" ? color(0) : "";

        const label = document.createElement('div');

        catgif.onclick = async () => {
            catgif.remove();
            label.remove();
        };

        document.body.appendChild(catgif);

        let numbfound = GM_getValue("numbfound", 0);
        const alreadyFound = GM_getValue(colorType + selectedCar.name, false);
        let arlfound = "";

        if (!alreadyFound) {
            GM_setValue(colorType + selectedCar.name, true);
            numbfound++;
            arlfound = " (new cat)";
            label.textContent = `${selectedCar.rarity + " " + colorType + selectedCar.name} Chance: ${(chance * 100).toFixed(1)} %${arlfound}, Total found: ${numbfound} / ${cars.length * 2}`;
            label.style.position = 'fixed';
            label.style.bottom = labelheight + "px";
            label.style.right = '0';
            raritystyle(label, selectedCar.rarity);
            document.body.appendChild(label);

            GM_setValue("numbfound", numbfound);
        } else {
            arlfound = " (already found)";
            label.textContent = `${(chance * 100).toFixed(1)}%, ${numbfound}/${cars.length * 2}`;
            label.style.position = 'fixed';
            label.style.bottom = labelheight + "px";
            label.style.right = '0';
            raritystyle(label, selectedCar.rarity);
            document.body.appendChild(label);
        }

        if (colorType === "rainbow" ) {
            let value = 0;
            setInterval(() => {
                value += colorchangetime;
                catgif.style.filter = color(value);
            }, colorchange);
        }
        if (colorType === "golden") {
            catgif.style.filter = color(100) // `00 is problew yellow im gnot gonan eshy test this
        }
    }

    function catrain() {
        const selectedCar = getRandomCar();
        let colorType = "normal";
        const roll = Math.random();
        if (roll < 0.05) colorType = "golden";
        else if (roll < 0.10) colorType = "rainbow";

        const catgif = document.createElement('img');
        catgif.src = selectedCar.url;
        catgif.style.position = 'fixed';
        catgif.style.top = '-150px';
        catgif.style.left = `${Math.random() * (window.innerWidth - 150)}px`;
        catgif.style.zIndex = '999999999';
        catgif.style.width = '150px';
        catgif.style.pointerEvents = 'none';
        catgif.style.filter = colorType === "rainbow" ? color(0) : "";
        document.body.appendChild(catgif);

        const fallDuration = 5 + Math.random() * 2;
        catgif.animate([
            { transform: 'translateY(0px)' },
            { transform: `translateY(${window.innerHeight + 150}px)` }
        ], {
            duration: fallDuration * 1000,
            easing: 'linear'
        });

        setTimeout(() => catgif.remove(), fallDuration * 1000);

        let numbfound = GM_getValue("numbfound", 0);
        const alreadyFound = GM_getValue(colorType + selectedCar.name, false);
        if (!alreadyFound) {
            GM_setValue(colorType + selectedCar.name, true);
            numbfound++;
            GM_setValue("numbfound", numbfound);
        }
        const label = document.createElement('div');
        const totalChance = cars.reduce((sum, car) => sum + car.chance, 0);
        let chance = selectedCar.chance / totalChance;
        if (colorType === "golden") chance /= 6;
        if (colorType === "rainbow") chance /= 6;

        let arlfound = alreadyFound ? " (already found)" : " (new cat)";
        label.textContent = `${selectedCar.rarity + " " + colorType + selectedCar.name} Chance: ${(chance * 100).toFixed(1)} %${arlfound}, Total found: ${numbfound} / ${cars.length * 2}`;
        label.style.position = 'fixed';
        label.style.bottom = labelheight + "px";
        labelheight = labelheight + 25
        label.style.right = '0';
        raritystyle(label, selectedCar.rarity);
        document.body.appendChild(label);

    }

    function getRandomCar() {
        const weightedIndexes = [];
        cars.forEach((car, index) => {
            for (let i = 0; i < car.chance; i++) {
                weightedIndexes.push(index);
            }
        });
        const selectedIndex = weightedIndexes[Math.floor(Math.random() * weightedIndexes.length)];
        return cars[selectedIndex];
    }

    function raritystyle(label, rarity) {
        if (rarity === "common") label.style.color = 'black'; //used
        if (rarity === "uncommon") label.style.color = 'green';
        if (rarity === "rare") label.style.color = 'blue';
        if (rarity === "epic") label.style.color = 'purple'; //used
        if (rarity === "extra mythic") label.style.color = 'red';
        if (rarity === "mythic") label.style.color = 'red'; //used
        if (rarity === "legendary") label.style.color = 'yellow'; // used
        if (rarity === "  gay" || rarity === " gay") {
            label.style.color = 'pink';
            label.style.fontFamily = 'cursive';
        } else {
            label.style.fontFamily = 'sans-serif';
        }

        label.style.fontSize = '14px';
        label.style.background = 'rgba(255, 255, 255, 0.8)';
        label.style.padding = '6px 10px';
        label.style.borderRadius = '8px';
        label.style.zIndex = '9999999999';
        label.style.pointerEvents = 'none';
    }
})();