View difference between Paste ID: QGhGBUHe and 3RGmUJGV
SHOW: | | - or go back to the newest paste.
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";
17+
        //document.getElementById("tiles").src = "http://i.imgur.com/ffC7hHr.png";
18
        //document.getElementById("splats").src = "http://i.imgur.com/8g6gEF3.png";
19-
        //document.getElementById("speedpad").src = "http://i.imgur.com/MNtipme.png";
19+
        //document.getElementById("speedpad").src = "http://i.imgur.com/UFbQ3JQ.png";
20-
        //document.getElementById("speedpadred").src = "http://i.imgur.com/QhJDOTY.png";
20+
        //document.getElementById("speedpadred").src = "http://i.imgur.com/XOtl1UT.png";
21-
        //document.getElementById("speedpadblue").src = "http://i.imgur.com/HFMXOSb.png";
21+
        //document.getElementById("speedpadblue").src = "http://i.imgur.com/uQSjW46.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";
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";
27+
        //document.getElementById("speedpad").src = "http://i.imgur.com/Ag8bLdO.png";
28-
        document.getElementById("speedpadred").src = "http://i.imgur.com/sF6aDVG.png";
28+
        //document.getElementById("speedpadred").src = "http://i.imgur.com/sF6aDVG.png";
29-
        document.getElementById("speedpadblue").src = "http://i.imgur.com/RCMrISg.png";
29+
        //document.getElementById("speedpadblue").src = "http://i.imgur.com/RCMrISg.png";
30-
        document.getElementById("portal").src = "http://i.imgur.com/c3YinY0.png";
30+
        //document.getElementById("portal").src = "http://i.imgur.com/c3YinY0.png";
31
32-
        // Ligh texture pack with no diagonal grid:
32+
        // Light texture pack with no grid:
33-
        //document.getElementById("tiles").src = "http://i.imgur.com/bJJ9lWL.png";
33+
        document.getElementById("tiles").src = "http://i.imgur.com/vJcZ2nD.png";
34
        document.getElementById("splats").src = "http://i.imgur.com/8g6gEF3.png";
35-
        //document.getElementById("speedpad").src = "http://i.imgur.com/UTVZhL9.png";
35+
        document.getElementById("speedpad").src = "http://i.imgur.com/0fVV3Pl.png";
36-
        //document.getElementById("speedpadred").src = "http://i.imgur.com/SdQheBh.png";
36+
        document.getElementById("speedpadred").src = "http://i.imgur.com/UzZs1Xb.png";
37-
        //document.getElementById("speedpadblue").src = "http://i.imgur.com/eNwF4AM.png";
37+
        document.getElementById("speedpadblue").src = "http://i.imgur.com/LGqltmX.png";
38-
        //document.getElementById("portal").src = "http://i.imgur.com/3ONRsjX.png";
38+
        document.getElementById("portal").src = "http://i.imgur.com/jJFGxcs.png";
39
40-
        // Light texture pack with no grid at all:
40+
41-
        //document.getElementById("tiles").src = "http://i.imgur.com/vJcZ2nD.png";
41+
42
                context.save();
43-
        //document.getElementById("speedpad").src = "http://i.imgur.com/0fVV3Pl.png";
43+
44-
        //document.getElementById("speedpadred").src = "http://i.imgur.com/UzZs1Xb.png";
44+
45-
        //document.getElementById("speedpadblue").src = "http://i.imgur.com/LGqltmX.png";
45+
46-
        //document.getElementById("portal").src = "http://i.imgur.com/jJFGxcs.png";
46+
47
                tagpro.tiles.drawWithZoom(context, player.team == 1 ? "redball" : "blueball", drawPos);
48
49
                if (player.bomb && Math.round(Math.random() * 4) == 1) {
50
                    context.fillStyle = "rgba(255, 255, 0, .60)";
51
                    context.beginPath();
52
                    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);
53
                    context.closePath();
54
                    context.fill();
55
                };
56
57
                if (player.tagpro) {
58
                    context.strokeStyle = "#00FF00";
59
                    context.fillStyle = "rgba(0, 255, 0, .30)";
60
                    context.lineWidth = 2 * (1 / tagpro.zoom);
61
                    context.beginPath();
62
                    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);
63
                    context.closePath();
64
                    if (!player.bomb)
65
                        context.fill();
66
                    context.stroke();
67-
                    context.fillStyle = "rgba(0, 255, 0, .20)";
67+
68
69
                context.restore();
70
            }
71
        });
72
    });
73
}
74
75
var source = "("+ myRotatingBallsScript + ")()";
76
var script = document.createElement('script');
77
script.setAttribute("type", "application/javascript");
78
script.textContent = source;
79
80
document.body.appendChild(script);