Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // ==UserScript==
- // @name T99 Script
- // @namespace http://tampermonkey.net/
- // @version 0.1
- // @description try to take over the world!
- // @author You
- // @match https://*.jstris.jezevec10.com/*
- // @grant none
- // ==/UserScript==
- (function() {
- 'use strict';
- window.addEventListener('load', function(){
- //Jstris Custom Background Image
- document.head.getElementsByTagName("style")[0].innerHTML="";
- document.body.style.backgroundImage="url('https://media.discordapp.net/attachments/360554528556449795/361706190406680576/d29d4205-1f9e-4c85-8a5b-3f573e55b5f4.png')";
- document.body.style.backgroundSize="100%";
- document.getElementById("app").style.backgroundColor="rgba(0, 0, 0, 0)";
- document.getElementById("app").style.height="1000px";
- //Jstris SFX
- CustomSFXset.prototype = new BaseSFXset;
- loadSFX(new CustomSFXset);
- function CustomSFXset(){
- this.volume=1;
- this.lock={url:"https://ecdldaiiere.github.io/Eddiez-Soundz/t99lock.wav",abs:1};
- this.ready={url:"https://ecdldaiiere.github.io/Eddiez-Soundz/t99ready.wav",abs:1,set:1};
- this.go={url:"https://ecdldaiiere.github.io/Eddiez-Soundz/t99go.wav",abs:1,set:0};
- this.died={url:"https://ecdldaiiere.github.io/Eddiez-Soundz/t99died.wav",abs:1,set:1};
- this.hold={url:"https://ecdldaiiere.github.io/Eddiez-Soundz/t99hold.wav",abs:1,set:0};
- this.move={url:"https://ecdldaiiere.github.io/Eddiez-Soundz/t99move.wav",abs:1,set:0};
- };
- //Jstris Block Skin Change
- loadSkin("https://i.imgur.com/G6WbXoD.png",32);
- /**************************
- Special Events Script
- **************************/
- Game["clearSounds"] = [
- "https://ecdldaiiere.github.io/Eddiez-Soundz/t99_clear1.wav",
- "https://ecdldaiiere.github.io/Eddiez-Soundz/t99_clear1.wav",
- "https://ecdldaiiere.github.io/Eddiez-Soundz/t99_clear1.wav",
- "https://ecdldaiiere.github.io/Eddiez-Soundz/t99_clear2.wav",
- "https://ecdldaiiere.github.io/Eddiez-Soundz/t99_clear2.wav",
- "https://ecdldaiiere.github.io/Eddiez-Soundz/t99_clear3.wav",
- "https://ecdldaiiere.github.io/Eddiez-Soundz/t99_clear3.wav",
- "https://ecdldaiiere.github.io/Eddiez-Soundz/t99_clear4.wav",
- "https://ecdldaiiere.github.io/Eddiez-Soundz/t99_perfectclear.wav"
- ];
- var events = ["TSPIN_SINGLE","TSPIN_MINI_SINGLE","CLEAR1","TSPIN_DOUBLE","CLEAR2","TSPIN_TRIPLE","CLEAR3","CLEAR4","PERFECT_CLEAR"]
- Game["pieceSounds"] = [];
- if(typeof playSound != 'function') {
- window.playSound = function(s){!s.paused&&0<s.currentTime?s.currentTime=0:s.play()}
- }
- Game["clearSounds"].map((x,i)=>{
- Game["pieceSounds"].push(document.createElement("audio"));
- Game["pieceSounds"][i].src = x;
- Game["pieceSounds"][i].volume = .5;
- })
- var replacedFunc = Game['prototype']['checkLineClears'].toString()
- for (var i = 0; i < events.length; i++) {
- var insert = "Game['clearSounds']["+i+"]?playSound(Game['pieceSounds']["+i+"]):8>"+i+"&&playSound(Game['pieceSounds'][2*(0|("+i+"+2)/2)]);"
- replacedFunc = replacedFunc.replace(events[i]+")",events[i]+");" + insert)
- }
- replacedFunc = replacedFunc.slice(0,-1)
- replacedFunc = replacedFunc.substr(replacedFunc.indexOf("{")+1)
- Game['prototype']["checkLineClears"] = new Function(replacedFunc);
- });
- })();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement