Tetr.io Theme

Tetr.io Theme for Jstris

目前為 2020-02-03 提交的版本,檢視 最新版本

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

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

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

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

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

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

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

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

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

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

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

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

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

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

// ==UserScript==
// @name         Tetr.io Theme
// @namespace    http://tampermonkey.net/
// @version      0.11
// @description  Tetr.io Theme for Jstris
// @author       OSK, NueSB
// @match        https://*.jstris.jezevec10.com/*
// @grant        none
// ==/UserScript==

(function() {
    'use strict';

    window.addEventListener('load', function(){

        //Next Piece Sounds
        var trim=a=>{a=a.slice(0,-1);a=a.substr(a.indexOf("{")+1);return a}
        Game['pieceSoundsTGM'] = [];
        var srcs = [
          "https://ecdldaiiere.github.io/Eddiez-Soundz/goodlucky_imino.mp3",
          "https://ecdldaiiere.github.io/Eddiez-Soundz/goodlucky_omino.mp3",
          "https://ecdldaiiere.github.io/Eddiez-Soundz/goodlucky_tmino.mp3",
          "https://ecdldaiiere.github.io/Eddiez-Soundz/goodlucky_lmino.mp3",
          "https://ecdldaiiere.github.io/Eddiez-Soundz/goodlucky_jmino.mp3",
          "https://ecdldaiiere.github.io/Eddiez-Soundz/goodlucky_smino.mp3",
          "https://ecdldaiiere.github.io/Eddiez-Soundz/goodlucky_zmino.mp3",
          "https://cdn.discordapp.com/attachments/235512056588140546/558050338188558336/ITEM01.wav"
        ];

        Game['playSoundTGM'] = function(s)
        {
          if (!s.paused && s.currentTime > 0)
          {
            s.currentTime = 0;
          }
          else s.play();
        }

        function a(s, b)
        {
          for (var i = 0; i < b.length; i++)
          {
            s.push(document.createElement("audio"));
            s[i].src = b[i];
            s[i].volume = 0.8;
          }
        }
        a(Game['pieceSoundsTGM'], srcs);


        var uqbFunc = Game['prototype']['updateQueueBox'].toString()
        uqbFunc = "Game['playSoundTGM'](Game['pieceSoundsTGM'][this.queue[0].id]);" + trim(uqbFunc)
        Game['prototype']['updateQueueBox'] = new Function(uqbFunc);


        //Jstris SFX
        CustomSFXset.prototype = new BaseSFXset;
        loadSFX(new CustomSFXset);

        //Jstris Block Skin Change
        loadSkin("https://i.imgur.com/XcnWlC6.png",30);
        loadGhostSkin("https://i.imgur.com/f7kvOMi.png",30);
    }

  )();
})();

function CustomSFXset(){
    this.volume=1;
    this.lock={url:"https://ecdldaiiere.github.io/Eddiez-Soundz/goodluckylock.wav",abs:1};
    this.ready={url:"https://ecdldaiiere.github.io/Eddiez-Soundz/goodluckyready.mp3",abs:1,set:1};
    this.go={url:"https://ecdldaiiere.github.io/Eddiez-Soundz/goodluckygo.mp3",abs:1,set:0};
    this.died={url:"https://ecdldaiiere.github.io/Eddiez-Soundz/goodluckydied.mp3",abs:1,set:1};
    this.hold={url:"https://ecdldaiiere.github.io/Eddiez-Soundz/goodluckyhold.wav",abs:1,set:0};
    this.move={url:"https://ecdldaiiere.github.io/Eddiez-Soundz/goodluckymove.wav",abs:1,set:0};
    this.linefall={url:"https://ecdldaiiere.github.io/Eddiez-Soundz/goodluckylinefall.mp3",abs:1,set:0};
    this.comboTones={url:"https://ecdldaiiere.github.io/Eddiez-Soundz/goodluckycombo.mp3",abs:1,set:2,duration:1000,spacing:500,cnt:17};
    };