briochemc

OContenders_script

Jul 16th, 2014
2,205
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. // ==UserScript==
  2. // @name          My_Texture pack and spin
  3. // @namespace     http://www.reddit.com/user/NewCompte
  4. // @description   Rotating Transparent gridded brioche texture pack
  5. // @include       http://*.koalabeast.com:*
  6. // @license       GPL
  7. // @author        NewCompte, modified by brioche
  8. // @version       1
  9. // ==/UserScript==
  10.  
  11. function myRotatingBallsScript() {
  12.     tagpro.ready(function(){
  13.         //This is important.
  14.         if(tagpro.events.drawPlayer)
  15.             return;
  16.         // Dark texture pack:
  17.         //document.getElementById("tiles").src = "http://i.imgur.com/q2TFiHE.png";
  18.         //document.getElementById("splats").src = "http://i.imgur.com/8g6gEF3.png";
  19.         //document.getElementById("speedpad").src = "http://i.imgur.com/MNtipme.png";
  20.         //document.getElementById("speedpadred").src = "http://i.imgur.com/QhJDOTY.png";
  21.         //document.getElementById("speedpadblue").src = "http://i.imgur.com/HFMXOSb.png";
  22.         //document.getElementById("portal").src = "http://i.imgur.com/9AjSUYN.png";
  23.        
  24.         // Ligh texture pack:
  25.         document.getElementById("tiles").src = "http://i.imgur.com/ffC7hHr.png";
  26.         document.getElementById("splats").src = "http://i.imgur.com/8g6gEF3.png";
  27.         document.getElementById("speedpad").src = "http://i.imgur.com/Ag8bLdO.png";
  28.         document.getElementById("speedpadred").src = "http://i.imgur.com/sF6aDVG.png";
  29.         document.getElementById("speedpadblue").src = "http://i.imgur.com/RCMrISg.png";
  30.         document.getElementById("portal").src = "http://i.imgur.com/c3YinY0.png";
  31.  
  32.         // Ligh texture pack with no diagonal grid:
  33.         //document.getElementById("tiles").src = "http://i.imgur.com/bJJ9lWL.png";
  34.         //document.getElementById("splats").src = "http://i.imgur.com/8g6gEF3.png";
  35.         //document.getElementById("speedpad").src = "http://i.imgur.com/UTVZhL9.png";
  36.         //document.getElementById("speedpadred").src = "http://i.imgur.com/SdQheBh.png";
  37.         //document.getElementById("speedpadblue").src = "http://i.imgur.com/eNwF4AM.png";
  38.         //document.getElementById("portal").src = "http://i.imgur.com/3ONRsjX.png";
  39.        
  40.         // Light texture pack with no grid at all:
  41.         //document.getElementById("tiles").src = "http://i.imgur.com/vJcZ2nD.png";
  42.         //document.getElementById("splats").src = "http://i.imgur.com/8g6gEF3.png";
  43.         //document.getElementById("speedpad").src = "http://i.imgur.com/0fVV3Pl.png";
  44.         //document.getElementById("speedpadred").src = "http://i.imgur.com/UzZs1Xb.png";
  45.         //document.getElementById("speedpadblue").src = "http://i.imgur.com/LGqltmX.png";
  46.         //document.getElementById("portal").src = "http://i.imgur.com/jJFGxcs.png";
  47.  
  48.         tagpro.events.register({
  49.             drawPlayer: function(player, context, drawPos, TILESIZE) {
  50.                 context.save();
  51.                 context.translate(drawPos.x + (TILESIZE / 2) * (1 / tagpro.zoom), drawPos.y + (TILESIZE / 2) * (1 / tagpro.zoom));
  52.                 context.rotate(player.angle)
  53.                 context.translate(-drawPos.x - (TILESIZE / 2) * (1 / tagpro.zoom), -drawPos.y - (TILESIZE / 2) * (1 / tagpro.zoom));
  54.                
  55.                 tagpro.tiles.drawWithZoom(context, player.team == 1 ? "redball" : "blueball", drawPos);
  56.  
  57.                 if (player.bomb && Math.round(Math.random() * 4) == 1) {
  58.                     context.fillStyle = "rgba(255, 255, 0, .60)";
  59.                     context.beginPath();
  60.                     context.arc(drawPos.x + (TILESIZE / 2) * (1 / tagpro.zoom), drawPos.y + (TILESIZE / 2) * (1 / tagpro.zoom), 17  * (1 / tagpro.zoom), 0, Math.PI*2, true);
  61.                     context.closePath();
  62.                     context.fill();
  63.                 };
  64.  
  65.                 if (player.tagpro) {
  66.                     context.strokeStyle = "#00FF00";
  67.                     context.fillStyle = "rgba(0, 255, 0, .20)";
  68.                     context.lineWidth = 2 * (1 / tagpro.zoom);
  69.                     context.beginPath();
  70.                     context.arc(drawPos.x + (TILESIZE / 2) * (1 / tagpro.zoom), drawPos.y + (TILESIZE / 2) * (1 / tagpro.zoom), 16  * (1 / tagpro.zoom), 0, Math.PI*2, true);
  71.                     context.closePath();
  72.                     if (!player.bomb)
  73.                         context.fill();
  74.                     context.stroke();
  75.                 }
  76.  
  77.                 context.restore();
  78.             }
  79.         });
  80.     });
  81. }
  82.  
  83. var source = "("+ myRotatingBallsScript + ")()";
  84. var script = document.createElement('script');
  85. script.setAttribute("type", "application/javascript");
  86. script.textContent = source;
  87.  
  88. document.body.appendChild(script);
Advertisement
Add Comment
Please, Sign In to add comment