hornex third eye range script

display m+eyes range

이 스크립트를 설치하려면 Tampermonkey, Greasemonkey 또는 Violentmonkey와 같은 확장 프로그램이 필요합니다.

이 스크립트를 설치하려면 Tampermonkey 또는 Violentmonkey와 같은 확장 프로그램이 필요합니다.

이 스크립트를 설치하려면 Tampermonkey 또는 Violentmonkey와 같은 확장 프로그램이 필요합니다.

이 스크립트를 설치하려면 Tampermonkey 또는 Userscripts와 같은 확장 프로그램이 필요합니다.

이 스크립트를 설치하려면 Tampermonkey와 같은 확장 프로그램이 필요합니다.

이 스크립트를 설치하려면 유저 스크립트 관리자 확장 프로그램이 필요합니다.

(이미 유저 스크립트 관리자가 설치되어 있습니다. 설치를 진행합니다!)

이 스타일을 설치하려면 Stylus와 같은 확장 프로그램이 필요합니다.

이 스타일을 설치하려면 Stylus와 같은 확장 프로그램이 필요합니다.

이 스타일을 설치하려면 Stylus와 같은 확장 프로그램이 필요합니다.

이 스타일을 설치하려면 유저 스타일 관리자 확장 프로그램이 필요합니다.

이 스타일을 설치하려면 유저 스타일 관리자 확장 프로그램이 필요합니다.

이 스타일을 설치하려면 유저 스타일 관리자 확장 프로그램이 필요합니다.

(이미 유저 스타일 관리자가 설치되어 있습니다. 설치를 진행합니다!)

// ==UserScript==
// @name           hornex third eye range script
// @namespace      http://tampermonkey.net/
// @version        1.0
// @description    display m+eyes range
// @author         AstRatJP
// @match          https://hornex.pro/*
// @license        MIT
// @grant          none
// ==/UserScript==

const canvas = document.getElementById("canvas");
const ctx = canvas.getContext("2d");
let range = 0;

function vh(vh) {
    return (vh * canvas.height) / 200;
}

function drawRange() {
    const petals = Array.from(document.querySelectorAll(".petals:not(.small) .petal.empty .petal"))

    const currentBuild = [];
    for (let i = 0; i < petals.length; i++) {
        if (petals[i].classList.item(2) === "no-icon" || petals[i].classList.item(3) === "no-icon") {
            petalPosition = petals[i].querySelector(".petal-icon").style.backgroundPosition;
        } else {
            petalPosition = petals[i].style.backgroundPosition;
        }
        if (petals[i].classList.item(1) === "spin") {
            tier = petals[i].classList.item(2);
        } else {
            tier = petals[i].classList.item(1);
        }
        currentBuild.push(petalPosition, tier);
    }





    const eyeIndex = currentBuild.indexOf("-600% 0%");
    const anteIndex = currentBuild.indexOf("-700% 0%");
    const eyeAndAnte = (eyeIndex !== -1 ? currentBuild[eyeIndex + 1] : "none") + (anteIndex !== -1 ? currentBuild[anteIndex + 1] : "none");
    switch (eyeAndAnte) {

        case ("tier-7tier-7"):
            range = vh(34);
            break;
        case ("tier-7tier-6"):
            range = vh(45.5);
            break;
        case ("tier-7tier-5"):
            range = vh(65.5);
            break;
        case ("tier-7none"):
            range = vh(130);
            break;

        case ("tier-6tier-7"):
            range = vh(24.7);
            break;
        case ("tier-5tier-7"):
            range = vh(15.8);
            break;


        case ("tier-6tier-6"):
            range = vh(34);
            break;
        case ("tier-5tier-6"):
            range = vh(22.5);
            break;

        case ("tier-6tier-5"):
            range = vh(48.2);
            break;
        case ("tier-6none"):
            range = vh(96);
            break;

        case ("tier-5tier-5"):
            range = vh(32);
            break;
        case ("tier-5none"):
            range = vh(64);
            break;

        default:
            range = 0;
    }

    ctx.beginPath();
    ctx.strokeStyle = "#ff6347";
  ctx.lineWidth = 3;
    ctx.arc(canvas.width / 2, canvas.height / 2, range, 0, 2 * Math.PI);
    ctx.stroke();

    requestAnimationFrame(drawRange);
}

drawRange();