🏠 Home 

Car Theme

Car theme for Jstris


Installer dette script?
  1. // ==UserScript==
  2. // @name Car Theme
  3. // @namespace http://tampermonkey.net/
  4. // @version 0.2.1
  5. // @description Car theme for Jstris
  6. // @author You
  7. // @match https://*.jstris.jezevec10.com/*
  8. // @grant none
  9. // ==/UserScript==
  10. (function() {
  11. 'use strict';
  12. window.addEventListener('load', function(){
  13. //Jstris Block Skin Change
  14. loadSkin("https://i.imgur.com/nZlStFy.png",32);
  15. //Jstris Custom Background Image
  16. document.head.getElementsByTagName("style")[0].innerHTML="";
  17. document.body.style.backgroundImage="url('https://i.imgur.com/xYHDjPW.png')";
  18. document.body.style.backgroundSize="100%";
  19. document.getElementById("app").style.backgroundColor="rgba(0, 0, 0, 0)";
  20. document.getElementById("app").style.height="1000px";
  21. //Jstris SFX
  22. CustomSFXset.prototype = new BaseSFXset;
  23. loadSFX(new CustomSFXset);
  24. });
  25. })();
  26. function CustomSFXset(){
  27. this.volume=1;
  28. this.lock={url:"https://ecdldaiiere.github.io/Eddiez-Soundz/carlock.mp3",abs:1};
  29. this.ready={url:"https://ecdldaiiere.github.io/Eddiez-Soundz/carready.mp3",abs:1,set:1};
  30. this.go={url:"https://ecdldaiiere.github.io/Eddiez-Soundz/cargo.mp3",abs:1,set:0};
  31. this.died={url:"https://ecdldaiiere.github.io/Eddiez-Soundz/cardied.mp3",abs:1,set:1};
  32. this.hold={url:"https://ecdldaiiere.github.io/Eddiez-Soundz/carhold.mp3",abs:1,set:0};
  33. this.move={url:"https://ecdldaiiere.github.io/Eddiez-Soundz/carmove.mp3",abs:1,set:0};
  34. this.comboTones={url:"https://ecdldaiiere.github.io/Eddiez-Soundz/carcombo.mp3",abs:1,set:2,duration:2500,spacing:500,cnt:8};
  35. this.linefall={url:"blank.wav",abs:1,set:0};
  36. };
  37. /**************************
  38. Rotation Sounds Script
  39. **************************/
  40. Game['rotationSounds'] = [
  41. "https://ecdldaiiere.github.io/Eddiez-Soundz/car_rotate.mp3", //rotate left
  42. "https://ecdldaiiere.github.io/Eddiez-Soundz/car_rotate.mp3", //rotate right
  43. "https://ecdldaiiere.github.io/Eddiez-Soundz/car_rotate.mp3" //rotate 180°
  44. ];
  45. Game['rotationVolumes'] = [1,1,1]
  46. localStorage.evVol=localStorage.evVol||"100"
  47. Game["rArray"]=[];
  48. Game["rotationSounds"].map((x,i)=>{if(Game['rotationSounds'][i]){Game["rArray"].push(document.createElement("audio"));Game["rArray"][i].src=x}else{Game["rArray"].push(null)}})
  49. window.playRotSound = function(S){s=Game.rArray[S];!s.paused&&0<s.currentTime?s.currentTime=0:(s.volume=Game['rotationVolumes'][S]*localStorage.evVol/100,s.play())}
  50. var trim=a=>{a=a.slice(0,-1);a=a.substr(a.indexOf("{")+1);return a}
  51. var getParams=a=>{var params=a.slice(a.indexOf("(")+1);params=params.substr(0,params.indexOf(")")).split(",");return params}
  52. var rotFunc = Game['prototype']['rotateCurrentBlock'].toString()
  53. var rotParams = getParams(rotFunc)
  54. var rotInsert = 'var rotPos=[0,0,1,2]['+rotParams[0]+'+1];console.log(rotPos);Game.rArray[rotPos]&&playRotSound(rotPos);'
  55. rotFunc = rotInsert + trim(rotFunc)
  56. Game['prototype']['rotateCurrentBlock'] = new Function(...rotParams, rotFunc);