colorblind helper for battles

Меняет обводку клеток (которая подсвечивается при наведении курсора на карту. Например во время хода существа)

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

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

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

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

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

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

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

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

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

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

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

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

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

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

// ==UserScript==
// @name         colorblind helper for battles
// @namespace    http://tampermonkey.net/
// @version      2024-03-26.4
// @description  Меняет обводку клеток (которая подсвечивается при наведении курсора на карту. Например во время хода существа)
// @author       Something begins
// @license      none
// @match       https://www.heroeswm.ru/war*
// @match       https://my.lordswm.com/war*
// @match       https://www.lordswm.com/war*
// @icon         https://www.google.com/s2/favicons?sz=64&domain=heroeswm.ru
// @grant        unsafeWindow
// ==/UserScript==
const strokeColor = "white";
const timerColor = "black";
function strokeWholeField(color){
    for (let x = 1; x <= defxn -2; x++){
        for (let y = 1; y <= defyn ; y++){
            let tile = shado[x + y * defxn];
            tile.stroke(color);
        }
    }
}
function changeTimerFun(){
    stage[war_scr].check_timer = () => {
        var anyway = false;
        //    anyway = true; total_time = 396;
        if ((anyway)||((total_time>0)&&(total_time<950)&&((!demomode)||(total_time<100))&&(!battle_ended))){
            var timer = Math.max(0, total_time-Math.floor((Date.now()-count_time)/1000));
            ctime = timer;
            if ((anyway)||(timer!=lasttimer)){
                lasttimer = timer;
                if (document.getElementById('timer')){
                    if ((stage[war_scr])&&(stage[war_scr].ground)&&(stage[war_scr].ground.inited_ground))
                    {
                        show_button('timer');
                    }
                    if (timer <= 5) {
                        document.getElementById('timer').innerHTML = `<span style="color:${timerColor}">${timer}</span>`;
                    } else {
                        document.getElementById('timer').innerHTML = timer
                    }
                };
                stage[war_scr].scale_timer();

            };
        }else{
            var was_visible = 0;
            if ((stage[war_scr].infos.timer_text)&&(btype!=86)&&(btype!=87)){
                if (get_visible(stage[war_scr].infos.timer_text)==1) was_visible = 1;
                set_visible(stage[war_scr].infos.timer_text, 0);
                if (was_visible){stage[war_scr].scale_timer();};
            };
        };
    };
}
let settings_interval = setInterval(() => {
    if (Object.keys(unsafeWindow.stage.pole.obj).length !== 0) {
        strokeWholeField(strokeColor);
        clearInterval(settings_interval);
        setTimeout(()=>{changeTimerFun()}, 3000);
    }
}, 300)