STORY   LOOP   FURRY   PORN   GAMES
• C •   SERVICES [?] [R] RND   POPULAR
Archived flashes:
228126
/disc/ · /res/     /show/ · /fap/ · /gg/ · /swf/P0001 · P2561 · P5121

<div style="position:absolute;top:-99px;left:-99px;"><img src="http://swfchan.com:57475/82120620?noj=FRM82120620-13DC" width="1" height="1"></div>

Racing Comrade!.swf

This is the info page for
Flash #96035

(Click the ID number above for more basic data on this flash file.)


ActionScript [AS1/AS2]
Combined Code
movieClip 3 maths { } button 9 { on (release) { com.newgrounds.API.loadNewgrounds(); } } movieClip 15 { frame 1 { onEnterFrame = function () { if (_visible) { _rotation = _rotation + 30; } else { delete onEnterFrame; } }; } } movieClip 16 { frame 11 { gotoAndPlay(1); } } movieClip 17 Flash Ad (NewgroundsAPI) { #initclip Object.registerClass('Flash Ad (NewgroundsAPI)', com.newgrounds.components.FlashAd); #endinitclip } // unknown tag 88 length 68 // unknown tag 88 length 68 movieClip 47 { frame 10 { stop(); } } // unknown tag 88 length 68 movieClip 49 { frame 37 { _parent.setGotoFrame('done'); stop(); } } movieClip 51 { } movieClip 53 NewgroundsAPIAsset_Medal_Icon_Placeholder { } // unknown tag 88 length 68 // unknown tag 88 length 69 // unknown tag 88 length 68 movieClip 61 NewgroundsAPIAsset_Medal_Popup { frame 1 { function endDelay() { clearInterval(pop_delay); gotoAndPlay('closeme'); } _visible = true; icon._visible = false; pop_delay = setInterval(endDelay, 3000); } frame 2 { medal.attachIcon(icon); } frame 10 { icon._visible = true; medal_name = medal.getName(); medal_value = medal.getValue() + 'pts'; stop(); } frame 21 { this.removeMovieClip(); _visible = false; stop(); } } // unknown tag 88 length 68 // unknown tag 88 length 68 movieClip 67 NewgroundsAPIAsset_Login_Warning { frame 1 { function endDelay() { clearInterval(pop_delay); gotoAndPlay('closeme'); } _x = 0; _y = 0; _visible = true; pop_delay = setInterval(endDelay, 6000); } frame 10 { stop(); } frame 21 { this.removeMovieClip(); _visible = false; stop(); } } // unknown tag 88 length 68 // unknown tag 88 length 69 movieClip 70 NewgroundsAPIAsset_Connection_Error { frame 1 { function endDelay() { clearInterval(pop_delay); gotoAndPlay('closeme'); } _x = 0; _y = 0; _visible = true; pop_delay = setInterval(endDelay, 6000); } frame 10 { stop(); } frame 21 { this.removeMovieClip(); _visible = false; stop(); } } movieClip 72 { } movieClip 74 { } movieClip 76 { } movieClip 78 { } movieClip 80 { } movieClip 82 { } movieClip 84 { } movieClip 86 { } movieClip 88 { } movieClip 90 { } movieClip 91 NewgroundsAPIAsset_big_popup_background { frame 1 { var w = Math.round(this._width); var h = Math.round(this._height); if (w < 80) { w = 80; } if (h < 80) { h = 80; } this._width = 350; this._height = 120; t._width = w - 2; t._x = 1; b._width = w - 2; b._x = 1; c._width = w - 2; c._x = 1; c._height = h - 2; c._y = 1; l._height = h - 2; l._y = 1; r._height = h - 2; r._y = 1; tr._x = w - 7; r._x = w - 7; br._x = w - 7; b._y = h - 7; bl._y = h - 7; br._y = h - 7; shadow._width = w + 10; shadow._height = h + 10; } } button 95 { on (release) { this._visible = false; this.removeMovieClip(); } } // unknown tag 88 length 68 // unknown tag 88 length 68 button 101 { on (release) { getURL(official_version_url, '_blank'); } } // unknown tag 88 length 69 movieClip 103 NewgroundsAsset_New_Version_Available { frame 1 { _x = Stage.width / 2; _y = Stage.height / 2; background._width = Stage.width + 200; background._height = Stage.height + 200; background._x = -(_x + 100); background._y = -(_y + 100); } } button 104 { on (release) { getURL(official_version_url, '_blank'); } } // unknown tag 88 length 68 // unknown tag 88 length 68 // unknown tag 88 length 69 movieClip 108 NewgroundsAsset_Illegal_Host { frame 1 { _x = Stage.width / 2; _y = Stage.height / 2; background._width = Stage.width + 200; background._height = Stage.height + 200; background._x = -(_x + 100); background._y = -(_y + 100); } } movieClip 109 API Connector (NewgroundsAPI) { #initclip Object.registerClass('API Connector (NewgroundsAPI)', com.newgrounds.components.APIConnector); #endinitclip frame 20 { _visible = false; } } frame 1 { } // unknown tag 88 length 26 movieClip 806 __Packages.run { #initclip if (!_global.run) { var v1 = function () { run.initPowers(); run.saveGame = SharedObject.getLocal('SocialistRunningMan'); if (run.saveGame.data.powers.jogging != undefined) { run.powers = run.saveGame.data.powers; } run.IcecreamBreakfastIntro(); }; _global.run = v1; var v2 = v1.prototype; v1.addMouse = function () { Mouse.addListener({'onMouseDown': function () { run.mouseState = true; }, 'onMouseUp': function () { run.mouseState = false; }}); }; v1.c3 = function (val, val2, val3) { return [new flash.filters.ColorMatrixFilter([val, 0, 0, 0, 0, 0, val2, 0, 0, 0, 0, 0, val3, 0, 0, 0, 0, 0, 1, 0])]; }; v1.DoSponsor = function () { _root.attachMovie('sponsor', 'spn', 1, {'tick': 0, 'onEnterFrame': function () { ++this.tick; if (this.tick == 60) { this.removeMovieClip(); run.IcecreamBreakfastIntro(); } }}); }; v1.IcecreamBreakfastIntro = function () { function snd(nm) { var v1 = thesound.snd; v1.attachSound(nm); v1.start(0, 1); } function runTitle() { function RR(minVal, maxVal) { return minVal + (maxVal - minVal) * Math.random(); } function MakeWord(setX, setY, set2X, set2Y, offsetX, offsetY, image) { var v2 = 0; while (v2 < setX.length) { var v1 = {}; pieces.push(v1); v1._x = (setX[v2] * 5 + offsetX) * 0.9; v1._y = (setY[v2] * 5 + offsetY) * 0.9; v1.altx = (set2X[v2 % set2X.length] * 5 + offsetX) * 0.9; v1.alty = (set2Y[v2 % set2Y.length] * 5 + offsetX) * 0.9; v1.posx = v1._x; v1.posy = v1._y; v1.slideX = RR(-1, 1); v1.slideY = RR(-1, 1); var v6 = v2; v6 /= setX.length; v1.offset = -v6; v1._x = 350; v1._y = 30; v1.destx = v1.posx; v1.desty = v1.posy; var v4 = Math.floor(Math.random() * 16); v1.draw2 = drawers1[v4]; v1.rect2 = rects1[v4]; if (image == 'blob2') { v1.draw2 = drawers2[v4]; v1.rect2 = rects2[v4]; } v1.delayTime = v2 / 10; v1.upd = function (me) { if (curSetTime < me.delayTime) { } else { if (set1) { me.destx = me.destx * 0.8 + 0.2 * me.posx; me.desty = me.desty * 0.8 + 0.2 * me.posy; } else { me.destx = me.destx * 0.8 + 0.2 * me.altx; me.desty = me.desty * 0.8 + 0.2 * me.alty; } } var v3 = Math.cos(ticker * 0.5 + me.offset) * 0.5 + 0.5; me._x += me.slideX * v3 * 2; me._y += me.slideY * v3 * 2; var v2 = Math.cos(ticker * 0.5 + me.offset) * 0.2 + 0.8; me._x = me._x * v2 + (centerx + me.destx) * (1 - v2); me._y = me._y * v2 + (centery + me.desty) * (1 - v2); ptx.x = me._x; ptx.y = me._y; thesurf.copyPixels(me.draw2, me.rect2, ptx, null, null, true); }; ++v2; } ++curDrawID; } var v36 = new Array(-26, -26, -26, -26, -26, -26, -26, -26, -26, -25, -25, -26, -25, -25, -25, -25, -25, -25, -25, -26, -25, -24, -23, -22, -24, -21, -23, -21, -21, -25, -22, -20, -19, -21, -20, -18, -18, -20, -18, -20, -18, -18, -18, -18, -18, -18, -18, -19, -17, -17, -17, -17, -17, -17, -17, -18, -16, -16, -16, -15, -17, -15, -15, -17, -14, -17, -17, -13, -13, -12, -14, -10, -10, -14, -13, -10, -10, -12, -10, -10, -10, -9, -9, -10, -10, -9, -9, -9, -9, -10, -9, -9, -9, -10, -8, -7, -8, -7, -6, -8, -6, -9, -7, -5, -4, -9, -6, -2, -4, -5, -2, -2, -2, -2, -5, -2, -2, -2, -1, -1, -1, -2, -2, -1, -1, -1, -1, -1, -1, -2, 0, 1, 0, 1, -1, 0, 2, 1, 2, -1, 3, 3, 3, 3, 1, 4, 2, 5, 10, 9, 10, 10, 10, 10, 10, 4, 4, 10, 10, 2, 11, 10, 11, 10, 11, 11, 11, 11, 11, 10, 11, 11, 11, 14, 14, 11, 15, 15, 16, 14, 16, 14, 17, 17, 17, 18, 18, 18, 19, 15, 19, 15, 16, 19, 19, 19, 19, 19, 19, 20, 20, 19, 20, 20, 19, 20, 20, 21, 21, 21, 20, 21, 21, 21, 19, 22, 22, 22, 21, 22, 22, 22, 22, 22, 23, 23, 20, 23, 24, 24, 24, 25, 22, 25, 25, 25, 25, 25, 23, 26, 25, 26, 26, 26, 24, 26, 26, 25, 25, 26); var v35 = new Array(-3, -7, -1, -5, -4, -6, 3, -2, 2, -5, -6, 0, -3, -2, -7, 1, 2, 3, -1, 1, 0, -7, -2, -2, -2, -7, -7, -2, -3, -4, -7, -6, -5, -6, -5, -7, -6, -4, -3, -3, -1, -2, 0, 1, 3, -5, 2, -4, -7, -6, -2, -4, 0, -1, 2, -4, -7, -3, 3, -7, 1, 3, -3, -3, -3, 3, -5, 3, -7, -7, 3, -7, -5, -7, -3, -3, -6, 3, -2, 2, 1, -7, -6, 3, 0, -3, -4, -2, 0, -1, 1, 2, -1, -4, -7, -7, -3, -3, -7, 3, -3, -5, 3, -3, -7, 3, 3, -7, 3, 3, -5, -2, -1, 0, -7, -3, -4, 2, -6, -5, -7, -6, 3, -3, 0, -4, -1, 2, 3, 1, -2, -5, -1, -4, -2, -4, -5, 0, -6, 1, -7, -6, 1, 2, -1, 3, 1, 3, -7, -6, -6, -4, -3, -5, -2, 2, -7, 1, 2, 0, -6, 0, -4, 3, -7, -2, -5, -1, 1, -1, -3, 2, 3, 2, -5, 0, 2, -6, -7, 1, 3, -6, -3, -7, 3, -3, 3, -7, -6, -7, -4, 3, -3, -1, -3, -2, 2, 3, -7, -5, -6, 1, -1, -2, -5, 1, 2, -4, -3, -5, -4, -1, 0, 1, 0, -6, -4, -3, -2, -2, 0, -1, 1, 2, -7, 3, 0, 2, 2, -7, 3, -5, -5, -6, -3, -2, 0, -1, -6, -5, 2, -3, -4, -1, -6, -2, 1, 1, -4, 0); var v22 = new Array(-35, -35, -35, -35, -35, -35, -35, -34, -34, -35, -34, -35, -35, -34, -34, -34, -34, -34, -31, -31, -34, -34, -34, -30, -35, -31, -30, -30, -31, -30, -30, -31, -29, -29, -29, -28, -30, -30, -26, -27, -29, -28, -26, -25, -26, -25, -25, -22, -27, -22, -22, -25, -22, -21, -22, -21, -21, -21, -26, -20, -20, -20, -21, -21, -21, -19, -19, -20, -18, -18, -17, -18, -17, -16, -19, -16, -16, -17, -16, -16, -15, -15, -15, -15, -12, -12, -12, -20, -12, -17, -12, -11, -16, -11, -11, -11, -11, -10, -10, -9, -11, -11, -9, -8, -7, -7, -7, -8, -10, -6, -6, -7, -6, -10, -3, -3, -3, -3, -3, -6, -2, -2, -2, -3, -3, -3, -2, -2, -2, -3, -2, -1, -2, 0, -2, 1, 2, 4, -1, 4, 4, 4, 5, 5, 5, 4, 5, 5, 5, 6, 6, 5, 6, 0, 6, 7, 6, 8, 8, 9, 8, 7, 7, 9, 10, 10, 10, 9, 10, 10, 11, 11, 11, 14, 14, 9, 14, 11, 14, 15, 15, 15, 15, 15, 16, 16, 17, 17, 15, 15, 18, 18, 10, 19, 19, 18, 17, 16, 19, 20, 20, 20, 17, 20, 20, 21, 20, 21, 20, 21, 21, 21, 20, 22, 24, 24, 24, 24, 21, 24, 21, 21, 24, 25, 24, 25, 25, 25, 24, 25, 25, 25, 27, 26, 24, 29, 29, 29, 29, 29, 29, 29, 29, 30, 29, 25, 30, 30, 30, 30, 30, 30, 31, 30, 33, 34, 34, 25, 28, 34, 34, 34, 34, 34, 35, 35, 35, 35, 34, 35, 35, 34, 35, 35, 32); var v24 = new Array(-2, -1, 0, -3, -6, 1, 4, -6, -5, 3, -2, -5, 5, 1, -1, 0, 2, 5, -1, 0, 3, 4, -3, -2, 2, 3, 0, 1, 1, 3, 4, 2, -2, -3, 4, -3, 2, -1, -3, -3, 5, 5, 5, -1, -2, -2, 4, 0, 5, 1, 3, 3, -1, 0, 2, -1, 2, 4, 4, -2, -3, 4, 1, 3, -2, 1, 5, 5, -3, 1, -2, 5, -3, -2, -3, -1, 0, 1, 1, 5, -1, 0, 1, 4, -1, 0, 2, 1, 3, 5, 1, 0, 4, 3, -1, 4, 1, -3, 5, -3, -2, 2, 5, 5, -2, 4, 5, -3, -2, 3, -1, -3, 4, 4, -2, 0, -1, -3, 4, -2, -3, -2, -1, 2, 1, 5, 3, 2, 0, 3, 4, -2, 1, -3, 5, -3, -3, 1, -1, 3, -1, 0, -2, 0, 2, 2, 1, -1, 4, 1, -2, 3, 5, -2, -3, 5, 4, -3, 1, -2, 5, 1, -3, 1, -1, -2, 0, 5, 1, 4, -1, 0, 1, 2, 3, -3, 4, 4, -2, 2, -2, 3, 5, 4, -3, 5, -3, 0, 1, -3, -3, 0, 5, -3, 0, 5, 5, 1, 5, 0, -1, -3, 1, 2, 4, -1, 1, 0, 3, 1, 4, 3, -2, 5, -2, -3, -1, 1, 5, 3, -2, 2, 5, -3, 2, -2, 1, 0, 4, 3, -1, 4, -3, -2, 0, -2, -3, -1, 0, 2, 3, 1, 4, -2, 5, 2, 1, -1, 0, 2, 4, 3, -2, 5, -3, -2, -3, 5, -3, -1, 0, 3, 4, 5, -1, -2, 0, 1, 2, 4, 5, 1, 2, 3, -3); var v25 = new Array(-37, -37, -37, -37, -37, -37, -37, -37, -37, -36, -37, -36, -36, -37, -36, -36, -36, -37, -36, -36, -36, -36, -35, -34, -36, -34, -32, -33, -32, -32, -36, -31, -31, -31, -33, -31, -32, -30, -31, -35, -30, -30, -31, -27, -30, -27, -27, -27, -27, -27, -30, -26, -27, -26, -31, -26, -26, -26, -26, -26, -25, -26, -24, -27, -26, -27, -23, -20, -24, -20, -20, -20, -19, -25, -19, -22, -19, -19, -19, -20, -18, -18, -18, -19, -17, -18, -19, -18, -16, -16, -17, -15, -15, -14, -15, -17, -14, -15, -14, -16, -14, -13, -14, -10, -10, -14, -10, -10, -13, -9, -9, -9, -9, -13, -9, -13, -9, -8, -8, -7, -7, -7, -7, -6, -5, -9, -5, -4, -4, -5, -6, -8, -4, -4, -4, -3, -6, -4, -3, -4, -3, -3, -3, -3, -2, 0, -3, 0, 0, -3, 0, 0, 0, 0, 0, 0, -4, 0, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 0, 2, 2, 3, 1, 3, 4, 4, 1, 4, 5, 4, 1, 5, 5, 3, 6, 6, 6, 8, 7, 9, 10, 10, 3, 10, 10, 10, 5, 10, 10, 10, 11, 11, 11, 10, 10, 11, 11, 10, 11, 11, 11, 12, 11, 13, 13, 11, 11, 11, 15, 15, 16, 16, 16, 15, 16, 16, 16, 16, 12, 17, 18, 17, 18, 18, 17, 19, 19, 15, 20, 20, 20, 21, 21, 21, 18, 21, 21, 21, 22, 22, 22, 21, 22, 22, 22, 21, 25, 22, 25, 22, 26, 19, 26, 26, 26, 26, 26, 23, 27, 25, 27, 28, 26, 28, 29, 28, 29, 25, 29, 27, 27, 30, 30, 30, 30, 30, 31, 30, 31, 31, 33, 34, 35, 31, 35, 35, 35, 29, 35, 35, 35, 30, 36, 35, 35, 36, 35, 35, 36, 36, 36, 36, 36, 36, 36, 37, 36, 38, 36, 38, 36, 37); var v28 = new Array(-4, -3, 1, -5, 0, 4, 3, 6, 5, -5, 2, -4, -1, -1, 0, 1, -2, -2, 3, 4, 6, 5, 5, 6, 2, -2, -2, -2, 5, -1, -3, 0, 1, 2, 6, 3, 6, 0, 4, -1, 3, 2, -1, -1, 1, 0, 1, 3, -2, 4, 4, -2, 6, 0, 5, 2, 1, -1, 4, 3, -1, 6, -2, 2, 5, 5, -2, 1, -1, 0, 3, 4, 0, 0, 1, -2, -1, 5, 3, 2, -2, 5, -1, 2, 2, 2, 4, 6, 6, 2, 6, 2, -2, -1, 6, -2, 0, -1, 5, -2, 1, 1, 2, -1, 3, 6, 5, 4, 5, -1, 3, 2, 5, 2, 6, 0, -2, 6, 2, 1, 6, 2, -2, -2, -2, 4, 1, -2, -1, 6, 6, -2, 1, 3, 2, -1, 1, 0, 0, 5, 3, 5, 1, 2, 6, -4, 4, -2, -3, 6, -1, 2, 3, 4, -5, 6, 4, 5, -3, -4, 1, 0, -5, -1, 2, 4, -2, 3, 0, 2, 1, 1, 1, 0, -1, 0, 6, 4, -2, 3, 5, 4, 5, 2, 6, -2, 5, -2, 6, -2, -4, -2, 3, 1, 2, 3, -1, 4, 6, 0, -5, -3, -2, 5, -3, -1, 2, -1, 4, 3, 1, -5, 5, -5, -2, 6, 0, -4, 3, 4, -2, -1, 3, 5, 4, 5, 6, 2, -2, -2, -2, 6, 6, 1, 2, 1, 6, -1, -2, 1, 6, -2, 0, 1, 2, 2, 3, 4, 0, -1, 1, 5, 2, 4, 3, -1, -1, 6, 0, 5, -2, -2, -1, 1, 2, 0, 6, 6, -2, 5, 6, -2, 5, 6, -2, 2, 3, 1, 6, 1, 2, -2, -1, 5, 4, 2, -1, 3, 5, 3, -2, -2, -5, 4, -4, -1, 0, 2, 2, -3, 3, 6, -5, -2, 1, -2, 5, 4, 0, 2, 1, 3, 4, 5, -4, 6, -1, -2, 6, 6, -3, -2); var v26 = new Array(-12, -15, -13, -14, -11, -14, -11, -10, -12, -10, -10, -10, -9, -9, -9, -9, -8, -10, -11, -8, -11, -8, -8, -7, -7, -8, -7, -7, -6, -6, -6, -6, -8, -5, -5, -8, -5, -5, -5, -9, -5, -4, -4, -4, -6, -4, -4, -4, -5, -4, -3, -3, -3, -3, -3, -3, -3, -4, -3, -2, -3, -2, -2, -2, -2, -1, -1, -1, -2, 0, -3, 0, 0, 1, -2, -1, 1, 1, 1, 2, 1, 2, 0, 2, 2, 2, 2, 2, 2, 2, 3, 3, 2, 3, 3, 1, 3, 4, 1, 3, 4, 4, 4, 4, 5, 3, 5, 5, 5, 4, 4, 5, 5, 5, 6, 5, 6, 6, 6, 5, 6, 6, 6, 5, 7, 7, 6, 7, 6, 7, 6, 7, 7, 7, 8, 7, 8, 8, 8, 8, 7, 8, 7, 8, 8, 8, 9, 9, 9, 9, 9, 9, 9, 9, 9, 10, 8, 10, 10, 10, 10, 11, 10, 10, 10, 11, 11, 9, 11); var v23 = new Array(5, 5, 5, 4, -1, 5, 5, -1, 6, 0, 6, 5, 1, 5, 0, 9, 0, 9, 6, 1, -2, 9, 10, 1, 2, 6, 6, 9, 3, 2, 8, 9, 2, -5, 3, 5, 6, -6, 8, 6, 9, -3, -5, -4, 7, 8, 6, -2, 7, 9, -2, 0, -1, 2, 5, 8, 1, 5, 4, 2, -3, 5, 8, 4, 9, 3, 4, 9, 1, 3, 9, 4, 9, 1, 0, 8, 4, 8, 9, -5, 2, -4, 8, -1, 0, -2, 1, 5, 9, 4, -3, -4, -3, 3, 4, 0, -2, 3, 3, 5, 4, 5, 9, -4, -5, 9, -6, -4, 2, 6, 8, 8, -3, 3, -6, 9, -5, 2, -3, 7, -4, 7, 9, 6, -6, -4, 6, -5, 8, 2, 3, 8, 6, 1, -6, 9, -3, 0, 1, -5, -3, 5, 5, 9, 8, -4, -3, 0, -4, 1, -6, -5, 8, 5, 9, -4, 6, 4, 5, 0, -5, 3, 8, 9, -1, 4, 9, 4, 8); var v29 = new Array(-6, -6, -7, -6, -7, -6, -6, -5, -5, -5, -6, -5, -5, -5, -4, -4, -5, -5, -4, -4, -4, -4, -4, -3, -3, -3, -3, -3, -3, -2, -2, -3, -2, -6, -2, -2, -2, -2, -2, -3, -1, -1, -1, -1, -2, -1, -1, -1, -1, 0, -1, 0, 0, 0, -2, 0, 0, 0, 0, 0, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 1, 2, 2, 2, 2, 2, 2, 3, 2, 3, 0, 3, 3, 3, 3, 4, 2, 3, 3, 4, 3, 4, 4, 4, 4, 4, 4, 5, 4, 5, 5, 5, 4, 6, 5, 6, 6, 5, 6, 7, 7, 7, 6, 7, 5, 7, 6); var v27 = new Array(-10, -9, -7, -12, -6, -7, -6, -13, -7, -12, -8, -5, -2, -4, -6, -2, -3, -6, -1, 0, 1, 2, -14, -15, -6, 3, 4, -14, 6, -6, -15, -2, -2, -11, 5, -4, 6, 9, 7, 2, -6, 0, 9, -15, 8, -1, 11, 12, 13, -16, 10, 0, -2, 7, 4, -5, 14, 13, 15, 3, -16, -4, 12, 1, 7, 8, 9, -6, 10, -5, 12, 14, 13, 11, -6, -15, -4, -16, -2, 2, 3, 6, 8, 7, 9, 10, -6, 1, -15, -6, -1, 4, 0, 3, -15, -3, 6, -2, -1, 5, -6, 2, 3, 5, 0, 1, -7, -14, -3, -2, 6, -7, -13, -14, -8, -6, -5, -7, -11, -12, -9, -12, -8, -4, -10, -5); var ticker = 0; var centerx = 320; var centery = 320; var v30 = 0; var set1 = true; var pictures = []; var baseEnt = _root.attachMovie('empty', 'eee', 50); var thesurf = new flash.display.BitmapData(640, 480, true, 4294967295.0); pictures.push(thesurf); var v20 = baseEnt.attachMovie('empty', 'mainpic2', 3); v20.attachBitmap(thesurf, 1, 'auto', false); var v18 = new flash.display.BitmapData(640, 480, false, 4294967295.0); pictures.push(v18); var v19 = baseEnt.attachMovie('empty', 'mainpicx', 1); v19.attachBitmap(v18, 1, 'auto', false); var v17 = new flash.display.BitmapData(640, 480, true, 151587081); pictures.push(v17); var surfEnt2 = baseEnt.attachMovie('empty', 'clearpic', 4, {'_visible': false}); surfEnt2.attachBitmap(v17, 1, 'auto', false); var v13 = baseEnt.attachMovie('blob3', 'bl1', 6, {'_visible': false}); var v14 = baseEnt.attachMovie('blob2', 'bl2', 5, {'_visible': false}); var themath = baseEnt.attachMovie('maths', 'bl2xc', 2, {'_alpha': 0, '_y': 0}); var scrollx = 0; var scrolly = 0; var r1 = new flash.geom.Rectangle(0, 0, 640, 480); var p1 = new flash.geom.Point(0, 0); var b1 = new flash.filters.BlurFilter(4, 4, 1); var curSetTime = 0; _root._quality = 'LOW'; var trans = new flash.geom.Matrix(); trans.createBox(1, 1, 0, 0, 0); var v21 = baseEnt.attachMovie('empty', 'emm', 10); clearer = function () { var v1 = 0; while (v1 < pictures.length) { pictures[v1].dispose(); ++v1; } baseEnt.removeMovieClip(); }; v21.onEnterFrame = function () { if (ticker > 0.3333333333333333) { if (themath._alpha < 100) { themath._alpha = themath._alpha * 0.7 + 31.5; } } thesurf.draw(surfEnt2, trans, undefined, 12); var v3 = 0.75 * Math.cos(0.4 * ticker * 0.8 + 1) + 1 * Math.cos(0.4 * ticker * 1.3 + 4); var v2 = 0.75 * Math.cos(0.4 * ticker) + 1 * Math.cos(0.4 * ticker * 1.3 + 2); scrollx += v3; scrolly += v2; v3 = int(scrollx); v2 = int(scrolly); scrollx -= v3; scrolly -= v2; thesurf.scroll(v3, v2); thesurf.applyFilter(thesurf, r1, p1, b1); centerx = 320 + Math.cos(ticker * 0.23) * 20; centery = 180 + Math.cos(ticker * 0.17) * 20; ticker += 0.06666666666666667; var v4 = ticker * 15; var v1 = 0; while (v1 < pieces.length) { pieces[v1].upd(pieces[v1]); ++v1; } ++curSetTime; }; var v32 = 1; var pieces = []; var v10 = new flash.geom.Matrix(); var drawers1 = []; var drawers2 = []; var rects1 = []; var rects2 = []; var v6; var v3; var v5; v6 = 0; while (v6 < 16) { v3 = RR(0.05, 0.1); v5 = new flash.display.BitmapData(Math.floor(72 * v3), Math.floor(72 * v3), true, 0); pictures.push(v5); rects1.push(new flash.geom.Rectangle(0, 0, Math.floor(72 * v3), Math.floor(72 * v3))); v10.createBox(v3, v3, 0, 0, 0); v5.draw(v13, v10); drawers1.push(v5); ++v6; } v6 = 0; while (v6 < 16) { v3 = RR(0.05, 0.1); v5 = new flash.display.BitmapData(72 * v3, 72 * v3, true, 0); pictures.push(v5); rects2.push(new flash.geom.Rectangle(0, 0, Math.floor(72 * v3), Math.floor(72 * v3))); v10.createBox(v3, v3, 0, 0, 0); v5.draw(v14, v10); drawers2.push(v5); ++v6; } var ptx = new flash.geom.Point(); var curDrawID = 0; MakeWord(v22, v24, v26, v23, -20, 0, 'blob'); MakeWord(v25, v28, v29, v27, 20, 40, 'blob2'); } var v25 = [-35, -35, -35, -35, -35, -35, -35, -34, -34, -35, -34, -35, -35, -34, -34, -34, -34, -34, -31, -31, -34, -34, -34, -30, -35, -31, -30, -30, -31, -30, -30, -31, -29, -29, -29, -28, -30, -30, -26, -27, -29, -28, -26, -25, -26, -25, -25, -22, -27, -22, -22, -25, -22, -21, -22, -21, -21, -21, -26, -20, -20, -20, -21, -21, -21, -19, -19, -20, -18, -18, -17, -18, -17, -16, -19, -16, -16, -17, -16, -16, -15, -15, -15, -15, -12, -12, -12, -20, -12, -17, -12, -11, -16, -11, -11, -11, -11, -10, -10, -9, -11, -11, -9, -8, -7, -7, -7, -8, -10, -6, -6, -7, -6, -10, -3, -3, -3, -3, -3, -6, -2, -2, -2, -3, -3, -3, -2, -2, -2, -3, -2, -1, -2, 0, -2, 1, 2, 4, -1, 4, 4, 4, 5, 5, 5, 4, 5, 5, 5, 6, 6, 5, 6, 0, 6, 7, 6, 8, 8, 9, 8, 7, 7, 9, 10, 10, 10, 9, 10, 10, 11, 11, 11, 14, 14, 9, 14, 11, 14, 15, 15, 15, 15, 15, 16, 16, 17, 17, 15, 15, 18, 18, 10, 19, 19, 18, 17, 16, 19, 20, 20, 20, 17, 20, 20, 21, 20, 21, 20, 21, 21, 21, 20, 22, 24, 24, 24, 24, 21, 24, 21, 21, 24, 25, 24, 25, 25, 25, 24, 25, 25, 25, 27, 26, 24, 29, 29, 29, 29, 29, 29, 29, 29, 30, 29, 25, 30, 30, 30, 30, 30, 30, 31, 30, 33, 34, 34, 25, 28, 34, 34, 34, 34, 34, 35, 35, 35, 35, 34, 35, 35, 34, 35, 35, 32]; var v27 = [-2, -1, 0, -3, -6, 1, 4, -6, -5, 3, -2, -5, 5, 1, -1, 0, 2, 5, -1, 0, 3, 4, -3, -2, 2, 3, 0, 1, 1, 3, 4, 2, -2, -3, 4, -3, 2, -1, -3, -3, 5, 5, 5, -1, -2, -2, 4, 0, 5, 1, 3, 3, -1, 0, 2, -1, 2, 4, 4, -2, -3, 4, 1, 3, -2, 1, 5, 5, -3, 1, -2, 5, -3, -2, -3, -1, 0, 1, 1, 5, -1, 0, 1, 4, -1, 0, 2, 1, 3, 5, 1, 0, 4, 3, -1, 4, 1, -3, 5, -3, -2, 2, 5, 5, -2, 4, 5, -3, -2, 3, -1, -3, 4, 4, -2, 0, -1, -3, 4, -2, -3, -2, -1, 2, 1, 5, 3, 2, 0, 3, 4, -2, 1, -3, 5, -3, -3, 1, -1, 3, -1, 0, -2, 0, 2, 2, 1, -1, 4, 1, -2, 3, 5, -2, -3, 5, 4, -3, 1, -2, 5, 1, -3, 1, -1, -2, 0, 5, 1, 4, -1, 0, 1, 2, 3, -3, 4, 4, -2, 2, -2, 3, 5, 4, -3, 5, -3, 0, 1, -3, -3, 0, 5, -3, 0, 5, 5, 1, 5, 0, -1, -3, 1, 2, 4, -1, 1, 0, 3, 1, 4, 3, -2, 5, -2, -3, -1, 1, 5, 3, -2, 2, 5, -3, 2, -2, 1, 0, 4, 3, -1, 4, -3, -2, 0, -2, -3, -1, 0, 2, 3, 1, 4, -2, 5, 2, 1, -1, 0, 2, 4, 3, -2, 5, -3, -2, -3, 5, -3, -1, 0, 3, 4, 5, -1, -2, 0, 1, 2, 4, 5, 1, 2, 3, -3]; var v28 = [-37, -37, -37, -37, -37, -37, -37, -37, -37, -36, -37, -36, -36, -37, -36, -36, -36, -37, -36, -36, -36, -36, -35, -34, -36, -34, -32, -33, -32, -32, -36, -31, -31, -31, -33, -31, -32, -30, -31, -35, -30, -30, -31, -27, -30, -27, -27, -27, -27, -27, -30, -26, -27, -26, -31, -26, -26, -26, -26, -26, -25, -26, -24, -27, -26, -27, -23, -20, -24, -20, -20, -20, -19, -25, -19, -22, -19, -19, -19, -20, -18, -18, -18, -19, -17, -18, -19, -18, -16, -16, -17, -15, -15, -14, -15, -17, -14, -15, -14, -16, -14, -13, -14, -10, -10, -14, -10, -10, -13, -9, -9, -9, -9, -13, -9, -13, -9, -8, -8, -7, -7, -7, -7, -6, -5, -9, -5, -4, -4, -5, -6, -8, -4, -4, -4, -3, -6, -4, -3, -4, -3, -3, -3, -3, -2, 0, -3, 0, 0, -3, 0, 0, 0, 0, 0, 0, -4, 0, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 0, 2, 2, 3, 1, 3, 4, 4, 1, 4, 5, 4, 1, 5, 5, 3, 6, 6, 6, 8, 7, 9, 10, 10, 3, 10, 10, 10, 5, 10, 10, 10, 11, 11, 11, 10, 10, 11, 11, 10, 11, 11, 11, 12, 11, 13, 13, 11, 11, 11, 15, 15, 16, 16, 16, 15, 16, 16, 16, 16, 12, 17, 18, 17, 18, 18, 17, 19, 19, 15, 20, 20, 20, 21, 21, 21, 18, 21, 21, 21, 22, 22, 22, 21, 22, 22, 22, 21, 25, 22, 25, 22, 26, 19, 26, 26, 26, 26, 26, 23, 27, 25, 27, 28, 26, 28, 29, 28, 29, 25, 29, 27, 27, 30, 30, 30, 30, 30, 31, 30, 31, 31, 33, 34, 35, 31, 35, 35, 35, 29, 35, 35, 35, 30, 36, 35, 35, 36, 35, 35, 36, 36, 36, 36, 36, 36, 36, 37, 36, 38, 36, 38, 36, 37]; var v31 = [-4, -3, 1, -5, 0, 4, 3, 6, 5, -5, 2, -4, -1, -1, 0, 1, -2, -2, 3, 4, 6, 5, 5, 6, 2, -2, -2, -2, 5, -1, -3, 0, 1, 2, 6, 3, 6, 0, 4, -1, 3, 2, -1, -1, 1, 0, 1, 3, -2, 4, 4, -2, 6, 0, 5, 2, 1, -1, 4, 3, -1, 6, -2, 2, 5, 5, -2, 1, -1, 0, 3, 4, 0, 0, 1, -2, -1, 5, 3, 2, -2, 5, -1, 2, 2, 2, 4, 6, 6, 2, 6, 2, -2, -1, 6, -2, 0, -1, 5, -2, 1, 1, 2, -1, 3, 6, 5, 4, 5, -1, 3, 2, 5, 2, 6, 0, -2, 6, 2, 1, 6, 2, -2, -2, -2, 4, 1, -2, -1, 6, 6, -2, 1, 3, 2, -1, 1, 0, 0, 5, 3, 5, 1, 2, 6, -4, 4, -2, -3, 6, -1, 2, 3, 4, -5, 6, 4, 5, -3, -4, 1, 0, -5, -1, 2, 4, -2, 3, 0, 2, 1, 1, 1, 0, -1, 0, 6, 4, -2, 3, 5, 4, 5, 2, 6, -2, 5, -2, 6, -2, -4, -2, 3, 1, 2, 3, -1, 4, 6, 0, -5, -3, -2, 5, -3, -1, 2, -1, 4, 3, 1, -5, 5, -5, -2, 6, 0, -4, 3, 4, -2, -1, 3, 5, 4, 5, 6, 2, -2, -2, -2, 6, 6, 1, 2, 1, 6, -1, -2, 1, 6, -2, 0, 1, 2, 2, 3, 4, 0, -1, 1, 5, 2, 4, 3, -1, -1, 6, 0, 5, -2, -2, -1, 1, 2, 0, 6, 6, -2, 5, 6, -2, 5, 6, -2, 2, 3, 1, 6, 1, 2, -2, -1, 5, 4, 2, -1, 3, 5, 3, -2, -2, -5, 4, -4, -1, 0, 2, 2, -3, 3, 6, -5, -2, 1, -2, 5, 4, 0, 2, 1, 3, 4, 5, -4, 6, -1, -2, 6, 6, -3, -2]; var ticker; var ticker2; var baseCenterX = 320; var baseCenterY = 200; var centerx = 320; var centery = 320; var titleActors; var selector; var soundStarted; var v41 = 10; var thesound; _root._quality = 'HIGH'; var fade = _root.attachMovie('fade', '__tyewtrywr', 123456, {'_alpha': 0}); thesound = _root.attachMovie('empty', 'thesound', 9000, {}); thesound.snd = new Sound(thesound); var clearer; var MakeSelector = function () { selector = _root.attachMovie('blob2', 'curx', 3, {}); selector._x = 320; selector._y = 240; selector._visible = false; ticker2 = 0; soundStarted = 0; var mouseState = false; var mouseinput = {'onMouseDown': function () { mouseState = true; }, 'onMouseUp': function () { mouseState = false; }}; Mouse.addListener(mouseinput); selector.onEnterFrame = function () { ++ticker2; if (ticker2 > 22.5 && soundStarted == 0) { soundStarted = 1; snd('cue2.mp3'); } if (mouseState || ticker > 12 || Key.isDown(32)) { Mouse.removeListener(mouseinput); thesound.snd.stop(); thesound.removeMovieClip(); fade.tick = 0; fade.onEnterFrame = function () { ++fade.tick; fade._alpha = fade._alpha * 0.7 + 31.5; if (fade.tick == 10) { clearer(); fade.onEnterFrame = function () { this._alpha *= 0.9; if (this._alpha < 0.03) { this.removeMovieClip(); } }; run.titlefunc(); } }; selector.removeMovieClip(); delete _root.intro; _root.intro = null; } }; }; var v22 = function (xpos, ypos, dotScale) { ticker = 0; centerx = xpos; centery = ypos; baseCenterX = xpos; baseCenterY = ypos; titleActors = new Array(); var v2 = _root.attachMovie('blob3', 'curz', 2, {}); v2._xscale = 0; v2._yscale = 0; titleActors.push(v2); v2.onEnterFrame = function () { centerx = baseCenterX + Math.cos(ticker * 0.23) * 20; centery = baseCenterY + Math.cos(ticker * 0.17) * 20; ticker += 0.06666666666666667; }; runTitle(); MakeSelector(); }; v22(320, 200, 5); }; v1.titlefunc = function () { function add(src, hover, fn) { src.push = fn; buttons.push(src); src.hover = hover; src.th = src.textHeight; src.tw = src.textWidth; } function add2(src, hover, th, tw, fn) { src.push = fn; buttons.push(src); src.hover = hover; src.th = th; src.tw = tw; } function snd(nm) { if (run.fullvol == 0) { return undefined; } var v1 = thesound.snd; v1.attachSound(nm); v1.start(0, 1); } function mus(nm) { var v1 = themusic.snd; v1.attachSound(nm); v1.start(0, 1000000); } var v6 = _root.attachMovie('hudvol', 'hhh', 90000, {'vol': 1, '_x': 10, '_y': 440, '_xscale': 50, '_yscale': 50, 'onEnterFrame': function () { this._x = 5 + -_root._x; this._y = 460 + -_root._y; }, 'onPress': function () { if (this.vol != 1) { this.vol = 1; this.gotoAndStop(2); } else { this.gotoAndStop(1); this.vol = 0; } run.fullvol = this.vol; run.onVolChange(); }}); v6.gotoAndStop(2); var v11 = _root.attachMovie('click4', 'hhh', 90001, {'vol': 1, '_x': 30, '_y': 460, '_xscale': 50, '_yscale': 50, 'qual': true, '_alpha': 30, 'thetext': 'HIGH QUALITY', 'onEnterFrame': function () { this._x = 34 + -_root._x; this._y = 457 + -_root._y; }, 'onPress': function () { if (this.qual != 1) { this.qual = 1; this.thetext = 'HIGH QUALITY'; run.qualsetting = 1; _root._quality = 'HIGH'; } else { this.gotoAndStop(1); this.qual = 0; this.thetext = 'LOW QUALITY'; _root._quality = 'LOW'; run.qualsetting = 0; } run.fullvol = this.vol; }}); run.addMouse(); run.trykongupdate(); run.allLoaded = false; var fade2time = -1; var fade1time = -1; if (run.allLoaded == false) { if (_root.getBytesLoaded() == _root.getBytesTotal()) { run.allLoaded = true; gotoAndStop(9); } } var allStuff = _root.attachMovie('empty', 'eeee', 1, {'mousedown': false, 'onEnterFrame': function () { if (run.allLoaded == false) { if (_root.getBytesLoaded() == _root.getBytesTotal()) { run.allLoaded = true; gotoAndStop(9); } } if (fade2time > -1) { --fade2time; if (fade2time == 0) { title.reallyreset._x = 183; } } if (fade1time > -1) { --fade1time; if (fade1time == 0) { title.reset._x = 183.3; } } title.soci.text = ''; var v4 = 0; while (v4 < buttons.length) { var v3 = buttons[v4]; if (_xmouse > v3._x && _xmouse < v3._x + v3.tw && _ymouse > v3._y && _ymouse < v3._y + v3.th && v3.hover != undefined) { title.soci.text = v3.hover; } ++v4; } if (this.mousedown == false && run.mouseState) { this.mousedown = true; v4 = 0; while (v4 < buttons.length) { v3 = buttons[v4]; if (_xmouse > v3._x && _xmouse < v3._x + v3.tw && _ymouse > v3._y && _ymouse < v3._y + v3.th) { v3.push(); } ++v4; } } if (run.mouseState == false) { this.mousedown = false; } }}); var title = allStuff.attachMovie('title', 'ttt', 1, {}); title.soci.text = ''; _root._quality = 'HIGH'; var buttons = []; add(title.goplay, 'LET THE WORLD SEE THE NEW SOCIALIST MAN RUN!', function () { themusic.snd.stop(); thesound.snd.stop(); allStuff.removeMovieClip(); run.dobuying(); }); add(title.reset, 'LET THE WORLD SEE THE NEW SOCIALIST MAN BEGIN ANEW!', function () { title.reset._x = -380; fade2time = 15; }); add(title.reallyreset, 'THIS WILL CLEAR ALL OF YOUR GLORIOUS PROGRESS, YOU KNOW!', function () { fade1time = 15; title.reallyreset._x = 900; run.initPowers(); snd('letsgo.mp3'); run.saveGame.flush(); }); add(title.playmore, 'LET THE WORLD SEE SOME OTHER GAMES!', function () { getURL('http://www.icecreambreakfast.com', '_blank'); }); add(title.icb, 'GAMES ARE TOOLS TO DISTRACT WORKERS FROM THEIR CONDITION', function () { getURL('http://www.icecreambreakfast.com', '_blank'); }); var thesound = allStuff.attachMovie('empty', 'thesound', 9000, {}); thesound.snd = new Sound(thesound); var themusic = allStuff.attachMovie('empty', 'thesound2', 9001, {}); themusic.snd = new Sound(themusic); themusic.snd.setVolume(100 * run.fullvol); run.onVolChange = function () { themusic.snd.setVolume(run.fullvol * 100); }; mus('menu3.mp3'); }; v1.doend = function () {}; v1.initPowers = function () { run.powers = {'jogging': 0, 'running': 0, 'sprinting': 0, 'kicking': 0, 'taunting': 0, 'biting': 0, 'shivving': 0, 'gesturing': 0, 'donating': 0, 'corruption': 0, 'scolding': 0, 'underground': 0, 'badshoes': 0, 'bandana': 0, 'umbrella': 0, 'waterbottle': 0, 'importedshoes': 0, 'orphans': 0, 'papers': 0, 'steroids': 0, 'barbedknife': 0, 'ironstar': 0, 'bronzestar': 0, 'goldstar': 0, 'commissar': 0, 'dealer': 0, 'champion': 0, 'racenum': 0, 'choco': 0, 'booze': 0, 'smokes': 0, 'firearms': 0, 'firstRace': 2, 'race1': 0, 'race2': 0, 'race3': 0, 'race4': 0, 'didupgrade': 0, 'doneEnding': false, 'introinfo': false, 'introinfo2': false, 'introinfo3': false, 'introinfo4': false, 'saluteinfo': false, 'donateinfo': false, 'kickinfo': false, 'tauntinfo': false, 'distractinfo': false, 'scoldinfo': false, 'biteinfo': false, 'shivinfo': false, 'sellinfo': false, 'shopintro': false, 'upgradeintro': false, 'race2intro': false, 'race3intro': false, 'race4intro': false, 'upgrade2intro': false, 'upgrade3intro': false, 'upgrade4intro': false, 'money': 50, 'buyID': 0}; }; v1.stamfn = function (val) { return 12 + run.stams[val]; }; v1.runfn = function (val) { return 1 + run.runs[val]; }; v1.sprintfn = function (val) { return 1.8 + run.sprints[val]; }; v1.doending = function () { function snd(nm) { if (run.fullvol == 0) { return undefined; } var v1 = thesound.snd; v1.attachSound(nm); v1.start(0, 1); } function mus(nm) { var v1 = themusic.snd; v1.attachSound(nm); v1.start(0, 1000000); } run.trykongupdate(); _root.attachMovie('fadeout', 'fd', 1000001, {'_alpha': 100, 'onEnterFrame': function () { this._alpha = this._alpha * 0.8 + -1; if (this._alpha <= 3) { this.removeMovieClip(); } }}); var fr = 1; var allStuff = _root.attachMovie('empty', 'eeee', 1, {'mousedown': false, 'onEnterFrame': function () { if (this.mousedown == false && run.mouseState) { this.mousedown = true; ++fr; if (fr < 4) { title.gotoAndStop(fr); if (fr == 3) { title.racecount = 'FINISHED IN ' + run.powers.racenum + ' RACES'; } snd('latch.mp3'); } else { if (fr == 4) { _root.attachMovie('fadeout', 'fd', 1000001, {'_alpha': 0, 'onEnterFrame': function () { this._alpha = this._alpha * 0.8 + 21; if (this._alpha >= 100) { this.removeMovieClip(); themusic.snd.stop(); thesound.snd.stop(); allStuff.removeMovieClip(); run.dobuying(); } }}); } } } if (run.mouseState == false) { this.mousedown = false; } }}); var title = allStuff.attachMovie('ending', 'ttt', 1, {}); title.gotoAndStop(1); var thesound = allStuff.attachMovie('empty', 'thesound', 9000, {}); thesound.snd = new Sound(thesound); var themusic = allStuff.attachMovie('empty', 'thesound2', 9001, {}); themusic.snd = new Sound(themusic); themusic.snd.setVolume(100 * run.fullvol); run.onVolChange = function () { themusic.snd.setVolume(run.fullvol * 100); }; mus('menu3.mp3'); _root.kongregateStats.submit('doneending', 1); run.powers.doneEnding = true; }; } else { goto 75226; } storedv1.dobuying = function () { function add(src, sx, sy, hover, fn) { src.sx = sx; src.sy = sy; src.push = fn; buttons.push(src); src.hover = hover; } function clearall() { therainsound.snd.stop(); thesound.snd.stop(); themusic.snd.stop(); hudd.removeMovieClip(); allStuff.removeMovieClip(); } function doOut(id) { clearing = true; --run.powers.firstRace; _root.attachMovie('fadeout', 'fa', 100000, {'_alpha': 0, 'id': id, 'tick': 0, 'onEnterFrame': function () { if (this.tick == 2) { snd('letsgo.mp3'); } this._alpha += 6; var v2 = 100 - 3 * this._alpha; if (v2 < 0) { v2 = 0; } themusic.snd.setVolume(v2); this.tick += 2; if (this.tick > 100) { clearall(); run.dorun(this.id); this.removeMovieClip(); } }}); } function recalcAll() { var v1 = 0; while (v1 < allbut.length) { allbut[v1].recalc(allbut[v1]); ++v1; } douns(); run.saveGame.data.powers = run.powers; run.saveGame.flush(); } function tryread(fr, test, testfn) { if (doneReading == false) { return undefined; } if (run.powers[test] == false && testfn()) { doneReading = false; run.powers[test] = true; var v3 = _root.attachMovie('readback', 'eeeerb', 100000, {'onEnterFrame': function () { if (readClick) { readClick = false; doneReading = true; this.removeMovieClip(); } }}); v3.gotoAndStop(fr); } } function but(testval, basex, basey, entry, cost, hint, unlocked) { thisbut = sb.attachMovie('boxes', 'bbbew3' + curlay, curlay, {'cost': cost[entry + 1], '_x': basex + 30 * entry, '_y': basey - 6}); add(thisbut, 22, 22, hint, function (self) { self.gotoAndStop(3); run.powers[testval] = entry + 1; run.powers.money -= self.cost; sb.money1.text = run.powers.money; snd('money1.mp3'); sb.money2.text = run.powers.money; self.cost = -1; recalcAll(); }); thisbut.cost = 0; var v2 = run.powers[testval]; while (v2 <= entry) { thisbut.cost += cost[v2 + 1]; ++v2; } ++curlay; thisbut.gotoAndStop(2); if (unlocked > buyID) { thisbut.push = function () { snd('bump.mp3'); }; } else { if (run.powers[testval] > entry) { thisbut.gotoAndStop(3); thisbut.cost = -1; thisbut.push = function () { snd('bump.mp3'); }; } else { if (run.powers.money < thisbut.cost) { thisbut.gotoAndStop(4); thisbut.cost = 0; v2 = run.powers[testval]; while (v2 <= entry) { thisbut.cost += cost[v2 + 1]; ++v2; } thisbut.push = function () { snd('bump.mp3'); }; } } } thisbut.recalc = function (self) { if (unlocked > buyID) { self.push = function () { snd('bump.mp3'); }; } else { if (run.powers[testval] > entry) { self.gotoAndStop(3); self.cost = -1; self.push = function () { snd('bump.mp3'); }; } else { if (run.powers.money < self.cost) { self.gotoAndStop(4); self.cost = 0; var v1 = run.powers[testval]; while (v1 <= entry) { self.cost += cost[v1 + 1]; ++v1; } self.push = function () { snd('bump.mp3'); }; } else { self.cost = 0; var v1 = run.powers[testval]; while (v1 <= entry) { self.cost += cost[v1 + 1]; ++v1; } self.gotoAndStop(2); self.push = function (self) { self.gotoAndStop(3); run.powers[testval] = entry + 1; snd('money1.mp3'); run.powers.money -= self.cost; sb.money1.text = run.powers.money; sb.money2.text = run.powers.money; self.cost = -1; recalcAll(); }; } } } }; if (unlocked > buyID) { thisbut.cost = -1; thisbut.gotoAndStop(1); this.push = function () {}; thisbut.hover = 'SIGN ON THE DOTTED LINE, HELP ME UPGRADE MY SHOP, AND ACCESS TO THIS WILL BE YOURS, GOOD COMRADE!'; } allbut.push(thisbut); } function infobut(basex, basey, hint, unlocked) { thisbut = sb.attachMovie('empty', 'bbbew3' + curlay, curlay, {'cost': -1, '_x': basex, '_y': basey}); add(thisbut, 80, 20, hint, function (self) { snd('bump.mp3'); }); ++curlay; if (unlocked > buyID) { thisbut.hover = 'SIGN ON THE DOTTED LINE, HELP ME UPGRADE MY SHOP, AND ACCESS TO THIS WILL BE YOURS, GOOD COMRADE!'; } allbut.push(thisbut); } function sellbut(basex, basey, entry, hint) { var bits = ['', 'choco', 'booze', 'smokes', 'firearms']; var bits2 = ['', 'numchoco', 'numbooze', 'numsmokes', 'numguns']; var vals = [0, -40, -100, -250, -500]; thisbut = sb.attachMovie('boxes', 'bbbew3' + curlay, curlay, {'cost': -1, '_x': basex, '_y': basey - 6}); add(thisbut, 22, 22, hint, function (self) { if (self.cost == -1) { snd('bump.mp3'); return undefined; } snd('money1.mp3'); run.powers.money -= self.cost; sb.money1.text = run.powers.money; sb.money2.text = run.powers.money; run.powers[bits[entry]] = 0; sb[bits2[entry]].text = '0'; self.cost = -1; recalcAll(); }); thisbut.cost = Math.floor(run.powers[bits[entry]] * vals[entry] * (run.powers.dealer ? 1.5 : 1)); if (thisbut.cost == 0) { thisbut.cost = -1; } ++curlay; thisbut.gotoAndStop(5); thisbut.recalc = function (self) { if (run.powers.underground < entry) { self.gotoAndStop(5); self.filters = [new flash.filters.BlurFilter(5, 5, 3)]; self.cost = -1; self.push = function () { snd('bump.mp3'); }; } else { self.cost = Math.floor(run.powers[bits[entry]] * vals[entry] * (run.powers.dealer ? 1.5 : 1)); if (self.cost == 0) { self.cost = -1; } self.gotoAndStop(5); self.filters = []; self.hover = hint; self.push = function (self) { if (self.cost == -1) { return undefined; } run.powers.money -= self.cost; snd('money1.mp3'); sb.money1.text = run.powers.money; sb.money2.text = run.powers.money; run.powers[bits[entry]] = 0; sb[bits2[entry]].text = '0'; self.cost = -1; recalcAll(); }; } }; if (run.powers.underground < entry) { thisbut.cost = -1; thisbut.gotoAndStop(5); thisbut.filters = [new flash.filters.BlurFilter(5, 5, 3)]; this.push = function () { snd('bump.mp3'); }; thisbut.hover = 'ALTHOUGH WE LIVE IN A SOCIALIST UTOPIA, OCCASIONALLY PEOPLE ARE INTERESTED IN TRIFLES THAT ARE HARD TO GET. JUST A THOUGHT.'; } allbut.push(thisbut); } function setit(nm, lv) { if (buyID < lv) { sb[nm].filters = [new flash.filters.BlurFilter(5, 5, 3)]; } } function setun(nm, lv) { var v1 = function () { if (run.powers.underground <= lv) { sb[nm].filters = [new flash.filters.BlurFilter(5, 5, 3)]; } else { sb[nm].filters = []; } }; uns.push(v1); } function douns() { var v1 = 0; while (v1 < uns.length) { uns[v1](); ++v1; } } function makeBacks() { light = allStuff.attachMovie('light', 'light', 20000, {'blendMode': 13, 'ticker': 0, 'onEnterFrame': function () { ++this.ticker; this._alpha = 20 + 10 * Math.cos(0.027 * this.ticker); this._x = 30 * Math.cos(0.047 * this.ticker); this._y = 30 * Math.cos(0.037 * this.ticker); if (isOvercast) { this._alpha = 0; } if (isRainy) { this._x = Math.random() * 60 - 60; this._y = Math.random() * 60 - 60; this._alpha = 20; } }}); light2 = allStuff.attachMovie('light', 'light2', 20001, {'blendMode': 13, 'ticker': 0, 'onEnterFrame': function () { ++this.ticker; this._alpha = 20 + 10 * Math.cos(0.037 * this.ticker); this._x = 35 * Math.cos(0.033 * this.ticker); this._y = 35 * Math.cos(0.027 * this.ticker); if (isOvercast) { this._alpha = 0; } if (isRainy) { this._x = Math.random() * 60 - 60; this._y = Math.random() * 60 - 60; this._alpha = 20; } }}); flasher = allStuff.attachMovie('flat', 'flasher', 30001, {'_visible': false, 'fade': 0.9, 'onEnterFrame': function () { if (this._visible == true) { this._alpha *= this.fade; if (this._alpha < 3) { this._visible = false; } } }}); backs = allStuff.attachMovie(run.allLoaded ? 'shops' : 'shopsearly', 'back', 1, {'_x': -5, '_y': -5}); backs.gotoAndStop(screenfr); } function rainnoise(nm) { var v1 = therainsound.snd; v1.attachSound(nm); v1.start(0, 1000000); } function interpolateArrays(ary1, ary2, t) { var v3 = ary1.length >= ary2.length ? ary1.slice() : ary2.slice(); var v1 = v3.length; while (v1--) { v3[v1] = ary1[v1] + (ary2[v1] - ary1[v1]) * t; } return v3; } function dodesat(darken) { var v5 = new flash.filters.ColorMatrixFilter(); var v8 = [1 * darken, 0, 0, 0, 0]; var v9 = [0, 1 * darken, 0, 0, 0]; var v7 = [0, 0, 1 * darken, 0, 0]; var v6 = [0, 0, 0, 1, 0]; var v3 = [0.3 * darken, 0.59 * darken, 0.11 * darken, 0, 0]; var v4 = 0.15; var v1 = []; v1 = v1.concat(interpolateArrays(v3, v8, v4)); v1 = v1.concat(interpolateArrays(v3, v9, v4)); v1 = v1.concat(interpolateArrays(v3, v7, v4)); v1 = v1.concat(v6); v5.matrix = v1; return v5; } function makeSunny() { alpha1 = 35; alpha2 = 25; flasher.filters = run.c3(1, 1, 0.8); flasher.blendMode = 1; flasher._visible = true; flasher._alpha = 100; isOvercast = false; isRainy = false; light.gotoAndStop(1); light2.gotoAndStop(1); backs.filters = [new flash.filters.BlurFilter(4, 4, 3)]; light.blendMode = 13; light2.blendMode = 13; } function makeHeatwave() { alpha1 = 20; alpha2 = 10; flasher.filters = run.c3(1, 1, 0.8); flasher.blendMode = 8; flasher._visible = true; flasher._alpha = 100; isOvercast = false; isRainy = false; light.gotoAndStop(1); light2.gotoAndStop(1); backs.filters = [new flash.filters.BlurFilter(4, 4, 3)]; light.blendMode = 8; light2.blendMode = 8; } function makeOvercast() { alpha1 = 35; alpha2 = 25; flasher.filters = run.c3(0.7, 0.7, 0.7); flasher.blendMode = 1; flasher._visible = true; flasher._alpha = 100; isOvercast = true; isRainy = false; light.gotoAndStop(1); light2.gotoAndStop(1); backs.filters = [dodesat(1), new flash.filters.BlurFilter(4, 4, 3)]; light.blendMode = 13; light2.blendMode = 13; } function makeRainy() { alpha1 = 35; alpha2 = 25; flasher.filters = run.c3(0.4, 0.4, 0.4); flasher.blendMode = 1; flasher._visible = true; flasher._alpha = 100; isOvercast = false; isRainy = true; light.gotoAndStop(2); light2.gotoAndStop(2); backs.filters = [dodesat(0.5), new flash.filters.BlurFilter(4, 4, 3)]; light.blendMode = 1; light2.blendMode = 1; } function makeFoggy() { alpha1 = 35; alpha2 = 25; flasher.filters = run.c3(1, 1, 1); flasher.blendMode = 1; flasher._visible = true; flasher._alpha = 100; isOvercast = false; isRainy = false; light.gotoAndStop(3); light2.gotoAndStop(3); backs.filters = [dodesat(1.5), new flash.filters.BlurFilter(4, 4, 3)]; light.blendMode = 1; light2.blendMode = 1; } function snd(nm) { if (run.fullvol == 0) { return undefined; } var v1 = thesound.snd; v1.attachSound(nm); v1.start(0, 1); } function mus(nm) { var v1 = themusic.snd; v1.attachSound(nm); v1.start(0, 1000000); } run.trykongupdate(); _root.attachMovie('fadeout', 'fd', 1000001, {'_alpha': 100, 'onEnterFrame': function () { this._alpha = this._alpha * 0.8 + -1; if (this._alpha <= 3) { this.removeMovieClip(); } }}); var buyID = run.powers.buyID; var v15; var v16; var screenfr; if (buyID == 0) { v15 = 1; v16 = 1; screenfr = 1; } if (buyID == 1) { v15 = 1; v16 = 1; screenfr = 2; } if (buyID == 2) { v15 = 2; v16 = 2; screenfr = 3; } if (buyID == 3) { v15 = 3; v16 = 3; screenfr = 4; } var tick2 = 0; var allStuff = _root.attachMovie('empty', 'eeee', 1, {'onEnterFrame': function () { ++tick2; this._x = Math.cos(tick2 * 0.02) * 2 + Math.cos(tick2 * 0.027) * 3 + Math.cos(tick2 * 0.031) * 2.3; this._y = Math.cos(tick2 * 0.017) * 2.4 + Math.cos(tick2 * 0.022) * 1.5 + Math.cos(tick2 * 0.025) * 2.7; }}); var buttons = []; var v36; var hudd = _root.attachMovie('empty', 'eeexe2', 200, {'mousedown': true, 'onEnterFrame': function () { if (run.allLoaded == false) { if (_root.getBytesLoaded() == _root.getBytesTotal()) { run.allLoaded = true; gotoAndStop(9); } } sb.greet = greetmsg; sb.hint = hintmsg; sb.cost1.text = ''; sb.numcost1.text = ''; sb.cost2.text = ''; sb.numcost2.text = ''; if (doneReading == true) { var v4 = 0; while (v4 < buttons.length) { var v3 = buttons[v4]; if (_xmouse > sb._x + v3._x && _xmouse < sb._x + v3._x + v3.sx && _ymouse > sb._y + v3._y && _ymouse < sb._y + v3._y + v3.sy && v3.hover != undefined) { sb.greet = v3.hover; sb.hint = v3.hover; if (v3.cost != -1) { if (v3.cost >= 0) { sb.cost1.text = 'COST'; sb.cost2.text = 'COST'; sb.numcost1.text = v3.cost; sb.numcost2.text = v3.cost; } else { sb.cost1.text = 'EARN'; sb.cost2.text = 'EARN'; sb.numcost1.text = -1 * v3.cost; sb.numcost2.text = -1 * v3.cost; } } } ++v4; } } if (this.mousedown == false && run.mouseState) { this.mousedown = true; readClick = true; if (doneReading == true) { v4 = 0; while (v4 < buttons.length) { v3 = buttons[v4]; if (_xmouse > sb._x + v3._x && _xmouse < sb._x + v3._x + v3.sx && _ymouse > sb._y + v3._y && _ymouse < sb._y + v3._y + v3.sy) { v3.push(v3); } ++v4; } } } if (run.mouseState == false) { this.mousedown = false; } }}); var v27 = allStuff.attachMovie('man1', 'mmm1', 800, {'_x': 160, '_y': 570}); v27.gotoAndStop(v15); if (buyID != 0) { var v26 = allStuff.attachMovie('man2', 'mmm2', 801, {'_x': 460, '_y': 570}); v26.gotoAndStop(v16); } var sb = hudd.attachMovie(run.allLoaded ? 'shopbuy' : 'shopbuyearly', 'sb', 1, {'goalx': 0, '_x': 0, '_y': 0, 'tick': 0, 'onEnterFrame': function () { ++this.tick; this._x = this._x * 0.8 + 0.2 * this.goalx; }}); sb.gotoAndStop(buyID + 1); var curlay = 30; var thisbut; var clearing = false; var v13 = 0; if (run.powers.race1) { v13 = 1; } if (run.powers.race2) { v13 = 2; } if (run.powers.race3) { v13 = 3; } thisbut = sb.attachMovie('click3', 'bbb', 21, {'_x': sb.lev1._x, '_y': sb.lev1._y, 'cost': -1, 'thetext': 'RUN IN A\nHUMBLE\nRACE!'}); add(thisbut, 80, 70, 'COMPETE IN A SMALL, FRIENDLY RACE AGAINST 3 BELOVED COMRADES! JUST A SIMPLE RACE. NO ONE HAS ANY TRAINING. THE WEATHER SHOULD BE PLEASANT, COMRADE. FOR THE MOTHERLAND!', function () { if (clearing) { return undefined; } doOut(1); }); thisbut = sb.attachMovie('click3', 'bbbx', 22, {'_x': sb.lev2._x, '_y': sb.lev2._y, 'cost': -1, 'filters': run.powers.race1 < 1 ? [new flash.filters.BlurFilter(4, 4, 3)] : [], 'thetext': 'RUN IN A\nDUTIFUL\nRACE!'}); add(thisbut, 80, 70, run.powers.race1 < 1 ? 'WIN A HUMBLE RACE TO UNLOCK THIS CHALLENGE' : 'COMPETE IN A AMATEUR RACE WITH 5 DEAR COMRADES! YOUR FELLOW WORKERS WILL BE SOMEWHAT FASTER. LOOK OUT FOR RAINY PATCHES, AND BRING HONOR TO THE MOTHERLAND! THE VIOLENT OVERTHROW OF CAPITALISM DEPENDS ON GOOD FOOTRACES FROM PATRIOTS LIKE YOU!', function () { if (clearing) { return undefined; } if (run.powers.race1 > 0) { doOut(2); } }); thisbut = sb.attachMovie('click3', 'bbab', 23, {'_x': sb.lev3._x, '_y': sb.lev3._y, 'cost': -1, 'filters': run.powers.race2 < 1 ? [new flash.filters.BlurFilter(4 + (2 - v13), 4 + (2 - v13), 3)] : [], 'thetext': 'RUN IN A\nPATRIOTIC\nRACE!'}); add(thisbut, 80, 70, run.powers.race2 < 1 ? 'WIN A DUTIFUL RACE TO UNLOCK THIS CHALLENGE' : 'COMPETE IN A HIGH LEVEL RACE. THE LEGEND OF THE FLEET-FOOTED COMRADE IS GROWING! THE PARTY IS PLEASED TO ALLOW YOU AND 7 WELL-TRAINED COMRADES TO RUN AS EXAMPLES OF OUR SHINING FUTURE! WATCH FOR FOGGY PATCHES, AND BRING US ALL PRIDE!', function () { if (clearing) { return undefined; } if (run.powers.race2 > 0) { doOut(3); } }); thisbut = sb.attachMovie('click3', 'bbbew', 24, {'_x': sb.lev4._x, '_y': sb.lev4._y, 'cost': -1, 'filters': run.powers.race3 < 1 ? [new flash.filters.BlurFilter(4 + (3 - v13), 4 + (3 - v13), 3)] : [], 'thetext': 'RUN IN A\nGLORIOUS\nRACE!'}); add(thisbut, 80, 70, run.powers.race3 < 1 ? 'WIN A PATRIOTIC RACE TO UNLOCK THIS CHALLENGE' : 'COMPETE IN A LEGENDARY RACE. THE EYES AND HEARTS OF THE PEOPLE ARE FIXED ON YOU AND 9 PEERS, DEAR COMRADE! SHOW THE WORLD THE GLORIOUS FUTURE OF RUNNING! YOU ARE THE FEET, LEGS, AND WELL-MUSCLED THIGHS OF THE PARTY!', function () { if (clearing) { return undefined; } if (run.powers.race3 > 0) { doOut(4); } }); var v4; var allbut = []; if (buyID < 3 && run.powers.firstRace != 2) { v4 = [5, 400, 3000]; thisbut = sb.attachMovie('click3', 'bbberew', 28, {'_x': 478, '_y': 296, 'cost': v4[buyID], 'thetext': '', 'tick': 0, 'onEnterFrame': function () { ++this.tick; if (run.powers.money >= this.cost) { sb.upgrade._alpha = 50 + 50 * Math.cos(this.tick * 0.1); } else { sb.upgrade._alpha = 30; } }}); add(thisbut, 119, 53, 'JUST A FEW SCRATCHES OF INK ON THIS PIECE OF PAPER, AND I CAN GET YOU ACCESS TO MANY, MANY THINGS, DEAR COMRADE!', null); thisbut.recalc = function (self) { if (run.powers.money >= self.cost) { self.push = function (self) { run.powers.money -= self.cost; clearall(); run.powers.didupgrade = true; ++run.powers.buyID; run.dobuying(); }; } else { self.push = function () { snd('bump.mp3'); }; } }; thisbut.recalc(thisbut); allbut.push(thisbut); } if (run.powers.firstRace == 2) { sb.upgrade._visible = false; } var readClick = false; var doneReading = true; tryread(11, 'shopintro', function () { return true; }); tryread(12, 'upgradeintro', function () { return run.powers.firstRace < 2; }); tryread(13, 'race2intro', function () { return run.powers.race1 != 0; }); tryread(14, 'race3intro', function () { return run.powers.race2 != 0; }); tryread(15, 'race4intro', function () { return run.powers.race3 != 0; }); tryread(16, 'upgrade2intro', function () { return buyID > 0; }); tryread(17, 'upgrade3intro', function () { return buyID > 1; }); tryread(18, 'upgrade4intro', function () { return buyID > 2; }); thisbut = sb.attachMovie('empty', 'bbbew2', 25, {'_x': sb.arrowright._x, '_y': sb.arrowright._y, 'cost': -1}); add(thisbut, 60, 60, 'CHECK OUT SOME OF MY FINE SOCIALIST KNICK-KNACKS AND TOOLS, DEAR COMRADE, AND SELECT A FINE RACE TO SHOWCASE YOUR SKILLS.', function () { snd('latch.mp3'); sb.goalx = -640; }); thisbut = sb.attachMovie('empty', 'bbbew3', 26, {'_x': sb.arrowleft._x, '_y': sb.arrowleft._y, 'cost': -1}); add(thisbut, 60, 60, 'CARE TO THINK AGAIN ABOUT TRAINING UP SOME OF YOUR SKILLS TO REFLECT THE GLORIOUS SOCIALIST IDEALS? THE PEOPLE AWAIT YOUR TRIUMPHANT RUNNING, MY FRIEND!', function () { snd('latch.mp3'); sb.goalx = 0; }); sb.money1.text = run.powers.money; sb.money2.text = run.powers.money; var v5; var v3 = '<font face=\'Arial\'>%</font>'; var v14 = '<font face=\'Arial\'>/</font>'; v4 = [0, 5, 15, 30, 80, 200, 500, 1000, 2000]; v5 = [0, 0, 1, 1, 2, 2, 3, 3]; var v8 = 0; while (v8 < 8) { but('jogging', 160, 107, v8, v4, 'PRACTICE THIS, DEAR COMRADE, AND YOU WILL REGAIN <font color=\'#800000\'>' + run.stamfn(v8 + 1) + '' + v3 + ' STAMINA</font> WHEN YOU CATCH YOUR BREATH!', v5[v8]); ++v8; } v4 = [0, 10, 20, 40, 100, 220, 600, 1100, 2200]; v5 = [0, 0, 0, 1, 1, 2, 2, 3]; v8 = 0; while (v8 < 8) { but('running', 160, 127, v8, v4, 'TRAIN, TRAIN, TRAIN! YOU WILL RUN LIKE THE COMMUNAL WIND, AT <font color=\'#000080\'>' + Math.floor(100 * run.runfn(v8 + 1)) + '' + v3 + ' SPEED</font>! YOU WILL BE THE NON-ENVY OF ALL YOUR RIGHT-THINKING SOCIALIST PEERS!', v5[v8]); ++v8; } v4 = [0, 5, 25, 50, 120, 240, 700, 1200, 2500]; v5 = [0, 1, 1, 2, 2, 3, 3, 3]; v8 = 0; while (v8 < 8) { but('sprinting', 160, 147, v8, v4, 'BOUND LIKE A COMMUNAL GAZELLE! YOU WILL SPRINT AT <font color=\'#000080\'>' + Math.floor(100 * run.sprintfn(v8 + 1)) + '' + v3 + ' RUNNING SPEED</font> AT A COST OF <font color=\'#800000\'>' + (20 + (v8 + 1) * 2) + '' + v3 + ' STAMINA</font>, AND ALL WILL SHARE IN THE GLORY OF YOUR ACHIEVEMENT!', v5[v8]); ++v8; } var v10 = 0; var v9 = -140; v4 = [0, 15, 75, 155]; v5 = [0, 1, 2]; v8 = 0; while (v8 < 3) { but('gesturing', v10 + 160, 195, v8, v4, 'SNAP TO ATTENTION TO THANK OFFICIALS, AND THEIR VIGOR TO DO THEIR JOB WILL GROW. <font color=\'#400080\'>' + Math.floor((0.4 + (v8 + 1) * 0.1) * 100) + v3 + ' CHANCE</font> THEY <font color=\'#400080\'>DELAY A RANDOM COMPETITOR</font> FOR <font color=\'#400080\'>' + (1 + 2 * (v8 + 1)) + ' SECONDS</font>! YOU WILL USE <font color=\'#800000\'>3' + v3 + ' STAMINA</font>.', v5[v8]); ++v8; } v4 = [0, 30, 225, 325]; v5 = [0, 2, 3]; v8 = 0; while (v8 < 3) { but('donating', v10 + 160, 215, v8, v4, 'PASS ALONG THIS CASH FROM ME TO THE OFFICIALS - THEY MIGHT DECLARE A HOLIDAY! <font color=\'#400080\'>' + Math.floor((0.3 + (v8 + 1) * 0.1) * 100) + v3 + ' CHANCE</font> ALL RUNNERS WILL PAUSE FOR <font color=\'#400080\'>' + (0.5 + (v8 + 1) * 0.5) + ' SECOND' + ((v8 == 0) ? '' : 'S') + '</font>. YOU WILL USE <font color=\'#800000\'>2' + v3 + ' STAMINA</font>.', v5[v8]); ++v8; } if (buyID < 0) { sb.donating.filters = [new flash.filters.BlurFilter(5, 5, 3)]; } v4 = [0, 500, 700, 900]; v5 = [2, 2, 3]; v8 = 0; while (v8 < 3) { but('corruption', v10 + 160, 235, v8, v4, 'OUR POOR PARTY OFFICIALS ARE OVERWORKED. HELPFULLY RECOMMEND OTHER RACES THEY SHOULD GO WATCH. YOU CAN DO THIS EVERY <font color=\'#400080\'>' + (15 - v8 * 3) + ' SECONDS</font>, USING <font color=\'#800000\'>10' + v3 + ' STAMINA</font>.', v5[v8]); ++v8; } if (buyID < 2) { sb.corruption.filters = [new flash.filters.BlurFilter(5, 5, 3)]; } v4 = [0, 1000, 1400, 1900]; v5 = [3, 3, 3]; v8 = 0; while (v8 < 3) { but('scolding', v10 + 160, 255, v8, v4, 'OUR FINE OFFICIALS CAN\'T SEE EVERYTHING. INFORM THE JUDGES ABOUT YOUR LEAD FOES\'S SINS, AND HE WILL BE SCOLDED AND UNMOVING FOR <font color=\'#400080\'>' + (v8 + 1) + ' SECOND' + (v8 > 0 ? 'S' : '') + '</font>! YOU WILL USE <font color=\'#800000\'>10' + v3 + ' STAMINA</font>.', v5[v8]); ++v8; } if (buyID < 3) { sb.scolding.filters = [new flash.filters.BlurFilter(5, 5, 3)]; } v4 = [0, 40, 160, 250]; v5 = [1, 1, 2]; v8 = 0; while (v8 < 3) { but('kicking', v9 + 493, 195, v8, v4, 'GIVE YOUR NEAREST COMPETITOR A FIRM KICK - MAKE SURE THE OFFICIALS AREN\'T WATCHING. THEY WILL STOP RUNNING FOR ' + (3 + (v8 + 1) * 2) + ' SECONDS. YOU WILL USE <font color=\'#800000\'>10' + v3 + ' STAMINA</font>.', v5[v8]); ++v8; } if (buyID == 0) { sb.kicking.filters = [new flash.filters.BlurFilter(5, 5, 3)]; } v4 = [0, 100, 200, 350]; v5 = [1, 1, 2]; v8 = 0; while (v8 < 3) { but('taunting', v9 + 493, 215, v8, v4, 'TAUNT ALL YOUR NEARBY COMPETITORS. ' + Math.floor(100 * (0.3 + 0.2 * (v8 + 1))) + v3 + ' THEY WILL SLOWDOWN FOR 2 SECONDS. YOU WILL USE <font color=\'#800000\'>5' + v3 + ' STAMINA</font>.', v5[v8]); ++v8; } if (buyID == 0) { sb.taunting.filters = [new flash.filters.BlurFilter(5, 5, 3)]; } v4 = [0, 300, 550, 800]; v5 = [2, 2, 3]; v8 = 0; while (v8 < 3) { but('biting', v9 + 493, 235, v8, v4, 'SHOCK YOUR NEAREST COMPETITOR BY BITING THEM - MAKE SURE THE OFFICIALS AREN\'T WATCHING. THEY WILL LIMP FOR ' + (6 + (v8 + 1) * 3) + ' SECONDS. YOU WILL USE <font color=\'#800000\'>10' + v3 + ' STAMINA</font>.', v5[v8]); ++v8; } if (buyID < 2) { sb.biting.filters = [new flash.filters.BlurFilter(5, 5, 3)]; } v4 = [0, 500, 1200, 2500]; v5 = [3, 3, 3]; v8 = 0; while (v8 < 3) { but('shivving', v9 + 493, 255, v8, v4, 'GIVE YOUR NEAREST COMPETITOR A QUICK STAB - MAKE SURE THE OFFICIALS AREN\'T WATCHING. THEY WILL STOP RUNNING FOREVER. ' + (8 - 2 * v8) + ' SECONDS BETWEEN USES. YOU WILL USE <font color=\'#800000\'>15' + v3 + ' STAMINA</font>.', v5[v8]); ++v8; } if (buyID < 3) { sb.shivving.filters = [new flash.filters.BlurFilter(5, 5, 3)]; } v4 = [0, 5, 100, 350, 800]; v5 = [1, 2, 2, 3]; v8 = 0; while (v8 < 4) { but('underground', 235, 314, v8, v4, 'I KNOW A GUY WHO KNOWS A GUY WHO MIGHT NEEDS SOME THINGS. THERE MIGHT BE SOMETHING IN IT FOR YOU, DEAR COMRADE!', v5[v8]); ++v8; } if (buyID < 1) { sb.underground.filters = [new flash.filters.BlurFilter(5, 5, 3)]; } if (buyID < 1) { sb.titles.filters = [new flash.filters.BlurFilter(5, 5, 3)]; sb.medals.filters = [new flash.filters.BlurFilter(5, 5, 3)]; sb.sell.filters = [new flash.filters.BlurFilter(5, 5, 3)]; } var uns = []; setit('item1', 0); but('badshoes', 644, 38, 0, [0, 25], 'GOOD STURDY SOCIALIST SHOES, THEY ARE STANDARD ISSUE FOR ALL ACTIVITIES IN A ROBUST SOCIALIST LIFE. YOUR <font color=\'#000080\'>RUNNING SPEED</font> WILL INCREASE BY <font color=\'#000080\'>5' + v3 + ' </font> ONCE YOU ACQUIRE THESE!', 0); setit('item2', 0); but('bandana', 774, 38, 0, [0, 25], 'A SERVICEABLE BELT THAT WILL KEEP YOUR PANTS SNUG WHILE IN NO WAY MAKING COMRADES UNCOMFORTABLE WITH ANY HINT OF GAUDINESS. IT IS THE SOCIALIST MAN THAT SHOULD GLEAM, NOT HIS CLOTHES, WOULDN\'T YOU AGREE? BEGIN EACH RACE WITH <font color=\'#800000\'>10' + v3 + ' MORE STAMINA.</font>', 0); setit('item3', 1); but('umbrella', 921, 38, 0, [0, 100], 'THE LATEST IN OUR INCREDIBLE SOCIALIST TECHNOLOGICAL ACHIEVEMENTS, THIS UMBRELLA WILL MAKE THE VERY RAIN BEND TO YOUR WILL. YOUR RUNNING SPEED WHEN IT IS RAINING WILL INCREASE TO <font color=\'#000080\'>85' + v3 + ' </font> YOUR NORMAL SPEED!', 1); setit('item7', 1); but('papers', 644, 63, 0, [0, 300], 'WHILE THESE DISCARDED OFFICIAL PAPERS AREN\'T ABOUT YOU, THEY COULD BE... AND PERHAPS EVEN SHOULD BE. LET\'S SAY THEY ARE. CARRY THESE AROUND, AND YOU WILL BE IMMUNE FROM PUNISHMENT FOR ONE INFRACTION.', 1); setit('item5', 2); but('importedshoes', 774, 63, 0, [0, 350], 'MADE WITH OPEN MESH, NO-SEW DESIGN, MEMORY FOAM, AND A CARBON RUBBER HEEL, THESE SHOES DO NOT ACCORD WITH SOCIALIST VALUES. THEY ARE, HOWEVER, FAST, DEAR COMRADE... YOUR <font color=\'#000080\'>RUNNING SPEED</font> WILL INCREASE BY <font color=\'#000080\'>10' + v3 + ' </font>', 2); setit('item6', 2); but('orphans', 921, 63, 0, [0, 1200], 'THOUGH A SOMEWHAT EXPENSIVE ACCESSORY, KEEPING AN ORPHAN AROUND IS A FANTASTIC WAY TO PROVE YOUR PATRIOTISM. MAKES <font color=\'#400080\'>SALUTING 30' + v3 + '</font> MORE LIKELY TO WORK, <font color=\'#400080\'>DONATING 40' + v3 + '</font> MORE LIKELY TO WORK, AND ADDS AN <font color=\'#400080\'>EXTRA SECOND</font> TO THE EFFECT OF <font color=\'#400080\'>DONATING</font>!', 2); setit('item8', 2); but('steroids', 644, 88, 0, [0, 1200], 'THE LATEST IN HORRIBLE CAPITALIST WEIGHT TRAINING TECHNOLOGY. FINE MACHINES BUILT ON THE BACKS OF THE EXPLOITED, LET US USE THEIR CREATIONS AGAINST THEM, DEAR COMRADE! THIS WILL ADD <font color=\'#004080\'>4 SECONDS</font> TO THE EFFECT OF YOUR <font color=\'#004080\'>KICKING</font> AND <font color=\'#004080\'>6 SECONDS</font> FOR <font color=\'#004080\'>BITING</font>!', 2); setit('item4', 3); but('waterbottle', 774, 88, 0, [0, 1500], 'EVEN THE MOST STALWART WORKER WILL WILT UNDER THE PUNISHING SUN OF A HEATWAVE. LUCKILY, OUR BEST SCIENTISTS PROVIDE A SOCIALIST ANSWER FOR THIS: THE WATER BOTTLE! USE THIS, AND YOUR <font color=\'#800000\'>STAMINA</font> LOSS DURING HEATWAVES WILL BE REDUCED BY <font color=\'#800000\'>2' + v14 + '3</font>. ', 3); setit('item9', 3); but('barbedknife', 921, 88, 0, [0, 5600], 'A GREAT MAN WAS SAID TO HAVE SAID, WHAT DOES IT MATTER IF THREE-QUARTERS OF THE WORLD PERISH, AS LONG AS THE REMAINING ONE-QUARTER IS SOMETHING LIKE SOCIALIST? SOBERING BUT TRUE! YOU WILL <font color=\'#004080\'>SHIV FASTER</font> WITH THIS, AND <font color=\'#004080\'>OFFICIALS WON\'T NOTICE HALF THE TIME</font>.', 3); setit('medal1', 1); but('ironstar', 644, 143, 0, [0, 50], 'ONLY AWARDED TO PATRIOTS WHO HAVE LOST LIMBS IN WAR. WEAR IT PROUDLY, DEAR COMRADE! YOU WILL BEGIN EACH RACE WITH <font color=\'#800000\'>10' + v3 + ' MORE STAMINA</font>, AND PENALTIES FOR ACCIDENTALLY GRABBING <font color=\'#008080\'>CONTRABAND</font> WILL BE <font color=\'#008080\'>HALVED</font> IN DURATION.', 1); setit('medal2', 2); but('bronzestar', 644, 168, 0, [0, 400], 'BESTOWED ON NOBLE PATRIOTS WHO HAVE LOST FAMILY IN WAR. IT WILL LOOK STATELY ON YOUR NICE SHORTS. YOU WILL BEGIN EACH RACE WITH <font color=\'#800000\'>20' + v3 + ' MORE STAMINA</font>, AND PENALTIES FOR ACCIDENTALLY <font color=\'#004080\'>KICKING AND BITING</font> WILL BE <font color=\'#004080\'>HALVED</font> IN DURATION.', 2); setit('medal3', 3); but('goldstar', 644, 193, 0, [0, 1600], 'ONLY GIVEN TO TRUE PATRIOTS WHO HAVE DIED IN WAR. IT WILL IMPRESS YOUR COMPETITORS AND FANS. YOU WILL BEGIN EACH RACE WITH <font color=\'#800000\'>20' + v3 + ' MORE STAMINA</font>, AND PENALTIES FOR ACCIDENTALLY <font color=\'#004080\'>STABBING RUNNERS</font> WILL BE <font color=\'#004080\'>HALVED</font> IN DURATION.', 3); setit('title1', 1); but('commissar', 830, 143, 0, [0, 450], 'SOMEONE MUST BE IN CHARGE OF ALLOCATIONS OF GOODS, DEAR COMRADE! WITH THIS TITLE, YOU CAN ENSURE THAT THERE IS <font color=\'#333355\'>30' + v3 + '</font> MORE <font color=\'#333355\'>DRINKS AND FOODS</font> IN EACH RACE. QUASH THE RUMORS OF FAMINES IN THE PROVINCES!', 1); setit('title2', 2); but('dealer', 830, 168, 0, [0, 350], 'IF AN UPSTANDING SOCIALIST FINDS HIMSELF IN THE UNDESIRABLE BUT SOMETIMES UNAVOIDABLE POSITION OF DOING SOME SELLING, HE STILL DESERVES THE BEST DEAL POSSIBLE, YES? THIS WILL GIVE YOU <font color=\'#400080\'>50' + v3 + '</font> MORE MONEY WHEN YOU <font color=\'#400080\'>SELL</font> THINGS.', 2); setit('title3', 3); but('champion', 830, 193, 0, [0, 18000], 'YOU ARE A TRUE INSPIRATION TO ALL RIGHT-THINKING SOCIALISTS EVERYWHERE! AN OX AMONG MEN, YOUR <font color=\'#800000\'>STAMINA</font> WILL COME BACK <font color=\'#800000\'>2.5' + v3 + ' ' + v14 + ' SECOND</font>! FLARE YOUR NOSTRILS IN THE SOCIALIST FASHION!', 3); setun('choco', 0); setun('numchoco', 0); setun('booze', 1); setun('numbooze', 1); setun('smokes', 2); setun('numsmokes', 2); setun('guns', 3); setun('numguns', 3); sb.numchoco.text = run.powers.choco; sb.numbooze.text = run.powers.booze; sb.numsmokes.text = run.powers.smokes; sb.numguns.text = run.powers.firearms; setit('sunny', 0); infobut(500, 175, 'WHEN THE SUN BEAMS DOWN FROM OVERHEAD, ALL TRUE SOCIALSTS PERK UP THEIR HEADS AND LONG TO RUN FOR THE GLORY OF THE PEOPLE, THEIR CHESTS HEAVING THE PEOPLE\'S BREATHS!', 0); setit('overcast', 0); infobut(500, 195, 'THOUGH IT MIGHT NOT ROUSE THE SPIRIT IN THE SAME WAY, A COOL BREEZE AND SOME CLOUDS CAN REFRESH. YOUR <font color=\'#800000\'>STAMINA</font> WILL COME BACK <font color=\'#800000\'>3' + v3 + ' ' + v14 + ' 4 SECONDS</font> WHEN OVERCAST.', 0); setit('rainy', 1); infobut(500, 215, 'EVEN BRAVE WORKERS FINDS RAIN A HAZARD. RUN AT <font color=\'#000080\'>65' + v3 + ' SPEED</font>, AND <font color=\'#800000\'>STAMINA</font> WILL RETURN <font color=\'#800000\'>1.5' + v3 + ' ' + v14 + ' SECOND</font>. OFFICIALS WON\'T NOTICE YOUR ACTIONS, GOOD AND BAD, HALF THE TIME.', 1); setit('foggy', 2); infobut(500, 235, 'RUNNING THROUGH FOG IS A GHOSTLY EXPERIENCE. RUN AT <font color=\'#000080\'>60' + v3 + ' SPEED</font>, AND <font color=\'#800000\'>STAMINA</font> WILL RETURN <font color=\'#800000\'>3' + v3 + ' ' + v14 + ' 4 SECONDs</font>. OFFICIALS WON\'T NOTICE YOUR ACTIONS, GOOD AND BAD, AT ALL.', 2); setit('heatwave', 3); infobut(500, 255, 'ENDURE THE GRUELING HEAT, PROUD RUNNER! RUN AT <font color=\'#000080\'>75' + v3 + ' SPEED</font>, AND <font color=\'#800000\'>STAMINA</font> WILL DRAIN <font color=\'#800000\'>1.5' + v3 + ' ' + v14 + ' SECOND</font>. OFFICIALS WON\'T NOTICE YOUR ACTIONS, GOOD AND BAD, 66' + v3 + ' OF THE TIME.', 3); douns(); sellbut(1070, 94, 1, 'OUR DEAR LEADERS HAVE ENSURED THAT ALL SOCIALISTS ARE GIVEN A HIGHLY ADEQUATE 15 GRAMS OF CHOCOLATE RATION A WEEK. SOMETIMES PEOPLE MISPLACE THEIR RATION, HOWEVER. PERHAPS YOU CAN HELP THEM.'); sellbut(1070, 124, 2, 'IN THEIR WISDOM, OUR LEADERS HAVE DEEMED THAT THE NEW SOCIALIST MAN HAS NO NEED OF THE ESCAPISM OF ALCOHOL. SOME DEAR COMRADES ARE STILL MAKING THE TRANSITION, HOWEVER, AND WHO COULD BEGRUDGE THEM A LITTLE AID?'); sellbut(1070, 154, 3, 'FILTHY CAPITALISTS ONCE POLLUTED THE LUNGS OF WORKERS WITH CIGARETTES, THE FOUL PIGS. MANY OF OUR FINE WORKERS ARE NOW FASCINATED BY CIGARRETTES AS RELICS OF THOSE DISTANT AND GRIM TIMES. HELP THEM KEEP RIGHTEOUS ANGER AT THE PAST ALIVE.'); sellbut(1070, 184, 4, 'I CAN ONLY ASSUME THAT THE EVER PRESENT URGE FOR FIREARMS IS A SHINING EXAMPLE OF OUR REVOLUTIONARY POPULATIONS DEEP AND GLORIOUS URGE TO EMULATE OUR GRAND FIGHTING FORCES. THAT SURELY MAKES SENSE, RIGHT?'); var greetmsg = 'GREETINGS, DEAR COMRADE! CONGRATULATIONS ON YOUR FINE RUNNING! CARE TO MAKE ANY DONATIONS BEFORE YOUR NEXT RACE?'; var hintmsg = ''; var backs; var light; var light2; var flasher; var isRainy = false; var isOvercast = false; var alpha1; var alpha2; makeBacks(); var therainsound = allStuff.attachMovie('empty', 'thesound4', 9003, {}); therainsound.snd = new Sound(therainsound); rainnoise('rain.mp3'); therainsound.snd.setVolume(0); var v17 = [makeSunny, makeOvercast, makeRainy, makeHeatwave]; if (buyID == 0) { v17 = [makeRainy]; } if (buyID == 3) { v17 = [makeSunny]; } var v21 = Math.floor(Math.random() * v17.length); v17[v21](); if (v21 == 2 || buyID == 0) { therainsound.snd.setVolume(100 * run.fullvol); } var thesound = allStuff.attachMovie('empty', 'thesound', 9000, {}); thesound.snd = new Sound(thesound); var themusic = allStuff.attachMovie('empty', 'thesound2', 9001, {}); themusic.snd = new Sound(themusic); themusic.snd.setVolume(100 * run.fullvol); run.onVolChange = function () { themusic.snd.setVolume(run.fullvol * 100); }; if (run.powers.didupgrade) { snd('upgrade.mp3'); run.powers.didupgrade = false; } mus('menu2.mp3'); }; storedv1.runconsts = function () {}; storedv1.initrunvars = function () { run.startx = [0, 0, 0, 0, 0, -15000, -5000, 1000, 0, -5000, 14000, -5000, -10000, 5000, 5000, 3000, 0, 2000, 19000, 2000, -10000, 2000, 11000, -5000]; run.endx = [0, 0, 0, 0, 0, 200, 50, 0, 0, 50, -400, 50, 100, -50, -50, 0, 0, 0, -200, 0, 200, 0, -300, 0]; run.starty = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]; run.camWander = [0, 1, 1, 0, 1, 0, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 0, 1, 0, 1]; run.judgey = [0, 50, 50, -80, -20, -50, -50, 10, 10, -80, 30, -50, -50, -50, -50, -50, -20, 0, 0, 0, -50, 0, -80, 0]; run.ypos = [0, 380, 320, 160, 220, 220, 270, 310, 320, 120, 290, 230, 230, 260, 250, 250, 270, 360, 350, 370, 200, 280, 120, 320]; run.names = ['', 'WINSTON', 'CALVIN', 'FRANKLIN', 'HEGEL', 'HAYEK', 'HOBBES', 'LOCKE', 'FRANZ', '', 'LUTHER', 'BENITO', 'FRIEDRICH', 'RICARDO', 'JOSEPH', 'THOMAS']; run.winquotes = [[], ['MY RACING WAS THE WORST RACING MANKIND HAS EVER SEEN, EXCEPT FOR ALL OF YOUR RACING.'], ['I WAS PREDESTINED TO WIN, SO YOU SHOULDN\'T FEEL BAD THAT YOU LOST. YOU HAVE PLENTY OF OTHER REASONS TO FEEL BAD.'], ['DO NOT BLAME ME FOR WINNING, MY FRIEND. BLAME COMRADE HOOVER FOR HELPING YOU LOSE.'], ['WITH THE THESIS OF MY STRONG RACING, AND THE ANTITHESIS OF YOUR WEAK RACING, THIS RESULT IS HISTORICALLY INEVITABLE.'], ['THESE RACES STAND IN MOCKERY OF HUMAN FREEDOM... BUT I MUST ADMIT I LIKE WINNING.'], ['DO NOT HATE THE PARTY OFFICIALS FOR THEIR ARBITRARY POWER. BE GLAD THEY TAKE RESPONSIBILITY AND HOLD A MONOPOLY ON IT.'], ['THE STRUCTURE OF THESE RACES DO NOT RESPECT MY FUNDAMENTAL RIGHTS.'], ['I\'M STUCK IN A MEANINGLESS BUREAUCRACY AND YET I WON SOMEHOW? SHOULD I BE GLAD AT WINNING, WHEN WINNING HAS NO MEANING? IS THAT WINNING?'], [''], ['THE NINETY SIXTH THESIS, COMRADES - I AM TOTALLY AWESOME AT RUNNING.'], ['I HAVE LONG FOUND THAT THE SECRET TO WINNING RACES IS WEARING A NICE HAT AND A STYLISH COAT. IN FACT, THAT\'S THE SECRET TO EVERYTHING.'], ['I WON BECAUSE I ABANDONED YOUR SLAVE MORALITY.'], ['COMPARATIVE ADVANTAGE WOULD SUGGEST THAT THE REST OF YOU SHOULD BECOME SHOP KEEPERS AND PROMOTERS. NO OFFENSE.'], ['YOU THINK THAT WAS FAST, YOU SHOULD SEE HOW QUICKLY I CAN COLLECTIVIZE A FARM! NEEDLESS TO SAY, IT\'S FAIRLY QUICK.'], ['I CAN PURSUE HAPPINESS FASTER THAN JUST ABOUT ANYBODY.']]; run.stamina = 40; run.staminaEffect = 0; run.runspeed = 1; run.patriotism = 0; run.papers = false; run.foerun = 0.1; run.startScreen = 1; run.faces = [40, 1, 2, 3]; run.allPauseTime = -1; run.buttons = []; run.readClick = false; run.doneReading = true; run.isRainy = false; run.isOvercast = false; run.isHeatwave = false; run.weatherChangeTime = -1; run.weatherSpeed = 1; run.weatherMeSpeed = 1; run.weatherStaminaLoss = 0; run.audienceChance = 1; run.gray = [1, 0, 1, 0, 1, 0, 1, 1, 0, 0, 1, 1, 1, 1, 0, 0]; run.playerPos = 0; run.playerActive = false; run.mapfaces = []; run.mapguys = []; run.started = false; run.stopRunning = false; run.raceOver = false; run.speedScale = 0.52; run.infoTime = -1; run.baseScreen = 1; run.runners = []; run.rank = 0; run.tick = 0; run.thewinner = undefined; run.mapys = []; run.speeds = []; run.mapys2 = []; run.speeds2 = []; run.judgeActiveCore = false; run.judgeActive = false; run.infractionTime = -1; run.goodies = [[2, 28, 35], [6, 8, 10, 11, 30, 34], [18, 26], [36, 37, 38, 39, 40]]; run.goodies2 = [1, 3, 4, 5, 7, 9, 12, 13, 15, 16, 17, 19, 20, 21, 22, 23, 24, 25, 27, 29, 31, 32]; run.goodies2eat = [0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 1, 1, 0, 0, 1, 0, 0, 1, 0, 1, 1, 1, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0]; run.curLayer = 0; run.blackmarket = [0, 0, 0, 0, 0]; run.consumes = ['candybar.mp3', 'beer.mp3', 'lighter.mp3', 'reload2.mp3']; run.getnames = ['', 'CHOCOLATE', 'ALCOHOL', 'CIGARETTES', 'FIREARMS']; run.getcols = ['', '888833', '883388', '6666BB', '338833']; run.lastShiv = -500; run.lastBite = -500; run.lastTaunt = -500; run.lastKick = -500; run.lastIgnore = -500; run.lastScold = -500; run.lastSalute = -500; run.lastDonate = -500; run.lastJog = -500; run.lastRun = -500; run.lastSprint = -500; run.runSpeedTimer = -1; run.shivTimer = 240 - 30 * (run.powers.shivving - 1) - (run.powers.barbedknife ? 60 : 0); run.corruptTimer = (15 - (run.powers.corruption - 1) * 3) * 30; run.tick2 = 0; run.screensCleared = 0; run.nextTempChange = 120 + Math.random() * 120; run.curweather = undefined; run.runTimer = 0; run.endPlace = -1; run.marxswap = 90 + 300 * Math.random(); run.slowRunTime = -1; run.judgeActiveTime = 0; run.atEnd = false; }; goto 75231; label 75226: goto 90085; label 75231: storedv1.addactions = function () { function add(labelname, src, sx, sy, hover, fn) { ++curadd; src.world = false; src.sx = sx; src.sy = sy; src.push = fn; run.buttons.push(src); src.hover = hover; run.hud[labelname] = run.hud.attachMovie('refill', 'em1' + curadd, 29000 + curadd, {'_x': src._x, '_y': src._y}); var v2 = run.hud[labelname]; var v1 = 1; while (v1 < 11) { v2['t' + v1]._visible = false; ++v1; } } var curadd = 0; var stablines = ['BLARGH!!!', 'URGHGHGH!!!', 'MEHHHHHH!!!', 'OWWWW!!!!', 'WAAAAHHHH!!', 'BLARGH!!!', 'URGHGHGH!!!', 'MEHHHHHH!!!', 'OWWWW!!!!', 'WAAAAHHHH!!', 'OMFGGGGG!!!']; if (run.powers.shivving > 0) { run.stcost = 15; add('shivrefill', run.hud.shiv, 56, 56, '<font color=\'#FF0000\'>SHIV</font>: PRESS TO STAB THE NEAREAST RACER AHEAD OF YOU. LIMITED RANGE.', function () { if (!run.started || run.tick2 - run.lastShiv < run.shivTimer || run.stcost > run.stamina) { if (run.stcost > run.stamina) { run.infoTime = 120; run.hud.talker.gotoAndStop(36); run.hud.info = '<font color=\'#DDDDBB\'>YOU NEED MORE STAMINA TO DO THAT.</font>'; } run.dosnd('bump.mp3'); return undefined; } run.stamina -= run.stcost; run.lastShiv = run.tick2; run.dosnd('knife.mp3'); run.hud.butstab.filters = run.c3(0.3, 0.3, 0.3); var v4 = (run.baseScreen - 1) / 10 + 0.1 * (run.playerPos / 600); var v2 = null; var v3 = 100; var v5 = 0.03; if (run.powers.barbedknife) { v5 = 0.06; } var v1 = 0; while (v1 < run.runners.length) { if (run.runners[v1].ratio > v4 - 0.01 && run.runners[v1].ratio < v3) { v2 = run.runners[v1]; v3 = v2.ratio; } ++v1; } if (v2 != null && v3 - v4 < v5) { if (v2.src.screen == run.baseScreen) { run.dotext(v2.src._x, v2.src._y, stablines[Math.floor(Math.random() * stablines.length)]); } run.dosnd('dying1.mp3'); v2.src.stabbed = true; v2.src.mappic._rotation = -135; v2.src.mappic.filters = run.c3(1, 0.2, 0.2); v2.src.filters = run.c3(1, 0.2, 0.2); v2.src.head.filters = run.c3(1, 0.2, 0.2); } var v6 = run.powers.barbedknife ? 0.5 : 1; if (run.judgeActive && Math.random() < run.audienceChance * v6) { if (run.papers) { run.papers = false; run.playerGuy.paper._visible = false; run.hud.talker.gotoAndStop(70); run.infoTime = 120; run.hud.info = 'AH, THESE <font color=\'#88FF88\'>PAPERS</font> DO EXPLAIN EVERYTHING! <font color=\'#88FF88\'>CARRY ON</font>!'; } else { run.dosnd('siren.mp3'); run.infractionTime = run.powers.goldstar ? 90 : 180; } } }); } else { run.hud.butstab._visible = false; } var bitelines = ['WHAT THE...!', 'WHAT!', 'HUH!!!', 'OW!', 'UGH!!!', 'WHAT THE...!', 'WHAT!', 'HUH!!!', 'OW!', 'UGH!!!', 'WHAT THE...!', 'WHAT!', 'HUH!!!', 'OW!', 'UGH!!!', 'GET AWAY!', 'OW, MY ANKLE!!!', 'OW, MY NECK!!!', 'OW, MY ELBOW!!!', 'VAMPIRE!', 'BAD SOCIALIST!!!']; if (run.powers.biting > 0) { run.stcost = 10; add('biterefill', run.hud.bite, 56, 56, '<font color=\'#FF0000\'>BITE</font>: PRESS TO BITE THE NEAREST RACER AHEAD OF YOU. LIMITED RANGE.', function () { if (!run.started || run.tick2 - run.lastBite < 240 || run.stcost > run.stamina) { if (run.stcost > run.stamina) { run.infoTime = 120; run.hud.talker.gotoAndStop(36); run.hud.info = '<font color=\'#DDDDBB\'>YOU NEED MORE STAMINA TO DO THAT.</font>'; } run.dosnd('bump.mp3'); return undefined; } run.stamina -= run.stcost; run.lastBite = run.tick2; run.dosnd('chew.mp3'); run.hud.butbite.filters = run.c3(0.3, 0.3, 0.3); run.hud.buttaunt.filters = run.c3(0.3, 0.3, 0.3); run.hud.butkick.filters = run.c3(0.3, 0.3, 0.3); if (run.tick2 - run.lastTaunt > 180) { run.lastTaunt = run.tick2 - 180; } if (run.tick2 - run.lastKick > 180) { run.lastKick = run.tick2 - 180; } var v4 = (run.baseScreen - 1) / 10 + 0.1 * (run.playerPos / 600); var v2 = null; var v3 = 100; var v1 = 0; while (v1 < run.runners.length) { if (run.runners[v1].ratio > v4 - 0.01 && run.runners[v1].ratio < v3) { v2 = run.runners[v1]; v3 = v2.ratio; } ++v1; } if (v2 != null && v3 - v4 < 0.03) { if (v2.src.screen == run.baseScreen) { run.dotext(v2.src._x, v2.src._y, bitelines[Math.floor(Math.random() * bitelines.length)]); } run.dosnd('complain1.mp3'); v2.src.bitten = 180 + run.powers.biting * 90 + (run.powers.steroids ? 180 : 0); } if (run.judgeActive && Math.random() < run.audienceChance) { if (run.papers) { run.papers = false; run.playerGuy.paper._visible = false; run.hud.talker.gotoAndStop(70); run.infoTime = 120; run.hud.info = 'AH, THESE <font color=\'#88FF88\'>PAPERS</font> DO EXPLAIN EVERYTHING! <font color=\'#88FF88\'>CARRY ON</font>!'; } else { run.dosnd('siren.mp3'); run.infractionTime = run.powers.bronzestar ? 45 : 90; } } }); } else { run.hud.butbite._visible = false; } var tauntlines = ['!', '!!!', '...', '!', '!!!', '...', '!?!', '!', '!!!', '...', '!?!', '!', '!!!', '...', '!?!', 'NO!', 'WHAT!', 'WHY!', 'YOU!']; if (run.powers.taunting > 0) { run.stcost = 5; add('tauntrefill', run.hud.taunt, 56, 56, '<font color=\'#FF0000\'>TAUNT</font>: PRESS TO INSULT ALL OF YOUR NEARBY FOES. SOME OF THEM WILL BE OUTRAGED AND SLOWDOWN.', function () { if (!run.started || run.tick2 - run.lastTaunt < 240 || run.stcost > run.stamina) { if (run.stcost > run.stamina) { run.infoTime = 120; run.hud.talker.gotoAndStop(36); run.hud.info = '<font color=\'#DDDDBB\'>YOU NEED MORE STAMINA TO DO THAT.</font>'; } run.dosnd('bump.mp3'); return undefined; } run.dosnd('swear.mp3'); run.hud.butbite.filters = run.c3(0.3, 0.3, 0.3); run.hud.buttaunt.filters = run.c3(0.3, 0.3, 0.3); run.hud.butkick.filters = run.c3(0.3, 0.3, 0.3); if (run.tick2 - run.lastKick > 180) { run.lastKick = run.tick2 - 180; } if (run.tick2 - run.lastBite > 180) { run.lastBite = run.tick2 - 180; } var v3 = (run.baseScreen - 1) / 10 + 0.1 * (run.playerPos / 600); var v4 = null; var v5 = 100; var v1 = 0; while (v1 < run.runners.length) { var v2 = v3 - run.runners[v1].ratio; if (v2 < 0.06 && v2 > -0.06) { if (Math.random() < 0.3 + 0.2 * run.powers.taunting) { if (run.runners[v1].src.screen == run.baseScreen) { run.dotext(run.runners[v1].src._x, run.runners[v1].src._y, tauntlines[Math.floor(Math.random() * tauntlines.length)]); } run.runners[v1].src.taunted = 60; } } ++v1; } run.stamina -= run.stcost; run.lastTaunt = run.tick2; }); } else { run.hud.buttaunt._visible = false; } var kicklines = ['OOOF!!!!', 'UGGHHH!!!', 'ACK!!!!', 'OWWWW!!!!', 'WHY!!!', 'NO!!!!', 'OOOF!!!!', 'UGGHHH!!!', 'ACK!!!!', 'OWWWW!!!!', 'WHY!!!', 'NO!!!!', 'OW, MY VITALS!!!', 'OW, MY PARTS!!!', 'OW, MY PANCREAS!!!', 'OW, MY SENSITIVES!!!', 'OW, MY ARMPIT!!!']; if (run.powers.kicking > 0) { run.stcost = 10; add('kickrefill', run.hud.kick, 56, 56, '<font color=\'#FF0000\'>KICK</font>: PRESS TO DELIVER A KICK TO THE NEAREST RACER AHEAD OF YOU. LIMITED RANGE.', function () { if (!run.started || run.tick2 - run.lastKick < 240 || run.stcost > run.stamina) { if (run.stcost > run.stamina) { run.infoTime = 120; run.hud.talker.gotoAndStop(36); run.hud.info = '<font color=\'#DDDDBB\'>YOU NEED MORE STAMINA TO DO THAT.</font>'; } run.dosnd('bump.mp3'); return undefined; } run.stamina -= run.stcost; run.lastKick = run.tick2; run.dosnd('kick.mp3'); run.hud.butbite.filters = run.c3(0.3, 0.3, 0.3); run.hud.buttaunt.filters = run.c3(0.3, 0.3, 0.3); run.hud.butkick.filters = run.c3(0.3, 0.3, 0.3); if (run.tick2 - run.lastTaunt > 180) { run.lastTaunt = run.tick2 - 180; } if (run.tick2 - run.lastBite > 180) { run.lastBite = run.tick2 - 180; } var v4 = (run.baseScreen - 1) / 10 + 0.1 * (run.playerPos / 600); var v2 = null; var v3 = 100; var v1 = 0; while (v1 < run.runners.length) { if (run.runners[v1].ratio > v4 - 0.01 && run.runners[v1].ratio < v3) { v2 = run.runners[v1]; v3 = v2.ratio; } ++v1; } if (v2 != null && v3 - v4 < 0.03) { if (v2.src.screen == run.baseScreen) { run.dotext(v2.src._x, v2.src._y, kicklines[Math.floor(Math.random() * kicklines.length)]); } run.dosnd('complain1.mp3'); v2.src.kicked = 90 + run.powers.kicking * 60 + (run.powers.steroids ? 120 : 0); run.infoTime = 90; } if (run.judgeActive && Math.random() < run.audienceChance) { if (run.papers) { run.papers = false; run.playerGuy.paper._visible = false; run.hud.talker.gotoAndStop(70); run.infoTime = 120; run.hud.info = 'AH, THESE <font color=\'#88FF88\'>PAPERS</font> DO EXPLAIN EVERYTHING! <font color=\'#88FF88\'>CARRY ON</font>!'; } else { run.dosnd('siren.mp3'); run.infractionTime = run.powers.bronzestar ? 45 : 90; } } }); } else { run.hud.butkick._visible = false; } if (run.powers.corruption > 0) { run.stcost = 10; add('ignorerefill', run.hud.ignore, 56, 56, '<font color=\'#FF0000\'>IGNORE</font>: PRESS TO SEND THE OFFICIALS AWAY FOR A FEW SECONDS.', function () { if (!run.started || run.tick2 - run.lastIgnore < run.corruptTimer || run.stcost > run.stamina) { if (run.stcost > run.stamina) { run.infoTime = 120; run.hud.talker.gotoAndStop(36); run.hud.info = '<font color=\'#DDDDBB\'>YOU NEED MORE STAMINA TO DO THAT.</font>'; } run.dosnd('bump.mp3'); return undefined; } if (run.judgeActive) { run.hud.talker.gotoAndStop(70); run.infoTime = 120; run.hud.talker.gotoAndStop(70); run.hud.info = 'WE OFFICIALS WILL BE <font color=\'#8888FF\'>BACK IN JUST A SECOND</font>!'; } else { run.infoTime = 120; run.hud.talker.gotoAndStop(36); run.hud.info = '<font color=\'#DDDDBB\'>THERE ARE NO OFFICIALS TO SEE YOU DO THAT.</font>'; } run.stamina -= run.stcost; run.lastIgnore = run.tick2; run.judgeActive = false; run.judgeActiveCore = false; run.marxswap = 180; run.dosnd('down1.mp3'); run.infractionTime = -1; run.hud.butignore.filters = run.c3(0.3, 0.3, 0.3); }); } else { run.hud.butignore._visible = false; } var scoldlines = ['BUT I DIDN\'T...', 'MY APOLOGIES!!!', 'YES, SIRS!!!', 'WHAT?!?!?', 'I DO APOLOGIZE!!!', 'ACCEPT MY REGRETS!!!', 'NO!!!!', 'IF YOU INSIST!!!']; if (run.powers.scolding > 0) { run.stcost = 10; add('scoldrefill', run.hud.scold, 56, 56, '<font color=\'#FF0000\'>SCOLD</font>: PRESS TO CAUSE THE OFFICIALS TO PUNISH YOUR FASTEST COMPETITOR', function () { if (!run.started || run.tick2 - run.lastScold < 240 || run.stcost > run.stamina) { if (run.stcost > run.stamina) { run.infoTime = 120; run.hud.talker.gotoAndStop(36); run.hud.info = '<font color=\'#DDDDBB\'>YOU NEED MORE STAMINA TO DO THAT.</font>'; } run.dosnd('bump.mp3'); return undefined; } run.lastScold = run.tick2; run.hud.butscold.filters = run.c3(0.3, 0.3, 0.3); run.hud.butsalute.filters = run.c3(0.3, 0.3, 0.3); run.hud.butdonate.filters = run.c3(0.3, 0.3, 0.3); if (run.tick2 - run.lastSalute > 180) { run.lastSalute = run.tick2 - 180; } if (run.tick2 - run.lastDonate > 180) { run.lastDonate = run.tick2 - 180; } if (!run.judgeActive) { run.infoTime = 120; run.hud.talker.gotoAndStop(36); run.hud.info = '<font color=\'#DDDDBB\'>THERE ARE NO OFFICIALS TO SEE YOU DO THAT.</font>'; } else { if (Math.random() < run.audienceChance) { run.stamina -= run.stcost; var v2 = null; var v3 = -100; var v1 = 0; while (v1 < run.runners.length) { if (run.runners[v1].ratio > v3) { v2 = run.runners[v1]; v3 = v2.ratio; } ++v1; } if (v2 != null) { if (v2.src.screen == run.baseScreen) { run.dotext(v2.src._x, v2.src._y, scoldlines[Math.floor(Math.random() * scoldlines.length)]); } run.dosnd('nono.mp3'); v2.src.scolded = 30 * run.powers.scolding; run.hud.talker.gotoAndStop(70); run.infoTime = 120; run.hud.info = 'NO, NO, <font color=\'#8888FF\'>COMRADE ' + v2.src.myname + '</font>, BAD!\nTHAT IS NOT THE SOCIALIST WAY!'; } } else { run.hud.talker.gotoAndStop(70); run.infoTime = 120; run.hud.info = 'WHAT WAS THAT, COMRADE?\nTHIS <font color=\'#FFFF88\'>WEATHER</font> MAKES IT <font color=\'#FFFF88\'>HARD TO SEE</font>.'; } } }); } else { run.hud.butscold._visible = false; } var salutelines = ['BUT I DIDN\'T...', 'MY APOLOGIES!!!', 'YES, SIRS!!!', 'WHAT?!?!?', 'I DO APOLOGIZE!!!', 'ACCEPT MY REGRETS!!!', 'NO!!!!', 'IF YOU INSIST!!!']; if (run.powers.gesturing > 0) { run.stcost = 3; add('saluterefill', run.hud.salute, 56, 56, '<font color=\'#FF0000\'>SALUTE</font>: PRESS TO SALUTE OFFICIALS. THEY MIGHT PUNISH A RANDOM RUNNER IF THEY ARE PLEASED.', function () { if (!run.started || run.tick2 - run.lastSalute < 240 || run.stcost > run.stamina) { if (run.stcost > run.stamina) { run.infoTime = 120; run.hud.talker.gotoAndStop(36); run.hud.info = '<font color=\'#DDDDBB\'>YOU NEED MORE STAMINA TO DO THAT.</font>'; } run.dosnd('bump.mp3'); return undefined; } run.lastSalute = run.tick2; run.hud.butscold.filters = run.c3(0.3, 0.3, 0.3); run.hud.butsalute.filters = run.c3(0.3, 0.3, 0.3); run.hud.butdonate.filters = run.c3(0.3, 0.3, 0.3); if (run.tick2 - run.lastScold > 180) { run.lastScold = run.tick2 - 180; } if (run.tick2 - run.lastDonate > 180) { run.lastDonate = run.tick2 - 180; } run.dosnd('salute.mp3'); if (!run.judgeActive) { run.infoTime = 120; run.hud.talker.gotoAndStop(36); run.hud.info = '<font color=\'#DDDDBB\'>THERE ARE NO OFFICIALS TO SEE YOU DO THAT.</font>'; } else { if (Math.random() < run.audienceChance) { run.stamina -= run.stcost; var v2 = Math.random(); var v3 = 0.4 + run.powers.gesturing * 0.1 + (run.powers.orphans ? 0.3 : 0); if (v2 < v3) { var v1 = run.runners[Math.floor(Math.random() * run.runners.length)]; if (v1 != null) { if (v1.src.screen == run.baseScreen) { run.dotext(v1.src._x, v1.src._y, salutelines[Math.floor(Math.random() * salutelines.length)]); } run.dosnd('nono.mp3'); v1.src.scolded = 30 + 60 * run.powers.gesturing; run.hud.talker.gotoAndStop(70); run.infoTime = 120; run.hud.info = 'NO, NO, <font color=\'#8888FF\'>COMRADE ' + v1.src.myname + '</font>, BAD!\nTHAT IS NOT THE SOCIALIST WAY!'; } } else { run.hud.talker.gotoAndStop(70); run.infoTime = 120; run.hud.info = 'WE APPRECIATE THE GESTURE, BUT <font color=\'#FF0000\'>WE ARE UNMOVED</font>.'; } } else { run.hud.talker.gotoAndStop(70); run.infoTime = 120; run.hud.info = 'WHAT WAS THAT, COMRADE?\nTHIS <font color=\'#FFFF88\'>WEATHER</font> MAKES IT <font color=\'#FFFF88\'>HARD TO SEE</font>.'; } } }); } else { run.hud.butsalute._visible = false; } if (run.powers.donating > 0) { run.stcost = 2; add('donaterefill', run.hud.donate, 56, 56, '<font color=\'#FF0000\'>DONATE</font>: PRESS TO GIVE THE OFFICIALS SOME LOOSE CHANGE. THEY MIGHT DECLARE A HOLIDAY!', function () { if (!run.started || run.tick2 - run.lastDonate < 240 || run.stcost > run.stamina) { if (run.stcost > run.stamina) { run.infoTime = 120; run.hud.talker.gotoAndStop(36); run.hud.info = '<font color=\'#DDDDBB\'>YOU NEED MORE STAMINA TO DO THAT.</font>'; } run.dosnd('bump.mp3'); return undefined; } run.dosnd('money1.mp3'); run.lastDonate = run.tick2; run.hud.butscold.filters = run.c3(0.3, 0.3, 0.3); run.hud.butsalute.filters = run.c3(0.3, 0.3, 0.3); run.hud.butdonate.filters = run.c3(0.3, 0.3, 0.3); if (run.tick2 - run.lastScold > 180) { run.lastScold = run.tick2 - 180; } if (run.tick2 - run.lastSalute > 180) { run.lastSalute = run.tick2 - 180; } if (!run.judgeActive) { run.infoTime = 120; run.hud.talker.gotoAndStop(36); run.hud.info = '<font color=\'#DDDDBB\'>THERE ARE NO OFFICIALS TO SEE YOU DO THAT.</font>'; } else { if (Math.random() < run.audienceChance) { if (Math.random() < 0.3 + run.powers.donating * 0.1 + (run.powers.orphans ? 0.4 : 0)) { run.hud.talker.gotoAndStop(70); run.infoTime = 120; run.hud.info = 'LET US <font color=\'#8888FF\'>PAUSE AND REFLECT</font>, DEAR COMRADES!'; run.stamina -= run.stcost; run.allPauseTime = 15 + 15 * run.powers.donating + (run.powers.orphans ? 30 : 0); } else { run.hud.talker.gotoAndStop(70); run.infoTime = 120; run.hud.info = 'WE WILL ENJOY THIS DONATION.\nBUT <font color=\'#FF0000\'>IT IS NOT TIME FOR A HOLIDAY</font>.'; } } else { run.hud.talker.gotoAndStop(70); run.infoTime = 120; run.hud.info = 'WHAT WAS THAT, COMRADE?\nTHIS <font color=\'#FFFF88\'>WEATHER</font> MAKES IT <font color=\'#FFFF88\'>HARD TO SEE</font>.'; } } }); } else { run.hud.butdonate._visible = false; } add('jogrefill', run.hud.jog, 56, 56, '<font color=\'#FF0000\'>CATCH BREATH</font>: PRESS TO REGAIN SOME STAMINA. YOU WON\'T BE ABLE TO SPRINT UNTIL YOU\'RE DONE CATCHING YOUR BREATH.', function () { if (!run.started || run.tick2 - run.lastJog < 210 || run.runSpeedTimer > -1) { run.dosnd('bump.mp3'); return undefined; } run.lastJog = run.tick2; run.stamina += run.stamfn(run.powers.jogging); run.hud.butjog.filters = run.c3(0.3, 0.3, 0.3); run.hud.butsprint.filters = run.c3(0.3, 0.3, 0.3); run.lastSprint = run.tick2; run.dosnd('breathing.mp3'); }); add('sprintrefill', run.hud.sprint, 56, 56, '<font color=\'#FF0000\'>SPRINT</font>: PRESS TO RUN MUCH FASTER BRIEFLY, AT THE EXPENSE OF SOME STAMINA.', function () { if (!run.started || run.tick2 - run.lastSprint < 210 || run.stamina < 20 + run.powers.sprinting * 2 || run.runSpeedTimer > -1) { if (20 + run.powers.sprinting * 2 > run.stamina) { run.infoTime = 120; run.hud.talker.gotoAndStop(36); run.hud.info = '<font color=\'#DDDDBB\'>YOU NEED MORE STAMINA TO DO THAT.</font>'; } run.dosnd('bump.mp3'); return undefined; } run.dosnd('newrun.mp3'); run.lastJog = run.tick2; run.lastSprint = run.tick2; run.runspeed = run.sprintfn(run.powers.sprinting); run.runSpeedTimer = 60; run.stamina -= 20 + run.powers.sprinting * 2; run.hud.butsprint.filters = run.c3(0.3, 0.3, 0.3); run.hud.butjog.filters = run.c3(0.3, 0.3, 0.3); }); }; storedv1.tryintros = function (tryread) { tryread(1, 'introinfo', '', function () { return true; }); tryread(2, 'saluteinfo', 'salute', function () { return run.powers.gesturing > 0; }); tryread(3, 'donateinfo', 'donate', function () { return run.powers.donating > 0; }); tryread(4, 'distractinfo', 'ignore', function () { return run.powers.corruption > 0; }); tryread(5, 'scoldinfo', 'scold', function () { return run.powers.scolding > 0; }); tryread(6, 'kickinfo', 'kick', function () { return run.powers.kicking > 0; }); tryread(7, 'tauntinfo', 'taunt', function () { return run.powers.taunting > 0; }); tryread(8, 'biteinfo', 'bite', function () { return run.powers.biting > 0; }); tryread(9, 'shivinfo', 'shiv', function () { return run.powers.shivving > 0; }); tryread(10, 'sellinfo', '', function () { return run.powers.underground > 0; }); tryread(19, 'introinfo2', '', function () { return run.powers.racenum > 3; }); tryread(20, 'introinfo3', '', function () { return run.powers.racenum > 6; }); tryread(21, 'introinfo4', '', function () { return run.powers.racenum > 10; }); }; storedv1.dotext = function (sx, sy, tx) { run.curget._alpha = 100; run.curget._x = sx; run.curget._y = sy; run.curget._visible = true; run.curget.text = tx; run.curget.timer = 0; run.getval = (run.getval + 1) % 6; run.curget = run.gets[run.getval]; }; storedv1.trykongupdate = function () { var v2 = 0; if (run.powers.race1 == 1) { v2 = 1; } if (run.powers.race2 == 1) { v2 = 2; } if (run.powers.race3 == 1) { v2 = 3; } if (run.powers.race4 == 1) { v2 = 4; } if (v2 != 0) { _root.kongregateStats.submit('bestlev', v2); } }; goto 90090; label 90085: goto 122704; label 90090: storedv1.dorun = function (levnum) { function add(src, sx, sy, hover, fn) { src.world = false; src.sx = sx; src.sy = sy; src.push = fn; run.buttons.push(src); src.hover = hover; } function addw(src, sx, sy, hover, fn) { src.world = true; src.sx = sx; src.sy = sy; src.push = fn; run.buttons.push(src); src.hover = hover; } function makeBacks() { run.light = run.allStuff.attachMovie('light', 'light', 20000, {'blendMode': 13, 'ticker': 0, 'onEnterFrame': function () { ++this.ticker; this._alpha = 35 + 25 * Math.cos(0.027 * this.ticker); this._y = 30 * Math.cos(0.037 * this.ticker); this._x = 30 * Math.cos(0.047 * this.ticker); if (run.isHeatwave) { this._alpha *= 0.4; } if (run.isOvercast) { this._alpha = 0; } if (run.isRainy) { this._x = Math.random() * 60 - 60; this._y = Math.random() * 60 - 60; this._alpha = 20; } }}); run.light2 = run.allStuff.attachMovie('light', 'light2', 20001, {'blendMode': 13, 'ticker': 0, 'onEnterFrame': function () { ++this.ticker; this._alpha = 35 + 25 * Math.cos(0.037 * this.ticker); this._y = 35 * Math.cos(0.027 * this.ticker); this._x = 35 * Math.cos(0.033 * this.ticker); if (run.isHeatwave) { this._alpha *= 0.4; } if (run.isOvercast) { this._alpha = 0; } if (run.isRainy) { this._x = Math.random() * 60 - 60; this._y = Math.random() * 60 - 60; this._alpha = 20; } }}); run.flasher = run.allStuff.attachMovie('flat', 'flasher', 30001, {'_visible': false, 'fade': 0.9, 'onEnterFrame': function () { if (this._visible == true) { this._alpha *= this.fade; if (this._alpha < 3) { this._visible = false; } } }}); run.backs = run.allStuff.attachMovie(run.allLoaded ? 'backs' : 'backsearly', 'back', 1, {'_x': -5, '_y': -5, '_xscale': 104, '_yscale': 104}); run.backs.gotoAndStop(run.curScreen); } function snd(nm) { if (run.fullvol == 0) { return undefined; } var v1 = thesound.snd; v1.attachSound(nm); v1.start(0, 1); } function mus(nm) { var v1 = themusic.snd; v1.attachSound(nm); v1.start(0, 1000000); } function runnoise(nm) { var v1 = therunningsound.snd; v1.attachSound(nm); v1.start(0, 1000000); } function rainnoise(nm) { var v1 = therainsound.snd; v1.attachSound(nm); v1.start(0, 1000000); } function interpolateArrays(ary1, ary2, t) { var v3 = ary1.length >= ary2.length ? ary1.slice() : ary2.slice(); var v1 = v3.length; while (v1--) { v3[v1] = ary1[v1] + (ary2[v1] - ary1[v1]) * t; } return v3; } function dodesat(darken) { var v5 = new flash.filters.ColorMatrixFilter(); var v8 = [1 * darken, 0, 0, 0, 0]; var v9 = [0, 1 * darken, 0, 0, 0]; var v7 = [0, 0, 1 * darken, 0, 0]; var v6 = [0, 0, 0, 1, 0]; var v3 = [0.3 * darken, 0.59 * darken, 0.11 * darken, 0, 0]; var v4 = 0.15; var v1 = []; v1 = v1.concat(interpolateArrays(v3, v8, v4)); v1 = v1.concat(interpolateArrays(v3, v9, v4)); v1 = v1.concat(interpolateArrays(v3, v7, v4)); v1 = v1.concat(v6); v5.matrix = v1; return v5; } function makeSunny() { run.playerGuy.umbrella._visible = false; run.hud.weather = '<font color=\'#FFFF88\'>SUNNY</font>'; run.isHeatwave = false; run.flasher.filters = run.c3(1, 1, 0.8); run.flasher.blendMode = 1; run.flasher._visible = true; run.flasher._alpha = 100; run.isOvercast = false; run.isRainy = false; run.light.gotoAndStop(1); run.light2.gotoAndStop(1); run.backs.filters = undefined; run.light.blendMode = 13; run.light2.blendMode = 13; run.audienceChance = 1; run.weatherSpeed = 1; run.weatherMeSpeed = 1; run.weatherStaminaLoss = 0; } function makeHeatwave() { run.playerGuy.umbrella._visible = false; run.hud.weather = '<font color=\'#FF8000\'>HEAT WAVE</font>'; run.isHeatwave = true; run.flasher.filters = run.c3(1, 1, 0.8); run.flasher.blendMode = 8; run.flasher._visible = true; run.flasher._alpha = 100; run.isOvercast = false; run.isRainy = false; run.light.gotoAndStop(1); run.light2.gotoAndStop(1); run.backs.filters = undefined; run.light.blendMode = 8; run.light2.blendMode = 8; run.audienceChance = 0.33; run.weatherSpeed = 0.75; run.weatherMeSpeed = 0.75; run.weatherStaminaLoss = 0.5; if (run.powers.waterbottle) { run.weatherStaminaLoss = 0.15; } } function makeOvercast() { run.playerGuy.umbrella._visible = false; run.hud.weather = '<font color=\'#707070\'>OVERCAST</font>'; run.isHeatwave = false; run.flasher.filters = run.c3(0.7, 0.7, 0.7); run.flasher.blendMode = 1; run.flasher._visible = true; run.flasher._alpha = 100; run.isOvercast = true; run.isRainy = false; run.light.gotoAndStop(1); run.light2.gotoAndStop(1); run.backs.filters = [dodesat(1)]; run.light.blendMode = 13; run.light2.blendMode = 13; run.audienceChance = 1; run.weatherSpeed = 1; run.weatherMeSpeed = 1; run.weatherStaminaLoss = -0.2; } function makeRainy() { if (run.powers.umbrella) { run.playerGuy.umbrella._visible = true; } run.hud.weather = '<font color=\'#8080FF\'>RAINY</font>'; run.isHeatwave = false; run.flasher.filters = run.c3(0.4, 0.4, 0.4); run.flasher.blendMode = 1; run.flasher._visible = true; run.flasher._alpha = 100; run.isOvercast = false; run.isRainy = true; run.light.gotoAndStop(2); run.light2.gotoAndStop(2); run.backs.filters = [dodesat(0.5)]; run.light.blendMode = 1; run.light2.blendMode = 1; run.audienceChance = 0.5; run.weatherSpeed = 0.75; run.weatherMeSpeed = 0.65; if (run.powers.umbrella) { run.weatherMeSpeed = 0.85; } run.weatherStaminaLoss = -0.4; } function makeFoggy() { run.playerGuy.umbrella._visible = false; run.hud.weather = '<font color=\'#FFFFFF\'>FOGGY</font>'; run.isHeatwave = false; run.flasher.filters = run.c3(1, 1, 1); run.flasher.blendMode = 1; run.flasher._visible = true; run.flasher._alpha = 100; run.isOvercast = false; run.isRainy = false; run.light.gotoAndStop(3); run.light2.gotoAndStop(3); run.backs.filters = [dodesat(1.5)]; run.light.blendMode = 1; run.light2.blendMode = 1; run.audienceChance = 0; run.weatherSpeed = 0.6; run.weatherMeSpeed = 0.6; run.weatherStaminaLoss = -0.2; } function tryread(fr, test, btn, testfn) { if (run.doneReading == false) { return undefined; } if (run.powers[test] == false && testfn()) { var flasher = null; run.doneReading = false; run.powers[test] = true; if (btn != '') { flasher = _root.attachMovie('burst', 'brbr', 88888, {'_x': run.hud[btn]._x + 32, '_y': run.hud[btn]._y + 32, 'blendMode': 8, 'tick': 0, 'onEnterFrame': function () { ++this.tick; this._visible = this.tick % 40 < 20; }}); } var v4 = _root.attachMovie('readback', 'eeeerb', 100000, {'mousedown': false, 'onEnterFrame': function () { if (run.readClick) { run.readClick = false; run.doneReading = true; if (flasher != null) { flasher.removeMovieClip(); } this.removeMovieClip(); } }}); v4.gotoAndStop(fr); } } run.initrunvars(); var thesound; var themusic; var therunningsound; var therainsound; _root.attachMovie('fadeout', 'fd', 1000001, {'_alpha': 100, 'onEnterFrame': function () { this._alpha = this._alpha * 0.8 + -1; if (this._alpha <= 3) { this.removeMovieClip(); } }}); run.trykongupdate(); ++run.powers.racenum; if (run.powers.bandana) { run.stamina += 10; } if (run.powers.ironstar) { run.stamina += 10; } if (run.powers.bronzestar) { run.stamina += 20; } if (run.powers.goldstar) { run.stamina += 20; } if (levnum == 1) { run.startScreen = 1; run.numScreens = 4; run.music = 'run2.mp3'; run.faces = [40, 1, 2, 3]; run.weatherChangePause = 150; run.foerun = 0.19; } else { if (levnum == 2) { run.startScreen = 5; run.numScreens = 5; run.music = 'run3.mp3'; run.faces = [40, 4, 5, 6, 7, 8]; run.weatherChangePause = 140; run.foerun = 0.245; } else { if (levnum == 3) { run.startScreen = 10; run.numScreens = 6; run.music = 'run2.mp3'; run.faces = [40, 2, 5, 6, 7, 8, 10, 11]; run.weatherChangePause = 130; run.foerun = 0.36; } else { if (levnum == 4) { run.startScreen = 16; run.numScreens = 8; run.music = 'run3.mp3'; run.faces = [40, 1, 2, 3, 10, 11, 12, 13, 14, 15]; run.weatherChangePause = 120; run.foerun = 0.43; } } } } run.curScreen = run.startScreen; run.allStuff = _root.attachMovie('empty', 'eeee', 1, {'mousedown': false, 'onEnterFrame': function () {}}); makeBacks(); thesound = run.allStuff.attachMovie('empty', 'thesound', 9000, {}); thesound.snd = new Sound(thesound); run.dosnd = snd; themusic = run.allStuff.attachMovie('empty', 'thesound2', 9001, {}); themusic.snd = new Sound(themusic); themusic.snd.setVolume(100 * run.fullvol); therunningsound = run.allStuff.attachMovie('empty', 'thesound3', 9002, {}); therunningsound.snd = new Sound(therunningsound); therainsound = run.allStuff.attachMovie('empty', 'thesound4', 9003, {}); therainsound.snd = new Sound(therainsound); run.onVolChange = function () { themusic.snd.setVolume(run.fullvol * 100); }; run.backs.gotoAndStop(run.startScreen); rainnoise('rain.mp3'); therainsound.snd.setVolume(0); var v8 = 0; while (v8 < run.faces.length) { run.speeds.push(v8 / run.faces.length + (-0.05 + 0.1 * Math.random())); run.mapys.push((v8 % 4) / 4); ++v8; } while (run.speeds.length) { var v15 = Math.floor(Math.random() * run.speeds.length); run.speeds2.push(run.speeds[v15]); run.mapys2.push(run.mapys[v15]); run.speeds.splice(v15, 1); run.mapys.splice(v15, 1); } v8 = 0; while (v8 < run.faces.length) { var v20; var shadow = run.allStuff.attachMovie('shadow', 'shadow' + v8, 112 + v8, {'_alpha': 30}); var v9 = run.faces[v8]; var v25 = Math.floor(Math.random() * 12) + 1; if (v8 == 0) { v9 = 40; } run.mapfaces.push(v9); var v3 = run.allStuff.attachMovie((v9 == 40) ? 'runbodyg' : ((v8 == 0 || run.gray[v9 - 1]) ? 'runbodyp' : 'runbody'), 'r' + v8, 402 + v8, {'basex': Math.random() * 3000 - 1500, '_x': 60 + 120 * v8, '_y': 250, 'ticker': 0, 'offset': Math.random() * 6.28, 'goalx': 100, '_xscale': 60, '_yscale': 60, 'z': 60 + Math.random(), 'basey': 140, 'shadow': shadow, 'fr': v25 + 1, 'yoffset': 0, 'bounceHeight': Math.floor(Math.random() * 20), 'id': v8, 'curf': 0, 'sideTick': 0, 'speed': run.speeds2[v8], 'screen': 1, 'sidebob': 0, 'walking': false, 'onEnterFrame': function () { this.swapDepths(Math.floor(15000 - this.z * 50)); var v2 = (this.z - 2) / 60; ++this.ticker; if (this.id != 0) { if (run.started && !run.stopRunning) { if ((run.allPauseTime <= 0 || this.id == 0) && this.stabbed == undefined && (this.kicked == undefined || this.kicked <= 0) && (this.scolded == undefined || this.scolded <= 0)) { ++this.curf; ++this.sideTick; } if (this.stabbed == undefined) { var v3 = 1; this.walking = false; if (this.bitten != undefined && this.bitten > 0) { v3 *= 0.25; --this.bitten; this.walking = true; } if (this.taunted != undefined && this.taunted > 0) { v3 *= 0.25; --this.taunted; this.walking = true; } if (run.allPauseTime > 0) { v3 = 0; this.walking = true; } if (this.kicked != undefined && this.kicked > 0) { v3 = 0; --this.kicked; this.walking = true; } if (this.scolded != undefined && this.scolded > 0) { v3 = 0; --this.scolded; this.walking = true; } this.z -= (0.1 * this.speed + run.foerun + 0.05 * Math.cos(this.ticker * 0.01 + this.offset)) * 1.6 * run.speedScale * v3 * run.weatherSpeed; } if (this.screen == run.baseScreen) { this._alpha = this._alpha * 0.9 + 10.5; this.shadow._alpha = this.shadow._alpha * 0.9 + 3; this.targ._alpha = this.targ._alpha * 0.9 + 10.5; this._visible = true; this.shadow._visible = true; this.targ._visible = true; } else { this._alpha = 0; this.shadow._alpha = 0; this.targ._alpha = 0; this._visible = false; this.shadow._visible = false; this.targ._visible = false; } if (this.z < 2) { this.targ.reset = 5; this.z = 62; ++this.screen; v2 = (this.z - 2) / 60; this._visible = false; this.shadow._visible = false; this.targ._visible = false; } this.fr = (this.fr + 1) % 12; if (this.stabbed == undefined) { this._rotation = Math.cos(this.ticker * 0.063 + this.offset) * 2; } } if (!this.walking) { this.gotoAndStop(this.curf % 12 + 1); } else { this.gotoAndStop(this.curf % 24 + 13); } } else { this.z = 62 - run.playerPos * 0.1; if (run.playerPos > 600) { this._visible = false; this.shadow._visible = false; } if (run.playerActive && !run.stopRunning && run.infractionTime < 0) { this.fr = (this.fr + 1) % 12; this._rotation = Math.cos(this.ticker * 0.063 + this.offset) * 2; this.play(); ++this.sideTick; } else { this.gotoAndStop(1); } } if (this.stabbed == true || this.kicked > 0 || this.scolded > 0 || run.allPauseTime > 0 && this.id != 0) { this._xscale = (60 / this.z) * 10; this._yscale = (60 / this.z) * 10; this._x = 320 + (run.startx[run.curScreen] * v2 + run.endx[run.curScreen] * (1 - v2) + -320 + this.basex + 400 * Math.cos(this.sideTick * 0.02 + this.offset)) / this.z; this.yoffset = this.yoffset * 0.7 + 0; this._y = run.ypos[run.curScreen] + (run.starty[run.curScreen] * v2 + this.basey + this.yoffset) / this.z; } else { this._xscale = ((60 + 1 * Math.sin(this.ticker * 0.03 + this.offset)) / this.z) * 10; this._yscale = ((60 + 1 * Math.sin(this.ticker * 0.027 + this.offset)) / this.z) * 10; this._x = 320 + (run.startx[run.curScreen] * v2 + run.endx[run.curScreen] * (1 - v2) + -320 + this.basex + 400 * Math.cos(this.sideTick * 0.02 + this.offset)) / this.z; this.yoffset = this.yoffset * 0.7 + 0.3 * (this.fr > 6 ? -40 - this.bounceHeight : 0); this._y = run.ypos[run.curScreen] + (run.starty[run.curScreen] * v2 + this.basey + this.yoffset) / this.z; } this.shadow._xscale = this._xscale * 3; this.shadow._yscale = this._yscale * 3; this.shadow._x = this._x + 300 / this.z; this.shadow._y = this._y + 1000 / this.z; }}); if (v8 == 0) { run.playerGuy = v3; if (!run.powers.ironstar) { v3.star1._visible = false; } if (!run.powers.bronzestar) { v3.star2._visible = false; } if (!run.powers.goldstar) { v3.star3._visible = false; } v3.umbrella._visible = false; if (!run.powers.bandana) { v3.belt._visible = false; } if (!run.powers.waterbottle) { v3.bottle._visible = false; } if (!run.powers.papers) { v3.paper._visible = false; } if (!run.powers.barbedknife) { v3.knife._visible = false; } if (!run.powers.orphans) { v3.orphan._visible = false; } } if (v8 == 0) { v3.basex = 0; } v3.gotoAndPlay(v25); run.mapguys.push(v3); v20 = run.allStuff.attachMovie(run.allLoaded ? 'foes' : 'foesearly', 'f' + v8, 350 + v8, {'_x': 60 + 120 * v8, '_y': 250, 'ticker': 0, 'offset': Math.random() * 6.28, 'goalx': 28, '_xscale': 28, '_yscale': 28, 'src': v3, 'reset': 5, 'id': v8, 'onEnterFrame': function () { this.swapDepths(Math.floor(15001 - this.src.z * 50)); ++this.ticker; if ((run.allPauseTime <= 0 || this.id == 0) && this.src.stabbed == undefined && (this.src.kicked == undefined || this.src.kicked <= 0) && (this.src.scolded == undefined || this.src.scolded <= 0)) { if (Math.random() < 0.01) { this.goalx = 28 * (Math.random() > 0.5 ? 1 : -1); } var v2 = ((this.goalx + 1 * Math.cos(this.ticker * 0.06 + this.offset)) / this.src.z) * 10; if (this.reset > 0) { this._xscale = v2; --this.reset; } this._xscale = this._xscale * 0.7 + 0.3 * v2; this._yscale = ((28 + 1 * Math.sin(this.ticker * 0.07000000000000001 + this.offset)) / this.src.z) * 10; this._x = this.src._x; this._y = this.src._y - 25 / this.src.z; if (this.id == 0) { if (run.playerPos > 600) { this._visible = false; } } this._rotation = this.src._rotation + Math.cos(this.ticker * 0.05 + this.offset) * 3; } else { var v2 = (this.goalx / this.src.z) * 10; this._xscale = this._xscale * 0.7 + 0.3 * v2; this._yscale = (28 / this.src.z) * 10; this._x = this.src._x; this._y = this.src._y - 25 / this.src.z; if (this.id == 0) { if (run.playerPos > 600) { this._visible = false; } } this._rotation = this.src._rotation; } }}); v20.gotoAndStop(v9); v3.targ = v20; v3.head = v20; v3.myname = run.names[v9]; v3.myface = v9; v3.quote = run.winquotes[v9][0]; if (v8 == 0) { run.player = v20; } if (v8 == 0) { run.allStuff.attachMovie('arrow', 'arrow', 19000, {'src': v3, 'ticker': 0, 'onEnterFrame': function () { ++this.ticker; if (this.ticker % 24 > 12) { this._visible = false; } else { this._visible = true; } if (run.playerPos > 600) { this._visible = false; } this._x = this.src._x; this._y = this.src._y - 600 / this.src.z; this._xscale = this.src._xscale * 0.5; this._yscale = this.src._yscale * 0.5; }}); } ++v8; } run.hud = _root.attachMovie('newbit', 'tt', 30000, {'_x': 0, '_y': 0}); run.tryintros(tryread); run.gets = []; run.getval = 0; var v22 = 0; while (v22 < 6) { run.gets.push(run.allStuff.attachMovie('getup', 'hethte' + v22, 87000 + v22, {'_visible': false, 'timer': 0, 'onEnterFrame': function () { if (this._visible == false) { return undefined; } ++this.timer; if (this.timer > 30) { this._alpha -= 3; } this._y -= 0.5; if (this._alpha <= 3) { this._visible = false; } }})); ++v22; } run.curget = run.gets[0]; v8 = 0; while (v8 < run.mapguys.length) { var v14 = run.hud.attachMovie('foes', 'm' + v8, 200 - v8, {'src': run.mapguys[v8], '_y': 35 + 20 * (Math.random() * 0.1 + run.mapys2[v8]), '_xscale': 14, '_yscale': 14, 'id': v8, 'onEnterFrame': function () { var v4 = (this.src.screen - 1) / 10 + 0.1 * (1 - (this.src.z - 2) / 60); if (this.id == 0) { v4 = (run.baseScreen - 1) / 10 + 0.1 * (run.playerPos / 600); } if (this.id == 0) { if (run.playerPos > 600) { this._visible = false; } } this.ratio = v4; if (this.id == 0) { run.rank = 0; var v2 = 0; while (v2 < run.runners.length) { if (this.ratio > run.runners[v2].ratio) { ++run.rank; } ++v2; } } var v3 = (1 - (this.src.z - 2) / 60) / run.numScreens + (this.src.screen - 1) / run.numScreens; if (this.id == 0) { v3 = run.playerPos / 600 / run.numScreens + (run.baseScreen - 1) / run.numScreens; } if (v3 > 1 && run.thewinner == undefined) { run.thewinner = this.src; } if (v3 > 1 || run.atEnd) { this._visible = false; } this._x = 160 + 270 * v3; }}); if (v8 == 0) { v14._xscale *= 1.5; v14._yscale *= 1.5; v14._y = 65; } else { run.runners.push(v14); } run.mapguys[v8].mappic = v14; v14.gotoAndStop(run.mapfaces[v8]); ++v8; } run.hud.weather = '<font color=\'#FFFF88\'>SUNNY</font>'; run.marxhud = run.hud.attachMovie('foesearly', 'fee', 99999, {'filters': [new flash.filters.GlowFilter(0, 1, 6, 6, 10, 1, false, false)], '_xscale': 35, '_yscale': 35, '_x': 480, '_y': 45, 'onEnterFrame': function () { if (run.infractionTime > 0) { this.gotoAndStop(73); } else { this.gotoAndStop(70); } if (run.judgeActive) { this._visible = true; this._rotation = 15 * Math.cos(run.tick2 * 0.05); } else { this._visible = false; } }}); run.marxhud.gotoAndStop(70); run.marxhudback = run.hud.attachMovie('foesearly', 'feefwef', 99998, {'_alpha': 50, '_xscale': 70, '_yscale': 70, '_x': 480, '_y': 45, 'onEnterFrame': function () { if (run.judgeActive) { this._visible = true; this._rotation += 1; } else { this._visible = false; } }}); run.marxhudback.gotoAndStop(75); run.hud.bigtext.text = 'RACE ' + run.powers.racenum + '\n\nREADY'; if (run.powers.papers) { run.papers = true; } run.hud.attachMovie('punish', 'punish', 100000, {'_visible': false, 'onEnterFrame': function () { if (run.infractionTime > 0) { this._visible = true; this._alpha = run.infractionTime; } else { this._visible = false; } }}); run.hud.attachMovie('weather', 'weather', 100001, {'_visible': false, 'onEnterFrame': function () { if (run.weatherChangeTime > 0) { this._visible = true; this._alpha = run.weatherChangeTime / 2; } else { this._visible = false; } }}); var v13 = 0; while (v13 < 3) { var side = (v13 == 1) ? -1 : 1; var v28 = run.allStuff.attachMovie(run.allLoaded ? 'foes' : 'foesearly', 'marx' + v13, 20 + v13, {'offset': Math.random() * 5000, 'side': side, 'basex': 150 + 150 * v13, '_y': 100, '_xscale': 50 * side, 'rot': Math.random() * 100, '_yscale': 50, 'tick': 0, 'downy': Math.random() * 50 + 150, 'goaly': -400, 'cury': -400, 'onEnterFrame': function () { ++this.tick; if (run.infractionTime > 0) { this.gotoAndStop(73); } else { this.gotoAndStop(70); } if (run.judgey[run.curScreen] < -10) { this._xscale = 35 * this.side; this._yscale = 35; } else { this._xscale = 50 * this.side; this._yscale = 50; } if (run.judgeActiveCore) { this.goaly = this.goaly * 0.8 + 0.2 * (this.downy + run.judgey[run.curScreen]); } else { this.goaly = this.goaly * 0.8 + -80; } this._x = this.basex + 10 * Math.cos(this.offset + this.tick * 0.01) + 8 * Math.cos(this.offset + this.tick * 0.0123); this._y = this.goaly + 10 * Math.cos(this.offset + 17 + this.tick * 0.01) + 8 * Math.cos(this.offset + 22 + this.tick * 0.0123); this._rotation = 10 * Math.cos(this.rot + 12 + this.tick * 0.008) + 8 * Math.cos(this.rot + 77 + this.tick * 0.0113); }}); v28.gotoAndStop(70); ++v13; } var v49 = 3 * run.numScreens / 4; if (run.powers.commissar) { v49 *= 1.3; } v22 = 0; while (v22 < Math.floor(3 * run.numScreens / 4)) { var v6 = 3 + Math.random() * Math.random() * 8; var ratio = v6 / 60; var v19 = (60 / v6) * 3; var v18 = (60 / v6) * 3; var v5 = Math.floor(Math.random() * run.numScreens); var v17 = 320 + (run.startx[v5 + run.startScreen] * ratio + run.endx[v5 + run.startScreen] * (1 - ratio) + -320 - 600 + 1200 * Math.random()) / v6; var v16 = run.ypos[v5 + run.startScreen] + (run.starty[v5 + run.startScreen] * ratio + 240) / v6; var v10 = run.allStuff.attachMovie(run.allLoaded ? 'treats' : 'treatsearly', 'tr' + run.curLayer, 800 + run.curLayer, {'eaten': false, '_x': v17, '_y': v16, '_xscale': v19, '_yscale': v18, 'myscreen': v5}); var fr = run.goodies2[Math.floor(Math.random() * run.goodies2.length)]; v10.gotoAndStop(fr); v10.eatsound = run.goodies2eat[fr]; addw(v10, 32, 32, '', function (self) { if (self._visible == true) { self._visible = false; self.eaten = true; run.dotext(self._x, self._y, '<font color=\'#FF0000\'>STAMINA UP!</font>'); if (self.eatsound == 1) { snd('eating2.mp3'); } else { snd('drinking.mp3'); } run.stamina += 10; if (run.stamina > 100) { run.stamina = 100; } } }); v10.onEnterFrame = function () { if (run.screensCleared == this.myscreen && !this.eaten) { this._visible = true; } else { this._visible = false; } }; ++run.curLayer; ++v22; } var v7 = 1; while (v7 < 5) { if (run.powers.underground < v7 || Math.random() < 0.5) { } else { var v23 = Math.floor((run.numScreens / 3) * (1 + Math.random())); v22 = 0; while (v22 < v23) { v6 = 3 + Math.random() * Math.random() * 8; var ratio = v6 / 60; v19 = (60 / v6) * 3; v18 = (60 / v6) * 3; v5 = Math.floor(Math.random() * run.numScreens); v17 = 320 + (run.startx[v5 + run.startScreen] * ratio + run.endx[v5 + run.startScreen] * (1 - ratio) + -320 - 600 + 1200 * Math.random()) / v6; v16 = run.ypos[v5 + run.startScreen] + (run.starty[v5 + run.startScreen] * ratio + 240) / v6; v10 = run.allStuff.attachMovie(run.allLoaded ? 'treats' : 'treatsearly', 'tr' + run.curLayer, 800 + run.curLayer, {'filters': [new flash.filters.GlowFilter()], 'id': v7, 'eaten': false, 'soundset': v7 - 1, '_x': v17, '_y': v16, '_xscale': v19, '_yscale': v18, 'myscreen': v5}); v10.gotoAndStop(run.goodies[v7 - 1][Math.floor(Math.random() * run.goodies[v7 - 1].length)]); addw(v10, 32, 32, '', function (self) { if (self._visible == true) { snd(run.consumes[self.soundset]); self._visible = false; self.eaten = true; run.dotext(self._x, self._y, '<font color=\'#' + run.getcols[self.id] + '\'>' + run.getnames[self.id] + ' UP!</font>'); ++run.blackmarket[self.id]; if (run.judgeActive && Math.random() < run.audienceChance) { snd('siren.mp3'); run.infractionTime = run.powers.ironstar ? 45 : 90; } } }); v10.onEnterFrame = function () { if (run.screensCleared == this.myscreen && !this.eaten) { this._visible = true; } else { this._visible = false; } }; ++run.curLayer; ++v22; } } ++v7; } run.addactions(); run.hud.stambar.attachMovie('cover', 'cover', 1, {'blendMode': 12, '_y': 280, 'onEnterFrame': function () { this._y = this._y * 0.9 + 0.1 * ((100 - run.stamina) * 2.8); }}); run.weatherFunctions = [makeSunny, makeOvercast, makeFoggy, makeRainy, makeHeatwave]; if (levnum == 1) { run.weatherFunctions = [makeSunny, makeOvercast]; } else { if (levnum == 2) { run.weatherFunctions = [makeSunny, makeOvercast, makeRainy]; } else { if (levnum == 3) { run.weatherFunctions = [makeSunny, makeOvercast, makeFoggy, makeRainy]; } else { if (levnum == 4) { run.weatherFunctions = [makeSunny, makeOvercast, makeFoggy, makeRainy, makeHeatwave]; } } } } run.allStuff.endTimer = -1; run.hud.talker._visible = false; var lastweather = 0; var curHover = null; var lastHover = null; var hoverTime = 0; run.allStuff.onEnterFrame = function () { function setblobs(timername, refire, blobname) { var v3 = timername + refire - run.tick2; if (v3 > 0) { var v2 = 1; while (v2 < 11) { if (v3 / 30 >= v2) { run.hud[blobname + 'refill']['t' + v2]._visible = true; run.hud[blobname + 'refill']['t' + v2]._alpha = 100; } else { if (v3 / 30 >= v2 - 1) { run.hud[blobname + 'refill']['t' + v2]._visible = true; run.hud[blobname + 'refill']['t' + v2]._alpha = 100 * (v3 / 30 - (v2 - 1)); } else { run.hud[blobname + 'refill']['t' + v2]._alpha = false; } } ++v2; } } else { var v2 = 1; while (v2 < 11) { run.hud[blobname + 'refill']['t' + v2]._visible = false; ++v2; } } } if (run.allLoaded == false) { if (_root.getBytesLoaded() == _root.getBytesTotal()) { run.allLoaded = true; gotoAndStop(9); } } if (run.qualsetting) { if (run.camWander[run.curScreen]) { run.allStuff._yscale = 107 + 3 * Math.cos(run.tick2 * 0.01) + 4 * Math.cos(117 + run.tick2 * 0.0123); run.allStuff._xscale = run.allStuff._yscale; } else { run.allStuff._yscale = 102 + 1 * Math.cos(run.tick2 * 0.01) + 1 * Math.cos(117 + run.tick2 * 0.0123); run.allStuff._xscale = run.allStuff._yscale; } } else { run.allStuff._yscale = 100; run.allStuff._xscale = 100; } ++run.tick2; var v15 = run.allStuff._xscale / 100 - 1; if (run.qualsetting) { if (run.camWander[run.curScreen]) { run.allStuff._x = -v15 * 350 + Math.cos(run.tick2 * 0.02) * 2 + Math.cos(run.tick2 * 0.027) * 3 + Math.cos(run.tick2 * 0.031) * 2.3; run.allStuff._y = -v15 * 500 + Math.cos(run.tick2 * 0.017) * 2.4 + Math.cos(run.tick2 * 0.022) * 1.5 + Math.cos(run.tick2 * 0.025) * 2.7; } else { run.allStuff._x = -v15 * 150 + Math.cos(run.tick2 * 0.02) * 1 + Math.cos(run.tick2 * 0.027) * 2 + Math.cos(run.tick2 * 0.031) * 1.3; run.allStuff._y = -v15 * 200 + Math.cos(run.tick2 * 0.017) * 1.4 + Math.cos(run.tick2 * 0.022) * 0.5 + Math.cos(run.tick2 * 0.025) * 1.7; } } else { run.allStuff._x = 0; run.allStuff._y = 0; } var v4 = run.allStuff._xscale / 100; curHover = null; if (!run.atEnd) { var v5 = 0; while (v5 < run.buttons.length) { var v3 = run.buttons[v5]; if (v3.world) { if (_xmouse / v4 > v3._x + run.allStuff._x / v4 && _xmouse / v4 < v3._x + v3.sx + run.allStuff._x / v4 && _ymouse / v4 > v3._y + run.allStuff._y / v4 && _ymouse / v4 < v3._y + v3.sy + run.allStuff._y / v4) { curHover = v3; } } else { if (_xmouse > v3._x && _xmouse < v3._x + v3.sx && _ymouse > v3._y && _ymouse < v3._y + v3.sy) { curHover = v3; } } ++v5; } } run.hud.tooltip._x = _xmouse; run.hud.tooltip._y = _ymouse + 20; if (run.hud.tooltip._x > 390) { run.hud.tooltip._x = 390; } if (run.hud.tooltip._y > 330) { run.hud.tooltip._y = 330; } run.hud.tooltip.htmlText = curHover.hover; if (curHover.hover == undefined) { run.hud.tooltip.htmlText = ''; } if (curHover == lastHover) { ++hoverTime; if (hoverTime > 30) { run.hud.tooltip._visible = true; } } else { hoverTime = 0; run.hud.tooltip._visible = false; } lastHover = curHover; if (this.mousedown == false && run.mouseState) { this.mousedown = true; run.readClick = true; v4 = run.allStuff._xscale / 100; if (run.doneReading && !run.atEnd) { v5 = 0; while (v5 < run.buttons.length) { v3 = run.buttons[v5]; if (v3.world) { if (_xmouse / v4 > v3._x + run.allStuff._x / v4 && _xmouse / v4 < v3._x + v3.sx + run.allStuff._x / v4 && _ymouse / v4 > v3._y + run.allStuff._y / v4 && _ymouse / v4 < v3._y + v3.sy + run.allStuff._y / v4) { v3.push(v3); } } else { if (_xmouse > v3._x && _xmouse < v3._x + v3.sx && _ymouse > v3._y && _ymouse < v3._y + v3.sy) { v3.push(v3); } } ++v5; } } } if (run.mouseState == false) { this.mousedown = false; } if (run.doneReading) { if (run.judgeActiveCore) { ++run.judgeActiveTime; if (run.judgeActiveTime > 15) { run.judgeActive = true; } } else { run.judgeActive = false; } --run.nextTempChange; --run.allPauseTime; --run.marxswap; --run.infoTime; if (run.infoTime < 0) { run.hud.info = ''; run.hud.talker._visible = false; } else { run.hud.talker._visible = true; } run.hud.talker._visible = false; --run.infractionTime; run.weatherChangeTime -= 3; --run.runSpeedTimer; --run.slowRunTime; } if (run.atEnd == true) { return undefined; } if (run.tick2 - run.lastJog == 210 || run.tick2 - run.lastSprint == 210) { run.hud.butsprint.filters = []; run.hud.butjog.filters = []; } setblobs(run.lastJog, 210, 'jog'); setblobs(run.lastSprint, 210, 'sprint'); if (run.tick2 - run.lastSalute == 240) { run.hud.butsalute.filters = []; } setblobs(run.lastSalute, 240, 'salute'); if (run.tick2 - run.lastDonate == 240) { run.hud.butdonate.filters = []; } setblobs(run.lastDonate, 240, 'donate'); if (run.tick2 - run.lastBite == 240) { run.hud.butbite.filters = []; } setblobs(run.lastBite, 240, 'bite'); if (run.tick2 - run.lastShiv == run.shivTimer) { run.hud.butstab.filters = []; } setblobs(run.lastShiv, run.shivTimer, 'shiv'); if (run.tick2 - run.lastKick == 240) { run.hud.butkick.filters = []; } setblobs(run.lastKick, 240, 'kick'); if (run.tick2 - run.lastTaunt == 240) { run.hud.buttaunt.filters = []; } setblobs(run.lastTaunt, 240, 'taunt'); if (run.tick2 - run.lastIgnore == run.corruptTimer) { run.hud.butignore.filters = []; } setblobs(run.lastIgnore, run.corruptTimer, 'ignore'); if (run.tick2 - run.lastScold == 240) { run.hud.butscold.filters = []; } setblobs(run.lastScold, 240, 'scold'); if (run.allStuff.endTimer > -1) { --run.allStuff.endTimer; if (run.allStuff.endTimer == 0) { var v14; if (levnum == 1) { v14 = [50, 30, 20, 10]; } if (levnum == 2) { v14 = [450, 270, 180, 75, 67.5, 60, 52.5, 45]; } if (levnum == 3) { v14 = [1600, 1000, 600, 360, 200, 180, 170, 160, 150, 140, 130, 120]; } if (levnum == 4) { v14 = [4000, 2400, 1800, 1200, 700, 600, 580, 560, 540, 520, 500, 480, 460, 440, 420, 400]; } var v9 = v14[run.endPlace - 1]; v9 *= 2.5; v9 = Math.floor(v9); if (run.powers.buyID > 0) { run.powers.money += Math.floor(v9); } else { run.powers.money += 50; v9 = 50; } run.powers.choco += run.blackmarket[1]; run.powers.booze += run.blackmarket[2]; run.powers.smokes += run.blackmarket[3]; run.powers.firearms += run.blackmarket[4]; var v11 = 0; if (run.endPlace == 1) { if (levnum == 1) { v11 = 1; run.powers.race1 = 1; } if (levnum == 2) { v11 = 2; run.powers.race2 = 1; } if (levnum == 3) { v11 = 3; run.powers.race3 = 1; } if (levnum == 4) { v11 = 4; run.powers.race4 = 1; } } run.saveGame.data.powers = run.powers; run.saveGame.flush(); if (v11 != 0) { _root.kongregateStats.submit('bestlev', v11); } if (run.endPlace == 1 && levnum == 4) { _root.kongregateStats.submit('finishdays', run.powers.racenum); } run.atEnd = true; run.readClick = false; var v10 = 3; var runEnd = false; if (run.powers.buyID > 0) { if (run.endPlace == 1) { if (levnum == 4) { v10 = 4; if (run.powers.doneEnding == false) { runEnd = true; } } else { v10 = 2; } } else { v10 = 1; } } var v8 = _root.attachMovie('endback', 'eeeerb', 100000, {'mousedown': false, 'onEnterFrame': function () { if (run.readClick) { run.readClick = false; this.removeMovieClip(); _root.attachMovie('fadeout', 'fd', 1000001, {'_alpha': 0, 'onEnterFrame': function () { this._alpha = this._alpha * 0.8 + 21; if (this._alpha >= 100) { this.removeMovieClip(); thesound.snd.stop(); themusic.snd.stop(); therunningsound.snd.stop(); therainsound.snd.stop(); run.hud.removeMovieClip(); run.allStuff.removeMovieClip(); if (runEnd == false) { run.dobuying(); } else { run.doending(); } } }}); return undefined; } }}); v8.gotoAndStop(v10); if (v10 == 1) { var v18 = ['ST', 'ND', 'RD', 'TH', 'TH', 'TH', 'TH', 'TH', 'TH', 'TH', 'TH', 'TH', 'TH', 'TH', 'TH', 'TH', 'TH', 'TH']; v8.rank = 'YOU CAME IN ' + run.endPlace + v18[run.endPlace - 1]; v8.money = 'YOU EARNED ' + v9 + ' CASH'; v8.aword = 'A WORD FROM OUR WINNER, COMRADE ' + run.thewinner.myname; var v16 = v8.attachMovie(run.allLoaded ? 'foes' : 'foesearly', 'fee', 1, {'_x': 200, '_y': 330, '_xscale': 40, '_yscale': 40}); v16.gotoAndStop(run.thewinner.myface); v8.foetalk = run.thewinner.quote; } else { if (v10 == 4 || v10 == 2) { v8.rank = 'YOU CAME IN 1ST!'; v8.money = 'YOU EARNED ' + v9 + ' CASH'; } } return undefined; } } if (run.started && !run.raceOver) { run.runTimer += 2; } if (!run.raceOver) { run.hud.rank = run.faces.length - run.rank; run.hud.rank2 = run.faces.length; } var v17 = Math.floor(run.runTimer / 60); var v7 = run.runTimer % 60; v7 /= 60; v7 = Math.floor(v7 * 100); if (v7 == 0) { v7 = '00'; } else { if (v7 < 10) { v7 = '0' + v7; } } run.hud.time = v17; run.hud.time2 = '.' + v7; if (!run.stopRunning && run.doneReading) { ++run.tick; } if (run.isRainy) { therainsound.snd.setVolume(100 * run.fullvol); } else { therainsound.snd.setVolume(0); } if (run.marxswap < 0 && run.infractionTime < 0) { if (Math.random() < 0.02) { if (run.judgeActiveCore == false) { run.judgeActiveTime = 0; run.judgeActiveCore = true; snd('up1.mp3'); } else { run.judgeActiveCore = false; snd('down1.mp3'); } run.marxswap = 90 + Math.random() * 240; } } if (run.infractionTime > 3) { run.hud.bigtext.text = '\nCOMRADE, THAT DOES NOT ACCORD WITH SOCIALIST IDEALS!!!'; } else { if (run.infractionTime < 3 && run.infractionTime > 0) { run.hud.bigtext.text = ''; } } if (run.nextTempChange <= 0) { run.nextTempChange = run.weatherChangePause + Math.random() * 150; var v13 = Math.floor(Math.random() * run.weatherFunctions.length); if (lastweather != v13) { snd('weatherchange.mp3'); run.weatherChangeTime = 90; run.weatherFunctions[v13](); run.curweather = run.weatherFunctions[v13]; lastweather = v13; } } if (run.tick == 30) { run.hud.bigtext.text = 'RACE ' + run.powers.racenum + '\n\nSTEADY...'; } if (run.tick == 120) { run.hud.bigtext.text = ''; } if (run.tick > 60) { if (run.started == false) { run.hud.bigtext.text = '\n\nGO!!!'; snd('gunshot.mp3'); mus(run.music); runnoise('runningsounds.mp3'); } run.started = true; if (!run.stopRunning) { var v23 = 1; var v12 = 1; if (run.powers.importedshoes) { v12 += 0.1; } if (run.powers.badshoes) { v12 += 0.05; } if (run.infractionTime > 0) { } else { if (run.slowRunTime > -1) { run.playerPos += 2.25 * run.weatherMeSpeed * run.speedScale * v12; } else { if (run.runSpeedTimer > -1) { run.playerPos += 3 * run.runspeed * run.weatherMeSpeed * run.speedScale * v12; } else { run.playerPos += 3 * run.runfn(run.powers.running) * run.weatherMeSpeed * run.speedScale * v12; } } } run.stamina -= run.weatherStaminaLoss * 0.125; if (run.powers.champion) { run.stamina += 0.075; } if (run.stamina < 0) { run.stamina = 0; } if (run.stamina > 100) { run.stamina = 100; } } if (run.raceOver) { therunningsound.snd.setVolume(0 * run.fullvol); } else { if (run.infractionTime > 0) { therunningsound.snd.setVolume(0 * run.fullvol); } else { therunningsound.snd.setVolume((run.playerPos / 600) * (run.playerPos / 600) * 100 * run.fullvol); } } if (run.playerPos > 600 && run.screensCleared < run.numScreens) { ++run.screensCleared; v5 = 0; while (v5 < 6) { run.gets[v5]._visible = false; ++v5; } if (run.screensCleared == run.numScreens) { run.endPlace = run.faces.length - run.rank; run.raceOver = true; run.allStuff.endTimer = 60; snd('crowd.mp3'); } if (run.screensCleared < run.numScreens) { run.player.reset = 5; run.playerPos = 0; ++run.baseScreen; run.curScreen = run.startScreen + (run.baseScreen - 1) % run.numScreens; run.backs.gotoAndStop(run.curScreen); } } run.playerActive = true; } else { run.playerActive = false; } }; }; storedv1.fullvol = 1; storedv1.onVolChange = undefined; storedv1.mouseState = false; storedv1.allLoaded = false; storedv1.qualsetting = 1; storedv1.stams = [0, 2, 4, 6, 8, 11, 14, 18, 22]; storedv1.runs = [0, 0.03, 0.06, 0.09, 0.12, 0.16, 0.2, 0.25, 0.3]; storedv1.sprints = [0, 0.15, 0.3, 0.45, 0.65, 0.85, 1.1, 1.35, 1.6]; storedv1.curLayer = 0; label 122704: ASSetPropFlags(_global.run.prototype, null, 1); #endinitclip } movieClip 4 __Packages.com.newgrounds.components.FlashAd { #initclip if (!_global.com) { _global.com = new Object(); } if (!_global.com.newgrounds) { _global.com.newgrounds = new Object(); } if (!_global.com.newgrounds.components) { _global.com.newgrounds.components = new Object(); } if (!_global.com.newgrounds.components.FlashAd) { var v1 = function () { super(); this.background._visible = this.show_background; if (this.show_background) { this._x = Math.round(this._x); this._y = Math.round(this._y); this._xscale = 100; this._yscale = 100; } com.newgrounds.API.addEventListener(com.newgrounds.APIEvent.ADS_APPROVED, this.loadAd, this); }; com.newgrounds.components.FlashAd = v1; com.newgrounds.components.FlashAd extends MovieClip; var v2 = v1.prototype; v2.onLoad = function () { com.newgrounds.API.attachFlashAd(this); }; v2.loadAd = function (event, params) { com.newgrounds.API.attachFlashAd(this); }; v2.onUnload = function () { this.clip.ad.unloadMovie(); this.clip.ad.removeMovieClip(); this.clip.removeMovieClip(); this.mask.removeMovieClip(); this.background.removeMovieClip(); com.newgrounds.API.removeEventListener(com.newgrounds.APIEvent.ADS_APPROVED, this); }; ASSetPropFlags(com.newgrounds.components.FlashAd.prototype, null, 1); } #endinitclip } movieClip 18 __Packages.com.newgrounds.APIError { #initclip if (!_global.com) { _global.com = new Object(); } if (!_global.com.newgrounds) { _global.com.newgrounds = new Object(); } if (!_global.com.newgrounds.APIError) { var v1 = function (error, msg) { if ((Number(error)).toString() == String(error)) { error = Number(error); } else { if (com.newgrounds.APIError.error_codes[String(error)]) { error = com.newgrounds.APIError.error_codes[String(error)]; } else { error = 0; } } this.code = error; this.message = msg; this.name = com.newgrounds.APIError.error_names[error]; this.alias = com.newgrounds.APIError.aliases[error]; }; com.newgrounds.APIError = v1; var v2 = v1.prototype; v1.init_codes = function () { var v2 = new Object(); var v1 = 0; while (v1 < com.newgrounds.APIError.aliases.length) { v2[com.newgrounds.APIError.aliases[v1]] = v1; ++v1; } return v2; }; v1.init_names = function () { var v5 = new Array(); var v3 = 0; while (v3 < com.newgrounds.APIError.aliases.length) { var v2 = (com.newgrounds.APIError.aliases[v3].toLowerCase()).split('_'); var v1 = 0; while (v1 < v2.length) { v2[v1] = (v2[v1].substr(0, 1)).toUpperCase() + v2[v1].substr(1, v2[v1].length); for (var v4 in com.newgrounds.APIError.always_caps) { if (v2[v1].toUpperCase() == com.newgrounds.APIError.always_caps[v4]) { v2[v1] = v2[v1].toUpperCase(); } } ++v1; } v5[v3] = v2.join(' '); ++v3; } return v5; }; v2.isError = function () { return true; }; v1.aliases = new Array('UNKNOWN_ERROR', 'INVALID_API_ID', 'MISSING_PARAM', 'INVALID_STAT_ID', 'INVALID_COMMAND_ID', 'FLASH_ADS_NOT_APPROVED', 'PERMISSION_DENIED', 'IDENTIFICATION_REQUIRED', 'INVALID_EMAIL_ADDRESS', 'BANNED_USER', 'SESSION_EXPIRED', 'INVALID_SCORE', 'INVALID_MEDAL', 'INVALID_SAVE_GROUP', 'FILE_NOT_FOUND', 'SITE_ID_REQUIRED', 'UPLOAD_IN_PROGRESS', 'USER_CANCELLED', 'CONFIRM_REQUEST', 'ILLEGAL_REQUEST', 'CONNECTION_FAILED', 'QUERY_INCOMPLETE', 'SAVE_FILE_ERROR', 'INVALID_VALUE', 'SERVER_ERROR', 'INVALID_SCOREBOARD'); v1.always_caps = new Array('API', 'URL', 'ID'); v1.error_codes = com.newgrounds.APIError.init_codes(); v1.error_names = com.newgrounds.APIError.init_names(); v2.code = 0; ASSetPropFlags(com.newgrounds.APIError.prototype, null, 1); } #endinitclip } movieClip 19 __Packages.com.newgrounds.API { #initclip if (!_global.com) { _global.com = new Object(); } if (!_global.com.newgrounds) { _global.com.newgrounds = new Object(); } if (!_global.com.newgrounds.API) { var v1 = function () {}; com.newgrounds.API = v1; var v2 = v1.prototype; v1.setVersion = function (v) { com.newgrounds.API.version = v; }; v1.setUserEmail = function (e) { com.newgrounds.API.user_email = e; }; v1.setFakeSession = function (fake) { com.newgrounds.API.fake_session = fake; }; v1.setPreload = function (p) { com.newgrounds.API.preload = p; }; v1.getPercentLoaded = function () { var v2; if (com.newgrounds.API.preload && com.newgrounds.API.preload_items > 0) { v2 = 80; var v4 = Math.round((com.newgrounds.API.preload_items_loaded / com.newgrounds.API.preload_items) * 20); var v3 = Math.round((_root.getBytesLoaded() / _root.getBytesTotal()) * v2) + v4; return v3; } v2 = 100; v3 = Math.round((_root.getBytesLoaded() / _root.getBytesTotal()) * v2); return v3; }; v1.reportNewAsset = function () { if (com.newgrounds.API.preload) { ++com.newgrounds.API.preload_items; } }; v1.reportAssetLoaded = function () { if (com.newgrounds.API.preload) { ++com.newgrounds.API.preload_items_loaded; } }; v1.populateMedals = function (medal_list) { if (com.newgrounds.API.medals === null) { com.newgrounds.API.medals = new Array(); var v2 = 0; while (v2 < medal_list.length) { var v1 = medal_list[v2]; com.newgrounds.API.medals.push(new com.newgrounds.Medal(v1.medal_id, v1.medal_name, v1.medal_value, v1.medal_difficulty, v1.medal_unlocked, v1.medal_icon)); ++v2; } } }; v1.populateSaveGroups = function (save_group_list, file_path, image_path) { com.newgrounds.SaveFile.setFilePath(file_path); com.newgrounds.SaveFile.setImagePath(image_path); com.newgrounds.API.save_groups = new Array(); var v6 = 0; while (v6 < save_group_list.length) { var v2 = save_group_list[v6]; var v5 = new com.newgrounds.SaveGroup(v2.group_id, v2.group_name, v2.group_type); var v4 = 0; while (v4 < v2.keys.length) { var v3 = v2.keys[v4]; v5.addKey(v3.id, v3.name, v3.type); ++v4; } v4 = 0; while (v4 < v2.ratings.length) { var v1 = v2.ratings[v4]; v5.addRating(v1.id, v1.name, v1.min, v1.max, v1.float); ++v4; } com.newgrounds.API.save_groups.push(v5); ++v6; } }; v1.populateScoreBoards = function (score_boards) { com.newgrounds.API.scoreboards = new Array(); var v1 = 0; while (v1 < score_boards.length) { com.newgrounds.API.scoreboards.push(new com.newgrounds.ScoreBoard(score_boards[v1].id, score_boards[v1].name)); ++v1; } }; v1.getOfficialURL = function () { var v1 = com.newgrounds.API.GATEWAY_URL + '?tracker_id=' + com.newgrounds.API.movie_id + '&command_id=loadOfficalVersion&seed=' + Math.random(); if (com.newgrounds.API.debug) { v1 += '&debug=1'; } return v1; }; v1.loadOfficialURL = function () { getURL(com.newgrounds.API.getOfficialURL(), '_blank'); }; v1.hasUserSession = function () { if (com.newgrounds.API.session_id && com.newgrounds.API.publisher_id) { return true; return false; } if (_root.NewgroundsAPI_PublisherID && _root.NewgroundsAPI_SessionID) { return true; } return false; }; v1.hostIsCompatible = function () { return _root.NewgroundsAPI_PublisherID !== undefined; }; v1.isNewgrounds = function () { return com.newgrounds.API.publisher_id == 1 || _root.NewgroundsAPI_PublisherID == 1 || ((com.newgrounds.API.getHost()).toLowerCase()).indexOf('ungrounded.net') > -1 || ((com.newgrounds.API.getHost()).toLowerCase()).indexOf('newgrounds.com') > -1; }; v1.hasPublisher = function () { return com.newgrounds.API.publisher_id || _root.NewgroundsAPI_PublisherID; }; v1.hasUserEmail = function () { if (com.newgrounds.API.user_email) { return true; } return false; }; v1.isConnected = function () { return com.newgrounds.API.connected; }; v1.getID = function () { return com.newgrounds.API.getTrackerID(); }; v1.getTrackerID = function () { return com.newgrounds.API.tracker_id; }; v1.getUserID = function () { return com.newgrounds.API.user_id; }; v1.getUserName = function () { return com.newgrounds.API.user_name; }; v1.connectionTimeOut = function () { com.newgrounds.API.reportAssetLoaded(); clearInterval(com.newgrounds.API.timeout); com.newgrounds.API.callListener(com.newgrounds.APIEvent.API_CONNECTED, false, new com.newgrounds.APIError('CONNECTION_FAILED', 'Connection to API gateway timed out.')); }; v1.connect = function (m_id, encrypt_key, debug_mode) { if (com.newgrounds.API.connected) { return undefined; } com.newgrounds.API.sendMessage('Connecting to the Newgrounds API Gateway...'); var v2 = function () { com.newgrounds.API.connectionTimeOut(); }; com.newgrounds.API.timeout = setInterval(v2, 10000, null); if (!m_id) { com.newgrounds.API.fatalError('API.connect() - missing required movie_id parameter', 'connect'); } com.newgrounds.API.movie_id = String(m_id); com.newgrounds.API.tracker_id = Number(com.newgrounds.API.movie_id.substring(0, com.newgrounds.API.movie_id.indexOf(':'))); com.newgrounds.API.encryption_key = encrypt_key; com.newgrounds.API.debug = debug_mode; com.newgrounds.API.user_id = 0; com.newgrounds.API.user_name = 'Guest'; if (_root.NewgroundsAPI_PublisherID) { com.newgrounds.API.publisher_id = _root.NewgroundsAPI_PublisherID; if (_root.NewgroundsAPI_SessionID) { com.newgrounds.API.session_id = _root.NewgroundsAPI_SessionID; } } else { if (com.newgrounds.API.fake_session) { com.newgrounds.API.publisher_id = 1; com.newgrounds.API.session_id = 'D3bu64p1U53R'; com.newgrounds.API.user_id = 10; com.newgrounds.API.user_name = 'API-Debugger'; } else { if (com.newgrounds.API.debug) { com.newgrounds.API.publisher_id = 1; } com.newgrounds.API.session_id = null; } } if (_root.NewgroundsAPI_UserName) { com.newgrounds.API.user_name = _root.NewgroundsAPI_UserName; } if (_root.NewgroundsAPI_UserID) { com.newgrounds.API.user_id = _root.NewgroundsAPI_UserID; } if (_root.NewgroundsAPI_UserpageFormat) { com.newgrounds.API.userpage_format = _root.NewgroundsAPI_UserpageFormat; } com.newgrounds.API.reportNewAsset(); com.newgrounds.API.connected = true; com.newgrounds.API.sendCommand('connectMovie', {'host': com.newgrounds.API.getHost(), 'movie_version': com.newgrounds.API.version}); }; v1.getHost = function () { if (!com.newgrounds.API.host) { var v1 = _url; if ((v1.toLowerCase()).indexOf('http://') > -1 or (v1.toLowerCase()).indexOf('https://') > -1) { if ((v1.toLowerCase()).indexOf(com.newgrounds.API.NEWGROUNDS_PREVIEW) > -1) { com.newgrounds.API.host = com.newgrounds.API.NEWGROUNDS_PREVIEW; } else { com.newgrounds.API.host = (v1.split('/'))[2].toLowerCase(); } return com.newgrounds.API.host; } com.newgrounds.API.host = com.newgrounds.API.LOCAL_HOST; } return com.newgrounds.API.host; }; v1.isPublishedHost = function () { for (var v1 in com.newgrounds.API.PREVIEW_HOSTS) { if (com.newgrounds.API.getHost() == com.newgrounds.API.PREVIEW_HOSTS[v1]) { return false; } } return true; }; v1.loadUserPage = function (u_id, u_name) { if (u_id == undefined && u_name == undefined) { if (com.newgrounds.API.hasUserSession()) { u_id = com.newgrounds.API.user_id; u_name = com.newgrounds.API.user_name; } else { return false; } } if (com.newgrounds.API.publisher_id == 1) { var v1 = 'http://' + com.newgrounds.API.user_name.toLowerCase() + '.newgrounds.com'; getURL(v1, '_blank'); return true; return false; } if (com.newgrounds.API.userpage_format) { v1 = com.newgrounds.API.userpage_format; v1 = (v1.split(':user_id:')).join(u_id.toString()); v1 = (v1.split(':user_name:')).join(escape(u_name)); getURL(v1, '_blank'); return true; } return false; }; v1.loadNewgrounds = function () { com.newgrounds.API.sendCommand('loadNewgrounds', {'host': com.newgrounds.API.getHost()}, true); }; v1.loadMySite = function () { com.newgrounds.API.sendCommand('loadMySite', {'host': com.newgrounds.API.getHost()}, true); }; v1.loadCustomLink = function (link) { com.newgrounds.API.sendCommand('loadCustomLink', {'host': com.newgrounds.API.getHost(), 'link': link}, true); }; v1.logCustomEvent = function (event) { com.newgrounds.API.sendCommand('logCustomEvent', {'host': com.newgrounds.API.getHost(), 'event': event}); }; v1.getScoreBoard = function (board) { if (!com.newgrounds.API.scoreboards || com.newgrounds.API.scoreboards.length < 1) { com.newgrounds.API.sendWarning('You do not have any scoreboards configured in your API setup.'); return null; } for (var v2 in com.newgrounds.API.scoreboards) { if (typeof board == 'string' && com.newgrounds.API.scoreboards[v2].name == board) { return com.newgrounds.API.scoreboards[v2]; } else { if (typeof board == 'number' && com.newgrounds.API.scoreboards[v2].id == board) { return com.newgrounds.API.scoreboards[v2]; } } } com.newgrounds.API.sendWarning('Could not find any scoreboards named \'' + board + '\'.'); return null; }; v1.postScore = function (board_name, value, tag) { var v3 = com.newgrounds.API.getScoreBoard(board_name); if (tag === undefined) { tag = ''; } if (!v3) { com.newgrounds.API.sendError({'command_id': 'postScore'}, new com.newgrounds.APIError('INVALID_SCOREBOARD', 'Failed to post score. Check the spelling of your board name.')); return undefined; } if (value == undefined) { com.newgrounds.API.sendError({'command_id': 'postScore'}, new com.newgrounds.APIError('MISSING_PARAM', 'Missing score value')); return undefined; } com.newgrounds.API.sendSecureCommand('postScore', {'user_name': com.newgrounds.API.user_name, 'board': v3.id, 'value': value, 'tag': tag, 'publisher_id': com.newgrounds.API.publisher_id}); }; v1.loadScores = function (board_name, period, tag) { var v3 = 'loadScores'; var v2 = com.newgrounds.API.getScoreBoard(board_name); if (!v2) { com.newgrounds.API.sendError({'command_id': v3}, new com.newgrounds.APIError('INVALID_SCOREBOARD', 'Failed to load scores. Check the spelling of your board name.')); return undefined; } var v1 = {}; v1.publisher_id = com.newgrounds.API.publisher_id; v1.board = v2.id; v1.num_results = v2.num_results; v1.page = v2.page; if (period === undefined) { v1.period = v2.period; } else { v1.period = period; } if (tag === undefined) { v1.tag = v2.tag; } else { v1.tag = tag; } com.newgrounds.API.sendCommand(v3, v1); }; v1.unlockMedal = function (medal, x, y) { if (!medal) { com.newgrounds.API.sendError({'command_id': 'unlockMedal'}, new com.newgrounds.APIError('MISSING_PARAM', 'missing required medal name')); return undefined; } if (typeof medal != 'object') { medal = com.newgrounds.API.getMedal(medal); } if (!medal) { com.newgrounds.API.sendError({'command_id': 'unlockMedal'}, new com.newgrounds.APIError('INVALID_MEDAL', 'medal unlock failed, check your medal name for correct spelling.')); return undefined; } com.newgrounds.API.callListener(com.newgrounds.APIEvent.UNLOCK_MEDAL, true, {'medal': medal, 'x': x, 'y': y}); if (com.newgrounds.API.hasUserSession() or com.newgrounds.API.debug) { com.newgrounds.API.sendMessage('Attempting to unlock \'' + medal.getName() + '\''); var v3 = new Object(); v3.medal_id = medal.getID(); com.newgrounds.API.sendSecureCommand('unlockMedal', v3); } else { com.newgrounds.API.sendMessage('Unlocking \'' + medal.getName() + '\''); medal.setUnlocked(true); var v2 = com.newgrounds.API.loadLocal('medals_unlocked'); if (!v2) { v2 = new Object(); } v2[medal.getID()] = true; com.newgrounds.API.saveLocal('medals_unlocked', v2); } }; v1.loadMedals = function () { if (com.newgrounds.API.medals) { com.newgrounds.API.callListener(com.newgrounds.APIEvent.MEDALS_LOADED, true, {'medals': com.newgrounds.API.medals}); return undefined; } var v1 = new Object(); if (com.newgrounds.API.hasUserSession()) { v1.publisher_id = com.newgrounds.API.publisher_id; v1.user_id = com.newgrounds.API.user_id; } com.newgrounds.API.sendCommand('getMedals', v1); }; v1.getMedals = function () { return com.newgrounds.API.medals; }; v1.getMedal = function (identifier) { if (!com.newgrounds.API.medals || com.newgrounds.API.medals.length < 1) { com.newgrounds.API.sendWarning('You do not have any medals configured on your API setup!'); return false; } for (var v3 in com.newgrounds.API.medals) { var v1 = com.newgrounds.API.medals[v3]; if (typeof identifier == 'string' && v1.getName() == identifier) { return v1; } else { if (v1.getID() == identifier) { return v1; } } } com.newgrounds.API.sendWarning('Could not find any medals named \'' + identifier + '\'.'); return false; }; v1.saveLocal = function (save_id, save_data, size_allocation) { if (!com.newgrounds.API.sharedObjects[save_id]) { com.newgrounds.API.sharedObjects[save_id] = SharedObject.getLocal('ng_ap_secure_' + com.newgrounds.API.movie_id + '_' + save_id); } com.newgrounds.API.sharedObjects[save_id].data[save_id] = com.newgrounds.API.encodeData(save_data); com.newgrounds.API.sharedObjects[save_id].flush(); }; v1.loadLocal = function (save_id) { if (!com.newgrounds.API.sharedObjects[save_id]) { com.newgrounds.API.sharedObjects[save_id] = SharedObject.getLocal('ng_ap_secure_' + com.newgrounds.API.movie_id + '_' + save_id); } com.newgrounds.API.sharedObjects[save_id].flush(); com.newgrounds.API.echo('sharedobject ' + save_id + ' is: ' + com.newgrounds.API.sharedObjects[save_id].data[save_id]); if (com.newgrounds.API.sharedObjects[save_id].data[save_id]) { com.newgrounds.API.echo('decoded: ' + com.newgrounds.API.decodeData(com.newgrounds.API.sharedObjects[save_id].data[save_id])); return com.newgrounds.API.decodeData(com.newgrounds.API.sharedObjects[save_id].data[save_id]); } else { return null; } }; v1.encodeData = function (data) { return com.newgrounds.API.compressHex(com.newgrounds.encoders.RC4.encrypt(com.newgrounds.encoders.JSON.encode(data), com.newgrounds.API.encryption_key)); }; v1.decodeData = function (base) { return com.newgrounds.encoders.JSON.decode(com.newgrounds.encoders.RC4.decrypt(com.newgrounds.API.uncompressHex(base), com.newgrounds.API.encryption_key)); }; v1.compressHex = function (hex_value) { var v6 = hex_value.length % 6; var v4 = ''; var v5 = new com.newgrounds.encoders.BaseN(com.newgrounds.API.compression_radix); var v1 = 0; while (v1 < hex_value.length) { var v2 = Number('0x' + hex_value.substr(v1, 6)); v4 += v5.encode(v2, 4); v1 += 6; } return v6 + v4; }; v1.uncompressHex = function (base_value) { var v9 = Number(base_value.charAt(0)); var v7 = ''; var v3; var v8 = new com.newgrounds.encoders.BaseN(com.newgrounds.API.compression_radix); var v2 = 1; while (v2 < base_value.length) { var v6 = base_value.substr(v2, 4); var v5 = v8.decode(v6); var v1 = com.newgrounds.API.dec2hex(v5); if (v2 + 4 < base_value.length) { v3 = 6; } else { v3 = v9; } while (v1.length < v3) { v1 = '0' + v1; } v7 += v1; v2 += 4; } return v7; }; v1.dec2hex = function (dec) { var v4 = '0123456789ABCDEF'; var v3 = ''; while (dec > 0) { var v2 = dec % 16; v3 = v4.charAt(v2) + v3; dec = (dec - v2) / 16; } return v3; }; v1.getSaveGroup = function (group) { if (com.newgrounds.API.save_groups == null || com.newgrounds.API.save_groups.length < 1) { com.newgrounds.API.sendWarning('You do not have any save groups configured in your API setup!'); return null; } var v1 = 0; while (v1 <= com.newgrounds.API.save_groups.length) { if (typeof group == 'number' or (Number(group)).toString() == String(group)) { if (com.newgrounds.API.save_groups[v1].getID() == Number(group)) { return com.newgrounds.API.save_groups[v1]; } } else { if (typeof group == 'string') { if ((com.newgrounds.API.save_groups[v1].getName()).toLowerCase() == group.toLowerCase()) { return com.newgrounds.API.save_groups[v1]; } } } ++v1; } com.newgrounds.API.sendWarning('Could not find any save groups named \'' + group + '\'.'); return null; }; v1.getCurrentSaveFile = function () { return com.newgrounds.API.save_file; }; v1.setCurrentSaveFile = function (current) { com.newgrounds.API.save_file = current; }; v1.loadSaveFile = function (save_id, get_contents) { if (get_contents === undefined) { get_contents = true; } var v1 = 'loadSaveFile'; var v2 = {'publisher_id': com.newgrounds.API.publisher_id, 'save_id': save_id, 'get_contents': get_contents}; com.newgrounds.API.save_file = null; com.newgrounds.API.sendCommand(v1, v2); }; v1.loadFilesByDate = function (group_name, sort_descending, key_name, key_value) { if (sort_descending === undefined) { sort_descending = true; } var v2 = com.newgrounds.API.getSaveGroup(group_name); if (!v2) { var v3 = new com.newgrounds.APIError('QUERY_INCOMPLETE', 'The query could not be preformed, check the spelling of your save group name.'); com.newgrounds.API.sendError({'command_id': 'loadFilesByDate'}, v3); return undefined; } var v1 = new com.newgrounds.SaveGroupQuery(v2); if (key_name) { v1.addKeyCondition(key_name, '=', key_value); } v1.sortOn('CREATED_ON', sort_descending ? 'DESC' : 'ASC'); v1.execute(); }; v1.loadFilesByViews = function (group_name, sort_descending, key_name, key_value) { if (sort_descending === undefined) { sort_descending = true; } var v2 = com.newgrounds.API.getSaveGroup(group_name); if (!v2) { var v3 = new com.newgrounds.APIError('QUERY_INCOMPLETE', 'The query could not be preformed, check the spelling of your save group name.'); com.newgrounds.API.sendError({'command_id': 'loadFilesByViews'}, v3); return undefined; } var v1 = new com.newgrounds.SaveGroupQuery(v2); if (key_name) { v1.addKeyCondition(key_name, '=', key_value); } v1.sortOn('TOTAL_VIEWS', sort_descending ? 'DESC' : 'ASC'); v1.execute(); }; v1.loadFilesByRating = function (group_name, rating_name, sort_descending, key_name, key_value) { if (sort_descending === undefined) { sort_descending = true; } var v2 = com.newgrounds.API.getSaveGroup(group_name); if (!v2) { var v3 = new com.newgrounds.APIError('QUERY_INCOMPLETE', 'The query could not be preformed, check the spelling of your save group name.'); com.newgrounds.API.sendError({'command_id': 'loadFilesByRating'}, v3); return undefined; } var v1 = new com.newgrounds.SaveGroupQuery(v2); if (key_name) { v1.addKeyCondition(key_name, '=', key_value); } v1.sortOnRating(rating_name, sort_descending ? 'DESC' : 'ASC', 'score'); v1.execute(); }; v1.lookupSaveFiles = function (save_group) { var v1 = 'lookupSaveFiles'; var v2 = {'publisher_id': com.newgrounds.API.publisher_id, 'group_id': save_group.getID(), 'query': com.newgrounds.encoders.JSON.encode(save_group.getQuery(true))}; com.newgrounds.API.sendCommand(v1, v2); }; v1.newSaveFile = function (group) { var v1 = com.newgrounds.API.getSaveGroup(group); if (v1) { return v1.newFile(); } else { var v2 = new com.newgrounds.APIError('INVALID_SAVE_GROUP', 'You can not create new files in invalid groups.'); com.newgrounds.API.sendError({'command_id': 'newSaveFile'}, v2); } }; v1.newSaveQuery = function (group) { var v1 = com.newgrounds.API.getSaveGroup(group); if (v1) { return v1.newQuery(); } else { var v2 = new com.newgrounds.APIError('INVALID_SAVE_GROUP', '\'' + group + '\' is not a valid save group.'); com.newgrounds.API.sendError({'command_id': 'newSaveQuery'}, v2); } }; v1.checkFilePrivs = function (file) { if (com.newgrounds.API.user_id) { var v1 = com.newgrounds.API.user_id; } else { var v1 = 0; } var v2 = {'group': (file.getGroup()).getID(), 'filename': file.getName(), 'user_id': v1, 'publisher_id': com.newgrounds.API.publisher_id}; com.newgrounds.API.sendCommand('checkFilePrivs', v2); }; v1.saveFile = function (file, overwrite) { var v1; v1 = {'group': (file.getGroup()).getID(), 'filename': file.getName(), 'description': file.getDescription(), 'draft': file.__get__draft(), 'user_name': com.newgrounds.API.user_name}; if (overwrite) { v1.overwrite = overwrite; } if (file.getDuplicateID()) { v1.save_id = file.getDuplicateID(); } if ((file.getKeys()).length > 0) { v1.keys = file.getKeys(); } var v3; v3 = {'file': file.getRawContents()}; if (file.getThumbnailImageScan()) { v3.thumbnail = file.getThumbnailImageScan(); } com.newgrounds.API.save_file = file; com.newgrounds.API.sendSecureCommand('saveFile', v1, null, v3); }; v1.rateSaveFile = function (file, rating, vote) { var v1 = {'group': (file.getGroup()).getID(), 'save_id': file.getID(), 'rating_id': rating.rating_id, 'vote': vote, 'user_id': com.newgrounds.API.user_id}; com.newgrounds.API.sendSecureCommand('rateSaveFile', v1); }; v1.getConfirmation = function (command_name, event, msg, target, confirm, cancel) { var v1 = new com.newgrounds.APIError('CONFIRM_REQUEST', msg); v1.confirm = function () { target[confirm](); }; v1.cancel = function () { target[cancel](); }; v1.command = command_name; com.newgrounds.API.callListener(event, false, v1); }; v1.onRemoteAuthentication = function (auth_result) { var v1 = com.newgrounds.encoders.JSON.decode(com.newgrounds.encoders.RC4.decrypt(auth_result, com.newgrounds.API.encryption_key)); delete com.newgrounds.API.remote_auth; com.newgrounds.API.user_id = v1.NewgroundsAPI_UserID; com.newgrounds.API.user_name = v1.NewgroundsAPI_UserName; com.newgrounds.API.session_id = v1.NewgroundsAPI_SessionID; com.newgrounds.API.publisher_id = v1.NewgroundsAPI_PublisherID; }; v1.doEvent = function (e) { switch (e.command_id) { case 'connectMovie': clearInterval(com.newgrounds.API.timeout); com.newgrounds.API.sendMessage('You have successfully connected to the Newgrounds API Gateway'); com.newgrounds.API.sendMessage('Movie identified as "' + e.movie_name + '"'); com.newgrounds.API.callListener(com.newgrounds.APIEvent.API_CONNECTED, e.success, {'title': e.movie_name}); var v7 = false; if (e.ad_status === -1) { var v11 = 'This movie was not approved to run Flash Ads.'; com.newgrounds.API.sendWarning(v11); com.newgrounds.API.sendWarning('visit ' + com.newgrounds.API.AD_TERMS_URL + ' to view our approval guidelines'); if (!e.ad_url) { com.newgrounds.API.callListener(com.newgrounds.APIEvent.ADS_APPROVED, false, new com.newgrounds.APIError('FLASH_ADS_NOT_APPROVED', v11)); } else { v7 = true; } } else { if (e.ad_status === 0) { var v11 = 'Flash Ads are currently awaiting approval.'; com.newgrounds.API.sendNotice(v11); if (!e.ad_url) { com.newgrounds.API.callListener(com.newgrounds.APIEvent.ADS_APPROVED, false, new com.newgrounds.APIError('FLASH_ADS_NOT_APPROVED', v11)); } else { v7 = true; } } } if (e.ad_url) { com.newgrounds.API.ad_url = unescape(e.ad_url); if (!v7) { com.newgrounds.API.sendMessage('This movie has been approved to run Flash Ads!'); } com.newgrounds.API.callListener(com.newgrounds.APIEvent.ADS_APPROVED, true); } if (e.deny_host) { v11 = com.newgrounds.API.getHost() + ' does not have permission to run this movie!'; com.newgrounds.API.sendWarning(v11); com.newgrounds.API.sendWarning('\tUpdate your API configuration to unblock ' + com.newgrounds.API.getHost()); com.newgrounds.API.callListener(com.newgrounds.APIEvent.HOST_BLOCKED, true, {'real_url': unescape(e.movie_url), 'url': com.newgrounds.API.getOfficialURL()}); } else { if (e.movie_version) { com.newgrounds.API.sendWarning('According to your API Configuration, this version is out of date.'); if (com.newgrounds.API.version) { com.newgrounds.API.sendWarning('\tThe this movie is version ' + com.newgrounds.API.version); } com.newgrounds.API.sendWarning('\tThe most current version is ' + e.movie_version); com.newgrounds.API.callListener(com.newgrounds.APIEvent.NEW_VERSION_AVAILABLE, true, {'version': e.movie_version, 'real_url': unescape(e.movie_url), 'url': com.newgrounds.API.getOfficialURL()}); } } if (e.request_portal_url) { com.newgrounds.API.sendCommand('setPortalID', {'portal_url': _url}); } if (com.newgrounds.API.preload) { com.newgrounds.API.reportNewAsset(); var v8 = {}; if (com.newgrounds.API.hasUserSession()) { v8.publisher_id = com.newgrounds.API.publisher_id; v8.user_id = com.newgrounds.API.user_id; } com.newgrounds.API.sendCommand('preloadSettings', v8); } com.newgrounds.API.reportAssetLoaded(); break; case 'preloadSettings': if (e.medals) { com.newgrounds.API.populateMedals(e.medals); if (!com.newgrounds.API.hasUserSession() and !com.newgrounds.API.debug) { com.newgrounds.API.echo('checking for sharedobject medals...'); var v4 = com.newgrounds.API.loadLocal('medals_unlocked'); if (v4) { for (var v32 in v4) { v32 = Number(v32); if (v4[v32]) { var v3 = com.newgrounds.API.getMedal(v32); com.newgrounds.API.echo('now unlocking ' + v3.getName()); v3.setUnlocked(true); } } } } } if (e.save_groups) { com.newgrounds.API.populateSaveGroups(e.save_groups, e.save_file_path); } if (e.score_boards) { com.newgrounds.API.populateScoreBoards(e.score_boards); } if (_root.NewgroundsAPI_SaveFileID && _root.NewgroundsAPI_SaveGroupID) { com.newgrounds.API.callListener(com.newgrounds.APIEvent.FILE_REQUESTED, true, {'save_id': _root.NewgroundsAPI_SaveFileID, 'group': com.newgrounds.API.getSaveGroup(_root.NewgroundsAPI_SaveGroupID)}); } com.newgrounds.API.callListener(com.newgrounds.APIEvent.METADATA_LOADED, true); com.newgrounds.API.reportAssetLoaded(); break; case 'logCustomEvent': if (e.success) { com.newgrounds.API.sendMessage('Event \'' + e.event + '\' was logged.'); } com.newgrounds.API.callListener(com.newgrounds.APIEvent.EVENT_LOGGED, e.success, {'event': e.event}); break; case 'postScore': var v9; if (e.success) { var v5 = 'User'; if (com.newgrounds.API.user_email) { v5 = com.newgrounds.API.user_email; } else { if (com.newgrounds.API.user_name) { v5 = com.newgrounds.API.user_name; } } var v19 = com.newgrounds.API.getScoreBoard(e.board); com.newgrounds.API.sendMessage(v5 + ' posted ' + e.value + ' to \'' + v19.name + '\''); v9 = {'board': v19, 'value': e.value, 'username': v5}; } com.newgrounds.API.callListener(com.newgrounds.APIEvent.SCORE_POSTED, e.success, v9); break; case 'loadScores': var v9 = new Object(); var v19 = com.newgrounds.API.getScoreBoard(e.board); if (v19.exists()) { v19.setScores(e.scores, e.period, e.page, e.num_results); } com.newgrounds.API.callListener(com.newgrounds.APIEvent.SCORES_LOADED, e.success, {'board': v19}); break; case 'unlockMedal': var v24 = com.newgrounds.API.getMedal(e.medal_name); v24.setUnlocked(true); com.newgrounds.API.sendMessage('Successfuly unlocked \'' + v24.getName() + '\''); com.newgrounds.API.callListener(com.newgrounds.APIEvent.MEDAL_UNLOCKED, e.success, {'medal_id': v24.id, 'medal': v24}); break; case 'getMedals': com.newgrounds.API.populateMedals(e.medals); com.newgrounds.API.callListener(com.newgrounds.APIEvent.MEDALS_LOADED, e.success, {'medals': com.newgrounds.API.medals}); break; case 'loadSaveFile': var v16 = com.newgrounds.API.getSaveGroup(e.group_id); var v14 = new com.newgrounds.SaveFile(v16); v14.id = e.file.save_id; v14.name = e.file.filename; v14.fileUrl = e.file.file; v14.thumbnailUrl = e.file.thumb; v14.authorName = e.file.user_name; v14.authorId = e.file.user_id; v14.description = e.file.description; v14.setPermissions(e.file.status, e.file.locked); for (var v6 in e.file.keys) { v14.setKey(e.file.keys[v6].id, e.file.keys[v6].value); } for (v6 in e.file.ratings) { v14.setRating(e.file.ratings[v6].id, e.file.ratings[v6].votes, e.file.ratings[v6].score); } if (e.get_contents) { v14.loadContents(); } com.newgrounds.API.callListener(com.newgrounds.APIEvent.FILE_INITIALIZED, e.success, {'save_id': v14.id, 'file': v14}); com.newgrounds.API.save_file = v14; break; case 'lookupSaveFiles': var v12 = (com.newgrounds.API.getSaveGroup(e.group_id)).getQuery(); v12.onExecuted(e.files); break; case 'rateSaveFile': var v16 = com.newgrounds.API.getSaveGroup(e.group_id); var v14 = v16.getFile(e.save_id); if (e.already_voted) { var v27 = new com.newgrounds.APIError('PERMISSION_DENIED', 'You have already voted on this item today'); com.newgrounds.API.callListener(com.newgrounds.APIEvent.VOTE_COMPLETE, false, {'error': v27, 'file': v14, 'save_id': v14.id}); return undefined; } else { if (e.success) { var v10 = v14.onVoted(e); com.newgrounds.API.callListener(com.newgrounds.APIEvent.VOTE_COMPLETE, e.success, {'rating': v10, 'file': v14, 'save_id': v14.id}); } else { com.newgrounds.API.callListener(com.newgrounds.APIEvent.VOTE_COMPLETE, e.success, {'file': v14, 'save_id': v14.id}); com.newgrounds.API.sendError('Your vote was not accepted.'); } } break; case 'saveFile': if (com.newgrounds.API.save_file) { if (!com.newgrounds.API.save_file.exists()) { com.newgrounds.API.save_file.setID(e.save_id, true); } com.newgrounds.API.save_file.onSaved(e); com.newgrounds.API.callListener(com.newgrounds.APIEvent.FILE_SAVED, e.success, {'save_id': com.newgrounds.API.save_file.__get__id(), 'file': com.newgrounds.API.save_file}); if (e.success) { com.newgrounds.API.sendMessage('You just saved a new file (id #' + e.save_id + ') to the \'' + (com.newgrounds.API.save_file.__get__group()).__get__name() + '\' save group.'); } } com.newgrounds.API.save_file = null; break; case 'checkFilePrivs': var v9 = {'file': com.newgrounds.API.save_file, 'filename': e.filename, 'group': e.group, 'exists': e.exists, 'can_write': e.can_write}; if (e.duplicate_id) { v9.duplicate_id = e.duplicate_id; } if (!e.success) { com.newgrounds.API.sendWarning('You do not have permission to save this file!'); } com.newgrounds.API.callListener(com.newgrounds.APIEvent.FILE_PRIVS_LOADED, e.success, v9); } }; v1.getDispatcher = function () { if (!com.newgrounds.API.eventDispatcher) { com.newgrounds.API.eventDispatcher = new com.newgrounds.APIEventDispatcher(); } return com.newgrounds.API.eventDispatcher; }; v1.hasEventListener = function (event) { return (com.newgrounds.API.getDispatcher()).hasEventListener(event); }; v1.addEventListener = function (event, listener, target) { com.newgrounds.API.echo('Adding a listener for \'' + event + '\''); (com.newgrounds.API.getDispatcher()).addEventListener(event, listener, target); }; v1.removeEventListener = function (event, target) { (com.newgrounds.API.getDispatcher()).removeEventListener(event, target); }; v1.callListener = function (event, success, data, target) { com.newgrounds.API.echo('Fired Event: ' + event); var v2 = new com.newgrounds.APIEvent(event, success, data); (com.newgrounds.API.getDispatcher()).dispatchEvent(v2); if (event == com.newgrounds.APIEvent.API_CONNECTED && !success) { com.newgrounds.API.connected = false; } com.newgrounds.API.bridge.sendEvent(event, {'success': success, 'data': data}); }; v1.sendError = function (c, e) { switch (c.command_id) { case 'connectMovie': clearInterval(com.newgrounds.API.timeout); com.newgrounds.API.callListener(com.newgrounds.APIEvent.API_CONNECTED, false, {'error': e, 'response': c}); break; case 'saveFile': com.newgrounds.API.callListener(com.newgrounds.APIEvent.FILE_SAVED, false, {'error': e, 'file': com.newgrounds.API.save_file, 'response': c}); com.newgrounds.API.save_file = null; } var v3 = '[Newgrounds API ERROR] :: ' + c.command_id + '() - ' + e.name + ':' + '\n' + '\t\t\t\t' + e.message; trace(v3); com.newgrounds.API.bridge.sendEvent('trace', {'data': v3}); }; v1.sendWarning = function (m, c) { if (c) { m += '\r[Newgrounds API WARNING] :: \tSee ' + com.newgrounds.API.COMMANDS_WIKI_URL + c.toLowerCase() + ' for additional information.'; } var v1 = '[Newgrounds API WARNING] :: ' + m; trace(v1); com.newgrounds.API.bridge.sendEvent('trace', {'data': v1}); }; v1.sendNotice = function (m, c) { if (c) { m += '\r[Newgrounds API NOTICE] :: \tSee ' + com.newgrounds.API.COMMANDS_WIKI_URL + c.toLowerCase() + ' for additional information.'; } trace('[Newgrounds API NOTICE] :: ' + m); }; v1.fatalError = function (m, c) { if (c) { m += '\r\tSee ' + com.newgrounds.API.COMMANDS_WIKI_URL + c.toLowerCase() + ' for additional information.'; } throw '***ERROR*** frame=' + _root._currentframe + ', class=API' + '\n' + '\n' + m; }; v1.openLoginPage = function () { if (com.newgrounds.API.hasUserSession()) { return undefined; } if (!com.newgrounds.API.remote_auth) { var v1 = com.newgrounds.encoders.MD5.calculate(Math.random() + 'a' + com.newgrounds.API.movie_id); v1 = 'POOPYPANTS'; com.newgrounds.API.remote_auth = new com.newgrounds.RemoteAuth(v1); } var v2 = com.newgrounds.encoders.RC4.encrypt(com.newgrounds.API.remote_auth.__get__token(), com.newgrounds.API.encryption_key); trace(v2); getURL(com.newgrounds.API.LOGIN_URL + '?api_auth_id=' + com.newgrounds.API.movie_id + '&api_auth_key=' + v2, '_blank'); }; v1.sendSecureCommand = function (command, secure_params, unsecure_params, files) { if (!com.newgrounds.API.debug && !com.newgrounds.API.hasUserSession() && !com.newgrounds.API.hasUserEmail()) { com.newgrounds.API.sendError({'command_id': command}, new com.newgrounds.APIError('IDENTIFICATION_REQUIRED', 'You must be logged in, or provide an e-mail address using \'API.setUserEmail("name@domain.com");\' to use ' + command + '().')); return undefined; } if (!command) { com.newgrounds.API.fatalError('Missing command', 'sendSecureCommand'); } if (!secure_params) { com.newgrounds.API.fatalError('Missing secure_params', 'sendSecureCommand'); } if (!unsecure_params) { unsecure_params = new Object(); } var v2 = ''; var v1 = 0; while (v1 < 16) { v2 += com.newgrounds.API.compression_radix.charAt(Math.floor(Math.random() * com.newgrounds.API.compression_radix.length)); ++v1; } if (com.newgrounds.API.debug && !com.newgrounds.API.fake_session && !com.newgrounds.API.session_id) { secure_params.session_id = ''; } else { secure_params.session_id = com.newgrounds.API.session_id; } secure_params.as_version = 2; secure_params.user_email = com.newgrounds.API.user_email; secure_params.publisher_id = com.newgrounds.API.publisher_id; secure_params.seed = v2; secure_params.command_id = command; var v6 = com.newgrounds.encoders.JSON.encode(secure_params); trace('JSON: ' + v6 + '\n'); var v9 = com.newgrounds.encoders.MD5.calculate(v2); var v7 = com.newgrounds.encoders.RC4.encrypt(v6, com.newgrounds.API.encryption_key); var v8 = v9 + v7; unsecure_params.secure = com.newgrounds.API.compressHex(v8); com.newgrounds.API.sendCommand('securePacket', unsecure_params, false, files); }; v1.sendCommand = function (command, params, open_browser, files) { if (!com.newgrounds.API.connected and command != 'connectMovie') { var v12 = 'API.' + command + '() - API.connect() must be called before this command can be called' + '\n'; com.newgrounds.API.fatalError(v12, 'connect'); } if (open_browser) { var v2 = new Object(); } else { var v2 = new LoadVars(); } v2.command_id = command; v2.tracker_id = com.newgrounds.API.movie_id; if (com.newgrounds.API.debug) { v2.debug = com.newgrounds.API.debug; } if (params) { for (var v9 in params) { v2[v9] = params[v9]; } } if (files) { for (v9 in files) { v2[v9] = files[v9]; } } if (open_browser) { var v6 = com.newgrounds.API.GATEWAY_URL + '?seed=' + Math.random(); for (v9 in v2) { v6 += '&' + escape(v9) + '=' + escape(v2[v9]); } trace('OPENING ' + v6); getURL(v6, '_blank'); v2.removeMovieClip(); } else { var v10 = new LoadVars(); v10.remember_command_id = v2.command_id; v10.onData = function (data) { com.newgrounds.API.echo('INPUT: \r' + data + '\n'); if (data) { var v2 = com.newgrounds.encoders.JSON.decode(data); } else { var v2 = {'success': false}; } if (!v2.success) { if (!v2.error_code && !v2.error_msg) { v2.error_code = 'CONNECTION_FAILED'; v2.error_msg = 'Could not contact the API Gateway'; v2.command_id = this.remember_command_id; } var v4 = new com.newgrounds.APIError(v2.error_code, v2.error_msg); com.newgrounds.API.sendError(v2, v4); } else { com.newgrounds.API.doEvent(v2); } }; var v7 = new Array(); for (var v8 in v2) { v7.push(v8 + '=' + escape(v2[v8])); } com.newgrounds.API.echo('POST ' + com.newgrounds.API.GATEWAY_URL + '?' + v7.join('&')); v2.sendAndLoad(com.newgrounds.API.GATEWAY_URL + '?seed=' + Math.random(), v10, 'POST'); com.newgrounds.API.last_command = v2.command_id; } }; v1.renderAd = function (target) { if (com.newgrounds.API.ad_swf_url) { target.background = target.createEmptyMovieClip('background', 100); target.background.beginFill(0); target.background.moveTo(0, 0); target.background.lineTo(300, 0); target.background.lineTo(300, 250); target.background.lineTo(0, 250); target.background.lineTo(0, 0); target.background.endFill(); target.mask = target.createEmptyMovieClip('mask', 101); target.mask.beginFill(0); target.mask.moveTo(0, 0); target.mask.lineTo(300, 0); target.mask.lineTo(300, 250); target.mask.lineTo(0, 250); target.mask.lineTo(0, 0); target.mask.endFill(); target.clip = target.createEmptyMovieClip('clip', 102); target.clip.ad = target.clip.createEmptyMovieClip('ad', 100); target.clip.setMask(target.mask); target.clip.ad._lockroot = true; loadMovie(com.newgrounds.API.ad_swf_url, target.clip.ad); com.newgrounds.API.callListener(com.newgrounds.APIEvent.AD_ATTACHED, true, {'target': target}); } else { com.newgrounds.API.callListener(com.newgrounds.APIEvent.AD_ATTACHED, false, new com.newgrounds.APIError('FLASH_ADS_NOT_APPROVED', 'Unable to render ad')); } }; v1.attachFlashAd = function (target) { if (com.newgrounds.API.checkAdFlood()) { com.newgrounds.API.ad_swf_url = null; } else { if (com.newgrounds.API.checkAdCache()) { com.newgrounds.API.reportNewAsset(); var v1 = new LoadVars(); v1.onData = function (data) { if (data) { com.newgrounds.API.ad_swf_url = data; } else { com.newgrounds.API.ad_swf_url = null; } com.newgrounds.API.reportAssetLoaded(); com.newgrounds.API.renderAd(target); }; if (com.newgrounds.API.ad_url.indexOf('?') > -1) { v1.load(com.newgrounds.API.ad_url + '&random=' + Math.random()); } else { v1.load(com.newgrounds.API.ad_url + '?random=' + Math.random()); } if (!com.newgrounds.API.ad_warning) { com.newgrounds.API.ad_warning = true; com.newgrounds.API.sendMessage('You may get a security sandbox violation from this ad. This is nothing to worry about!'); } } else { if (com.newgrounds.API.ad_swf_url) { com.newgrounds.API.renderAd(target); } } } }; v1.checkAdFlood = function () { if (!com.newgrounds.API.ad_url) { return false; } var v2 = new Date(); var v1 = v2.getTime(); if (v1 >= com.newgrounds.API.ad_flood) { if (v1 - com.newgrounds.API.ad_flood > 1000) { com.newgrounds.API.ad_flood = v1 + 1000; return false; } com.newgrounds.API.ad_flood = v1; com.newgrounds.API.sendWarning('This movie is attempting to load multiple ads at too high of a frequency; you may have a bad preloader loop.'); return true; } return false; }; v1.checkAdCache = function () { if (!com.newgrounds.API.ad_url) { return false; } var v2 = new Date(); var v1 = v2.getTime(); if (v1 >= com.newgrounds.API.ad_url_cache) { com.newgrounds.API.ad_url_cache = v1 + 300000; return true; } return false; }; v1.sendMessage = function (m, r) { var v1 = '[Newgrounds API] :: ' + m; if (r) { return v1; } else { trace(v1); com.newgrounds.API.bridge.sendEvent('trace', {'data': v1}); } }; v1.echo = function (m) { if (com.newgrounds.API.do_echo) { trace(m); } }; v1.LOGIN_URL = 'http://ng-local.newgrounds.com/apilogin/'; v1.do_echo = true; v1.GATEWAY_URL = 'http://www.ngads.com/gateway_v2.php'; v1.NEWGROUNDS_PREVIEW = 'uploads.ungrounded.net/previews'; v1.AD_TERMS_URL = 'http://www.newgrounds.com/wiki/using-the-site/terms-of-use/flash-ads/'; v1.COMMANDS_WIKI_URL = 'http://www.newgrounds.com/wiki/developer-resources/flash-api/commands/'; v1.LOCAL_HOST = 'localhost'; v1.NEWGROUNDS_WWW = 'www.newgrounds.com'; v1.PREVIEW_HOSTS = new Array(com.newgrounds.API.LOCAL_HOST, com.newgrounds.API.NEWGROUNDS_PREVIEW); v1.ad_url_cache = 0; v1.ad_flood = 0; v1.ad_warning = false; v1.save_file = null; v1.publisher_id = 1; v1.fake_session = false; v1.medals = null; v1.userpage_format = null; v1.scoreboards = new Array(); v1.save_groups = null; v1.compression_radix = '/g8236klvBQ#&|;Zb*7CEA59%s`Oue1wziFp$rDVY@TKxUPWytSaGHJ>dmoMR^<0~4qNLhc(I+fjn)X'; v1.errors = com.newgrounds.APIError.init_codes(); v1.sharedObjects = new Object(); v1.bridge = new com.newgrounds.Bridge(_root.NewgroundsAPI_SandboxID); v1.preload = true; v1.preload_items = 0; v1.preload_items_loaded = 0; ASSetPropFlags(com.newgrounds.API.prototype, null, 1); } #endinitclip } movieClip 20 __Packages.com.newgrounds.Bridge { #initclip if (!_global.com) { _global.com = new Object(); } if (!_global.com.newgrounds) { _global.com.newgrounds = new Object(); } if (!_global.com.newgrounds.Bridge) { var v1 = function (id) { this.widget_id = id; this.receiver = new LocalConnection(); this.transmitter = new LocalConnection(); this.receiver.receiveEvent = function (event, params) { com.newgrounds.API.callListener(event, params.success, params.data); }; try { this.receiver.connect('rec_' + this.widget_id); } catch (v0) { if (Error(v0) != null) { var error = Error(v0); } else { throw v0; } } }; com.newgrounds.Bridge = v1; var v2 = v1.prototype; v2.sendEvent = function (event, params) { if (this.widget_id) { this.transmitter.send(this.widget_id, 'sendEvent', event, this.validateParams(params)); } }; v2.sendCommand = function (command, params) { if (this.widget_id) { this.transmitter.send(this.widget_id, 'sendCommand', command, this.validateParams(params)); } }; v2.validateParams = function (params) { var v2 = {}; for (var v3 in params) { if (typeof params[v3] == 'string' || typeof params[v3] == 'number') { v2[v3] = params[v3]; } } return v2; }; ASSetPropFlags(com.newgrounds.Bridge.prototype, null, 1); } #endinitclip } movieClip 21 __Packages.com.newgrounds.SaveFile { #initclip if (!_global.com) { _global.com = new Object(); } if (!_global.com.newgrounds) { _global.com.newgrounds = new Object(); } if (!_global.com.newgrounds.SaveFile) { var v1 = function (_group) { this._group = _group; this._filename = null; this._file_id = null; this._contents = null; this._thumbnail = null; this._thumbnail_url = null; this.raw = null; this.img = null; this._draft = false; this._keys = new Array(); this._ratings = new Array(); this._file_url = null; com.newgrounds.API.addEventListener(com.newgrounds.APIEvent.FILE_PRIVS_LOADED, this.checkPrivs, this); }; com.newgrounds.SaveFile = v1; var v2 = v1.prototype; v1.setFilePath = function (path) { com.newgrounds.SaveFile.file_path = path + '/'; }; v1.setImagePath = function (path) { com.newgrounds.SaveFile.image_path = path + '/'; }; v2.__get__name = function () { return this._filename; }; v2.__set__name = function (s) { this._filename = s; return this.__get__name(); }; v2.__get__id = function () { return this._file_id; }; v2.__get__description = function () { return this._description; }; v2.__set__description = function (s) { this._description = s; return this.__get__description(); }; v2.__get__contents = function () { return this._contents; }; v2.__set__contents = function (o) { this._contents = o; return this.__get__contents(); }; v2.__get__thumbnailUrl = function () { return com.newgrounds.SaveFile.image_path + this._thumbnail_url; }; v2.__set__thumbnailUrl = function (s) { this._thumbnail_url = s; return this.__get__thumbnailUrl(); }; v2.__get__fileUrl = function () { return com.newgrounds.SaveFile.file_path + this._file_url; }; v2.__set__fileUrl = function (s) { this._file_url = s; return this.__get__fileUrl(); }; v2.__get__authorID = function () { return this._author_id; }; v2.__set__authorID = function (i) { this._author_id = i; return this.__get__authorID(); }; v2.__get__authorName = function () { return this._author_name; }; v2.__set__authorName = function (n) { this._author_name = n; return this.__get__authorName(); }; v2.__get__views = function () { return this._views; }; v2.__get__draft = function () { return this._draft; }; v2.__set__draft = function (d) { this._draft = d; return this.__get__draft(); }; v2.__get__group = function () { return this._group; }; v2.__get__groupId = function () { return this._group.getID(); }; v2.__get__groupName = function () { return this._group.getName(); }; v2.__get__groupType = function () { return this._group.getType(); }; v2.__get__locked = function () { return this._locked; }; v2.__get__shared = function () { return this._isShared(); }; v2.__get__isPrivate = function () { return this._isPrivate(); }; v2.__get__isPublic = function () { return this._isPublic(); }; v2.__get__approved = function () { return this._isApproved(); }; v2.__get__keys = function () { return this._keys; }; v2.__get__ratings = function () { return this._ratings; }; v2.loadAuthorPage = function () { com.newgrounds.API.loadUserPage(this._author_id, this._author_name); }; v2.getID = function () { return this._file_id; }; v2.exists = function () { return this._file_id !== null; }; v2.getGroup = function () { return this._group; }; v2.getName = function () { return this._filename; }; v2._isPrivate = function () { return this.status == com.newgrounds.SaveFile.STATUS.PRIVATE; }; v2._isShared = function () { return this.status > com.newgrounds.SaveFile.STATUS.PRIVATE; }; v2._isApproved = function () { return this.status > com.newgrounds.SaveFile.STATUS.UNAPPROVED; }; v2._isPublic = function () { if (this._isPrivate()) { return false; return false; } if (this._group.isType('SYSTEM') or this._group.isType('PRIVATE')) { return false; return false; } if (this._group.isType('PUBLIC')) { return true; return false; } if (this._isApproved()) { return true; } return false; }; v2.isLocked = function () { return this._locked; }; v2.getDescription = function () { return this._description; }; v2.getShared = function () { return this._draft; }; v2.getThumbnailImageScan = function () { return this.img; }; v2.getRawContents = function () { return this.raw; }; v2.getDuplicateID = function () { return this.duplicate_id; }; v2.getKeys = function () { return this._keys; }; v2.getKey = function (key) { var v3 = (this.getGroup()).getKey(key); var v2 = 0; while (v2 < this._keys.length) { if (this._keys[v2].id == v3.key_id) { return this._keys[v2].value; } ++v2; } }; v2.getRating = function (rating) { var v2 = (this.getGroup()).getRating(rating); if (this._ratings[v2.rating_id]) { return this._ratings[v2.rating_id]; } else { return null; } }; v2.overwriteAllowed = function () { return this.overwrite; }; v2.getFileURL = function () { return com.newgrounds.SaveFile.file_path + this._file_url; }; v2.getThumbnailURL = function () { return com.newgrounds.SaveFile.image_path + this._thumbnail_url; }; v2.overwriteExisting = function () { this.overwrite = true; }; v2.setID = function (id, add_to_group) { this._file_id = id; if (add_to_group) { (this.getGroup()).addFile(this); } }; v2.setName = function (filename, locked) { this._filename = filename; this._locked = locked; }; v2.setDescription = function (description) { this._description = description; }; v2.setDraft = function (draft) { this._draft = draft; }; v2.setContents = function (_contents) { this._contents = _contents; }; v2.setThumbnail = function (thumb) { if (thumb) { this._thumbnail = thumb; } else { this._thumbnail = null; } }; v2.setThumbnailURL = function (url) { this._thumbnail_url = url; }; v2.setFileURL = function (url) { this._file_url = url; }; v2.setPermissions = function (status, _locked) { this._locked = _locked; this.status = status; }; v2.setKey = function (key, val) { var v4 = (this.getGroup()).getKeyID(key); var v2; if (!v4) { this.onError('\'' + key + '\' is not a valid key for the \'' + this._group.__get__name() + '\' save group', 'setKey', 'INVALID_VALUE', true); return undefined; } if (!this._group.keyValueIsValid(key, val) && val !== null) { this.onError('\'' + val + '\' is not a valid ' + this._group.getKeyType(key, true), 'setKey', 'INVALID_VALUE', true); return undefined; } switch (this._group.getKeyType(key, true)) { case 'string': if (val) { val = String(val); } else { val = undefined; } break; default: val = Number(val); } var v5 = {'id': v4, 'value': val}; for (var v6 in this._keys) { v2 = this._keys[v6]; if (v2.id == v4) { this._keys[v6] = v5; return undefined; } } this._keys.push(v5); }; v2.setRating = function (rating, votes, score) { var v2 = (this.getGroup()).getRating(rating); if (!votes) { votes = 0; } if (!score) { score = 0; } if (!v2.is_float) { score = Math.round(Number(score)); } this._ratings[v2.rating_id] = {'id': Number(v2.rating_id), 'name': v2.rating_name, 'votes': Number(votes), 'score': Number(score)}; return this._ratings[v2.rating_id]; }; v2.clearBuffer = function () { this._contents = null; this.raw = null; this.img = null; this.scanner = null; this.overwrite = false; this.duplicate_id = null; }; v2.onError = function (msg, funct, code) { com.newgrounds.SaveFile.busy = false; if (!code) { code = 'SAVE_FILE_ERROR'; } if (!funct) { funct = 'unknown_function'; } var v3 = 'getSaveGroup(\'' + this._group.getName() + '\')'; if (this.exists()) { funct = v3 + '.getFile(\'' + this.getName() + '\').' + funct; } else { funct = v3 + '.getNewFile().' + funct; } var v5 = new com.newgrounds.APIError(code, msg); com.newgrounds.API.sendError({'command_id': funct}, v5); }; v2.onSaved = function (p) { com.newgrounds.SaveFile.busy = false; if (!this.exists()) { this.setID(p.save_id, true); } this.setName(p.filename); this.setFileURL(p.file_url); if (p.thumbnail) { this._thumbnail_url = p.thumbnail; } }; v2.onVoted = function (p) { trace('ONVOTED WAS CALLED'); return this.setRating(p.rating_id, p.votes, p.score); }; v2.sendRating = function (rating, vote) { var v6 = null; if (!com.newgrounds.API.hasUserSession()) { v6 = new com.newgrounds.APIError('PERMISSION_DENIED', 'You must be logged in to vote on save files'); } var v2 = this._group.getRating(rating); if (!v2) { v6 = new com.newgrounds.APIError('PERMISSION_DENIED', '\'' + rating + '\' is not a valid rating for the \'' + this._group.getName() + '\' save group'); } if (this.voted === true) { v6 = new com.newgrounds.APIError('PERMISSION_DENIED', 'You have already voted on this item today'); } if (vote < v2.min_value or vote > v2.max_value) { v6 = new com.newgrounds.APIError('PERMISSION_DENIED', '\'' + rating + '\' votes must be between ' + v2.min_value + ' and ' + v2.max_value); } if (v6) { com.newgrounds.API.callListener(com.newgrounds.APIEvent.VOTE_COMPLETE, false, {'error': v6, 'file': this}); return undefined; } this.voted = true; com.newgrounds.API.rateSaveFile(this, v2, vote); }; v2.replace = function () { if (com.newgrounds.SaveFile.busy) { this.onError('Another file is currently being saved, please try again later', 'replace'); return undefined; } this.overwriteExisting(); this.save(); }; v2.save = function () { if (com.newgrounds.API.hasUserSession() && !this._author_id && !this._author_name) { this._author_id = com.newgrounds.API.getUserID(); this._author_name = com.newgrounds.API.getUserName(); } if (com.newgrounds.SaveFile.busy) { this.onError('Another file is currently being saved, please try again later', 'save', 'UPLOAD_IN_PROGRESS'); return undefined; } com.newgrounds.SaveFile.busy = true; if (this.isLocked()) { this.onError('This file is _locked and cannot be overwritten.', 'save', 'PERMISSION_DENIED'); return undefined; } if (!this._filename) { this.onError('Please provide a name for your file.', 'save', 'MISSING_PARAM'); return undefined; } else { if (!this._contents) { this.onError('The file is empty.', 'save', 'MISSING_PARAM'); return undefined; } } this.img = null; com.newgrounds.API.checkFilePrivs(this); }; v2.checkPrivs = function (e) { if (e.data.file.id != this.__get__id()) { return undefined; } if (e.success) { if (e.data.can_write) { this.can_write = e.data.can_write; if (e.data.duplicate_id) { this.duplicate_id = e.data.duplicate_id; } if (e.data.exists && !this.overwriteAllowed()) { this.onError('You already have a file named \'' + this.getName() + '\'', 'save', 'CONFIRM_REQUEST'); } else { this.startFile(); } } else { this.onError('This file is _locked and cannot be overwritten', 'save', 'PERMISSION_DENIED'); } } else { this.onError('There was a problem looking up your file\'s details. The server may be down.', 'save', 'UNKNOWN_ERROR'); } }; v2.startFile = function () { if (this.can_write) { if (this._thumbnail) { this.scanner = new com.newgrounds.encoders.ImageScanner(this._thumbnail); this.scanner.setCallback(this, 'encodeFile'); this.scanner.startScan(100, 100, true); } else { this.encodeFile(); } } else { this.onError('You do not have permission to save this file.', 'save', 'PERMISSION_DENIED'); } }; v2.encodeFile = function (img) { this.img = img; this.raw = (com.newgrounds.encoders.SerialXML.encode(this._contents)).toString(); this.compressFile(); }; v2.compressFile = function () { com.newgrounds.encoders.LZW2.compress(this.raw, function (s, p) { p.file.onCompressed(s); }, {'file': this}); }; v2.onCompressed = function (compressed) { this.raw = escape(compressed); this.writeFile(); }; v2.getProgress = function () {}; v2.writeFile = function () { ((this.getGroup()).getQuery()).clearCache(); com.newgrounds.API.saveFile(this); this.clearBuffer(); }; v2.loadContents = function () { if (this._contents) { com.newgrounds.API.setCurrentSaveFile(this); com.newgrounds.API.callListener(com.newgrounds.APIEvent.FILE_LOADED, true, {'file': this}); return undefined; } if (!this.getFileURL()) { var v4 = new com.newgrounds.APIError('FILE_NOT_FOUND', 'Attempted to load contents of an unsaved file.'); com.newgrounds.API.callListener(com.newgrounds.APIEvent.FILE_LOADED, false, {'file': this, 'error': v4}); return undefined; } var v2 = new LoadVars(); v2.target = this; var target = this; v2.onData = function (encoded) { target.onLoaded(encoded); }; v2.load(this.getFileURL()); }; v2.onLoaded = function (encoded) { if (encoded == undefined) { var v3 = new com.newgrounds.APIError('FILE_NOT_FOUND', 'We could not find the contents for this file. It may have been deleted.'); com.newgrounds.API.callListener(com.newgrounds.APIEvent.FILE_LOADED, false, {'file': this, 'error': v3}); return undefined; } com.newgrounds.encoders.LZW.setXMLSafe(true); this._contents = com.newgrounds.encoders.SerialXML.decode(com.newgrounds.encoders.LZW.decompress(encoded)); com.newgrounds.API.callListener(com.newgrounds.APIEvent.FILE_LOADED, true, {'file': this}); }; v2.setViews = function (n) { this._views = n; }; v1.busy = false; v2.can_write = false; v2._draft = false; v2.status = 0; v2.voted = false; v2._views = 0; v2._locked = false; v2.overwrite = false; v2.duplicate_id = null; v2._keys = null; v2._ratings = null; v2._author_id = null; v2._author_name = null; v1.STATUS = {'PRIVATE': 1, 'PUBLIC': 2, 'UNAPPROVED': 3, 'APPROVED': 4}; v2.addProperty('approved', v2.__get__approved, function () {}); v2.addProperty('authorID', v2.__get__authorID, v2.__set__authorID); v2.addProperty('authorName', v2.__get__authorName, v2.__set__authorName); v2.addProperty('contents', v2.__get__contents, v2.__set__contents); v2.addProperty('description', v2.__get__description, v2.__set__description); v2.addProperty('draft', v2.__get__draft, v2.__set__draft); v2.addProperty('fileUrl', v2.__get__fileUrl, v2.__set__fileUrl); v2.addProperty('group', v2.__get__group, function () {}); v2.addProperty('groupId', v2.__get__groupId, function () {}); v2.addProperty('groupName', v2.__get__groupName, function () {}); v2.addProperty('groupType', v2.__get__groupType, function () {}); v2.addProperty('id', v2.__get__id, function () {}); v2.addProperty('isPrivate', v2.__get__isPrivate, function () {}); v2.addProperty('isPublic', v2.__get__isPublic, function () {}); v2.addProperty('keys', v2.__get__keys, function () {}); v2.addProperty('locked', v2.__get__locked, function () {}); v2.addProperty('name', v2.__get__name, v2.__set__name); v2.addProperty('ratings', v2.__get__ratings, function () {}); v2.addProperty('shared', v2.__get__shared, function () {}); v2.addProperty('thumbnailUrl', v2.__get__thumbnailUrl, v2.__set__thumbnailUrl); v2.addProperty('views', v2.__get__views, function () {}); ASSetPropFlags(com.newgrounds.SaveFile.prototype, null, 1); } #endinitclip } movieClip 22 __Packages.com.newgrounds.SaveGroup { #initclip if (!_global.com) { _global.com = new Object(); } if (!_global.com.newgrounds) { _global.com.newgrounds = new Object(); } if (!_global.com.newgrounds.SaveGroup) { var v1 = function (group_id, group_name, group_type) { this.group_name = group_name; this.group_id = group_id; this.group_type = group_type; this.query = new com.newgrounds.SaveGroupQuery(this); this.ratings = new Array(); this.keys = new Array(); this.files = new Array(); }; com.newgrounds.SaveGroup = v1; var v2 = v1.prototype; v2.__get__id = function () { return this.group_id; }; v2.__get__name = function () { return this.group_name; }; v2.__get__type = function () { return this.group_type; }; v2.addFile = function (file) { var v2 = 0; while (v2 < this.files.length) { if (this.files[v2].getID() == file.getID()) { this.files[v2] = file; return undefined; } ++v2; } this.files.push(file); }; v2.getFile = function (file_id) { trace('getting the file ' + file_id); var v2 = 0; while (v2 < this.files.length) { trace('Looking up ' + file_id + ' :: ' + this.files[v2].getID() + ' || ' + this.files[v2].getName()); if (com.newgrounds.SaveGroup.isNumeric(file_id) and this.files[v2].getID() == Number(file_id)) { return this.files[v2]; } else { if (this.files[v2].getName() == file_id) { return this.files[v2]; } } ++v2; } return null; }; v2.addRating = function (rating_id, rating_name, min_value, max_value, is_float) { var v3 = {'rating_id': rating_id, 'rating_name': rating_name, 'min_value': min_value, 'max_value': max_value, 'is_float': is_float}; if (!this.getRatingID(rating_name)) { this.ratings.push(v3); } }; v2.getRating = function (rating_id) { var v2 = 0; while (v2 < this.ratings.length) { if (com.newgrounds.SaveGroup.isNumeric(rating_id) and this.ratings[v2].rating_id == rating_id) { return this.ratings[v2]; } else { if (this.ratings[v2].rating_name == rating_id) { return this.ratings[v2]; } } ++v2; } return null; }; v2.getRatingID = function (rating_id) { var v2 = this.getRating(rating_id); if (v2) { return v2.rating_id; } return null; }; v2.getRatingName = function (rating_id) { var v2 = this.getRating(rating_id); if (v2) { return v2.rating_name; } return null; }; v2.addKey = function (key_id, key_name, key_type) { trace('>>>>>>>>>>> ADDING KEY ' + key_id + ' ' + key_name + ' ' + key_type); var v2 = {'key_id': key_id, 'key_name': key_name, 'key_type': key_type}; if (!this.getKey(key_name)) { this.keys.push(v2); } }; v2.getKey = function (key_id) { var v2 = 0; while (v2 < this.keys.length) { if (com.newgrounds.SaveGroup.isNumeric(key_id) and this.keys[v2].key_id == key_id) { return this.keys[v2]; } else { if (this.keys[v2].key_name == key_id) { return this.keys[v2]; } } ++v2; } return null; }; v2.getKeyType = function (key_name, as_string) { var v2 = this.getKey(key_name); if (v2) { return as_string ? com.newgrounds.SaveGroup.KEY_TYPES[v2.key_type] : v2.key_type; } return null; }; v2.getKeyID = function (key_id) { var v2 = this.getKey(key_id); if (v2) { return v2.key_id; } return null; }; v2.getKeyName = function (key_id) { var v2 = this.getKey(key_id); if (v2) { return v2.key_name; } return null; }; v2.keyValueIsValid = function (key, value) { var v4; var v7; if (typeof value == 'number' or (Number(value)).toString() == String(value)) { value = Number(value); v4 = (Math.round(value) === value) ? 'integer' : 'float'; } else { v4 = typeof value; if (v4 == 'string') { var v6 = '01234567890.-'; var v5 = true; var v2 = 0; while (v2 < value.length) { if (v6.indexOf(value.charAt(v2)) < 0) { v5 = false; break; } ++v2; } if (v5) { value = Number(value); v4 = 'float'; } } } switch (this.getKeyType(key, true)) { case 'integer': v7 = v4 == 'integer' or v4 == 'boolean'; return v7; case 'float': v7 = v4 == 'float' or v4 == 'integer' or v4 == 'boolean'; return v7; case 'string': v7 = v4 == 'string' or v4 == 'float' or v4 == 'integer' or v4 == 'boolean'; return v7; case 'boolean': v7 = v4 == 'boolean' or value == 1 or value == 0 or value == ''; return v7; } v7 = false; return v7; }; v2.isType = function (type) { return this.group_type == com.newgrounds.SaveGroup.TYPES[type.toUpperCase()]; }; v2.getID = function () { return this.group_id; }; v2.getName = function () { return this.group_name; }; v2.getType = function () { return this.group_type; }; v2.isSystem = function () { return undefined; }; v2.getQuery = function (as_object) { if (as_object) { return this.query.toObject(); } return this.query; }; v2.newQuery = function () { this.query.reset(); return this.query; }; v2.clearQuery = function () { this.query.reset(); }; v2.newFile = function () { var v2 = new com.newgrounds.SaveFile(this); return v2; }; v1.isNumeric = function (value) { return typeof value == 'number' or (Number(value)).toString() == String(value); }; v1.KEY_TYPES = [null, 'float', 'integer', 'string', 'boolean']; v1.TYPES = {'SYSTEM': 0, 'PRIVATE': 1, 'PUBLIC': 2, 'MODERATED': 3}; v2.addProperty('id', v2.__get__id, function () {}); v2.addProperty('name', v2.__get__name, function () {}); v2.addProperty('type', v2.__get__type, function () {}); ASSetPropFlags(com.newgrounds.SaveGroup.prototype, null, 1); } #endinitclip } movieClip 23 __Packages.com.newgrounds.ValidationTools { #initclip if (!_global.com) { _global.com = new Object(); } if (!_global.com.newgrounds) { _global.com.newgrounds = new Object(); } if (!_global.com.newgrounds.ValidationTools) { var v1 = function () {}; com.newgrounds.ValidationTools = v1; var v2 = v1.prototype; v1.isNumber = function (v) { if (typeof v == 'number') { return true; return false; } if (typeof v == 'string' and (Number(v)).toString() == v) { return true; } return false; }; v1.isInteger = function (v) { if (com.newgrounds.ValidationTools.isNumber(v)) { v = Number(v); return Math.floor(v) == v; } return false; }; v1.isFloat = function (v) { return com.newgrounds.ValidationTools.isNumber(v); }; v1.isString = function (v) { if (typeof v == 'string' or typeof v == 'number') { return true; } return false; }; v1.isEmpty = function (o) { for (var v2 in o) { return false; } return true; }; ASSetPropFlags(com.newgrounds.ValidationTools.prototype, null, 1); } #endinitclip } movieClip 24 __Packages.com.newgrounds.APIEvent { #initclip if (!_global.com) { _global.com = new Object(); } if (!_global.com.newgrounds) { _global.com.newgrounds = new Object(); } if (!_global.com.newgrounds.APIEvent) { var v1 = function (type, success, data) { this._type = type; this._success = success; if (data.isError()) { this._error = data; this.data = null; } else { if (data.error && data.error.isError()) { this._error = data.error; this.data = data; } else { this.data = data; this._error = null; } } }; com.newgrounds.APIEvent = v1; var v2 = v1.prototype; v2.__get__error = function () { return this._error; }; v2.__get__type = function () { return this._type; }; v2.__get__success = function () { return this._success; }; v1.API_CONNECTED = 'apiConnected'; v1.ADS_APPROVED = 'adsApproved'; v1.AD_ATTACHED = 'adAttached'; v1.HOST_BLOCKED = 'hostBlocked'; v1.NEW_VERSION_AVAILABLE = 'newVersionAvailable'; v1.EVENT_LOGGED = 'eventLogged'; v1.SCORE_POSTED = 'scorePosted'; v1.SCORES_LOADED = 'scoresLoaded'; v1.UNLOCK_MEDAL = 'unlockMedal'; v1.MEDAL_UNLOCKED = 'medalUnlocked'; v1.MEDALS_LOADED = 'medalsLoaded'; v1.METADATA_LOADED = 'metadataLoaded'; v1.FILE_PRIVS_LOADED = 'filePrivsLoaded'; v1.FILE_SAVED = 'fileSaved'; v1.FILE_LOADED = 'fileLoaded'; v1.FILE_INITIALIZED = 'fileInitialized'; v1.FILE_REQUESTED = 'fileRequested'; v1.QUERY_COMPLETE = 'queryComplete'; v1.VOTE_COMPLETE = 'voteComplete'; v1.API_ERROR = 'apiError'; v1.UNCAUGHT_EVENT = 'uncaughtEvent'; v2.addProperty('error', v2.__get__error, function () {}); v2.addProperty('success', v2.__get__success, function () {}); v2.addProperty('type', v2.__get__type, function () {}); ASSetPropFlags(com.newgrounds.APIEvent.prototype, null, 1); } #endinitclip } movieClip 25 __Packages.com.newgrounds.SaveGroupQuery { #initclip if (!_global.com) { _global.com = new Object(); } if (!_global.com.newgrounds) { _global.com.newgrounds = new Object(); } if (!_global.com.newgrounds.SaveGroupQuery) { var v1 = function (_group) { this._group = _group; this.reset(); }; com.newgrounds.SaveGroupQuery = v1; var v2 = v1.prototype; v2.__get__group = function () { return this._group; }; v2.__get__groupId = function () { return this._group.getID(); }; v2.__get__resultsPerPage = function () { return this._num_results; }; v2.__set__resultsPerPage = function (n) { this._num_results = n; return this.__get__resultsPerPage(); }; v2.__get__pages = function () { return this._pages; }; v2.__get__page = function () { return this._page; }; v2.__set__page = function (n) { this._page = n; return this.__get__page(); }; v2.__get__randomize = function () { return this._randomize_results; }; v2.__set__randomize = function (b) { this._randomize_results = b; return this.__get__randomize(); }; v2.__get__results = function () { return this._results; }; v2.clearCache = function () { this._results = []; }; v2.reset = function () { this.file_conditions = new Array(); this.key_conditions = new Array(); this.rating_conditions = new Array(); this.sort_conditions = new Array(); this.lookup_keys = new Object(); this.lookup_ratings = new Object(); this._num_results = 20; this._page = 1; this._randomize_results = false; this._group_by = new Array(); this.clearCache(); }; v2.getGroup = function () { return this._group; }; v2.getGroupID = function () { return this._group.getID(); }; v2.isRandomized = function () { return this._randomize_results; }; v2.toObject = function () { var v2; var v11 = {'page': this._page, 'num_results': this._num_results}; if (this._randomize_results) { v11.randomize = 1; } if (!com.newgrounds.ValidationTools.isEmpty(this.file_conditions)) { var v12 = []; v2 = 0; while (v2 < this.file_conditions.length) { var v6 = this.file_conditions[v2]; v12.push({'field': com.newgrounds.SaveGroupQuery.file_fields[v6.field.toUpperCase()].id, 'operator': v6.operator, 'value': v6.value}); ++v2; } v11.file_conditions = v12; } if (!com.newgrounds.ValidationTools.isEmpty(this.key_conditions)) { v11.key_conditions = this.key_conditions; } if (!com.newgrounds.ValidationTools.isEmpty(this.rating_conditions)) { v11.rating_conditions = this.rating_conditions; } if (!com.newgrounds.ValidationTools.isEmpty(this.sort_conditions)) { var v14 = []; v2 = 0; while (v2 < this.sort_conditions.length) { var v3 = this.sort_conditions[v2]; if (v3.table == com.newgrounds.SaveGroupQuery.TABLE_FILES) { var v8 = com.newgrounds.SaveGroupQuery.file_fields[v3.field.toUpperCase()].id; } else { var v8 = v3.field; } var v5 = {'field': v8, 'table': v3.table}; if (v3.desc) { v5.desc = 1; } if (v3.extra) { v5.extra = v3.extra; } v14.push(v5); ++v2; } v11.sort_conditions = v14; } if (!com.newgrounds.ValidationTools.isEmpty(this.lookup_keys)) { var v15 = []; for (v2 in this.lookup_keys) { v15.push(v2); } v11.lookup_keys = v15; } if (!com.newgrounds.ValidationTools.isEmpty(this.lookup_ratings)) { var v13 = []; for (v2 in this.lookup_ratings) { v13.push(v2); } v11.lookup_ratings = v13; } if (!com.newgrounds.ValidationTools.isEmpty(this._group_by)) { var v16 = []; v2 = 0; while (v2 < this._group_by.length) { var v4 = this._group_by[v2]; if (v4.table == com.newgrounds.SaveGroupQuery.TABLE_FILES) { v8 = com.newgrounds.SaveGroupQuery.file_fields[v4.field.toUpperCase()].id; } else { v8 = v4.field; } v16.push({'field': v8, 'table': v4.table}); ++v2; } v11.group_by = v16; } return v11; }; v2.toString = function () { var v9; var v2; var v11 = []; v9 = 'Lookup:\r'; var v14 = []; for (var v6 in com.newgrounds.SaveGroupQuery.file_fields) { v14.push(' ' + v6); v2 = true; } v9 += v14.join('\n'); v11.push(v9); v9 = ''; v2 = false; var v16 = []; for (v6 in this.lookup_keys) { v16.push(' KEY \'' + this._group.getKeyName(v6) + '\''); v2 = true; } if (v2) { v9 += v16.join('\n'); v11.push(v9); } v9 = ''; v2 = false; var v15 = []; for (v6 in this.lookup_ratings) { v15.push(' RATING \'' + this._group.getRatingName(v6) + '\''); v2 = true; } if (v2) { v9 += v15.join('\n'); v11.push(v9); } v9 = 'Where:\r'; v2 = false; var v8 = []; v6 = 0; while (v6 < this.file_conditions.length) { var v7 = this.file_conditions[v6]; var v10 = ' ' + v7.field + ' ' + v7.operator + ' ' + v7.value; v8.push(v10); v2 = true; ++v6; } v6 = 0; while (v6 < this.key_conditions.length) { v7 = this.key_conditions[v6]; v10 = ' KEY \'' + this._group.getKeyName(v7.key_id) + '\' ' + v7.operator + ' ' + v7.value; v8.push(v10); v2 = true; ++v6; } v6 = 0; while (v6 < this.rating_conditions.length) { v7 = this.rating_conditions[v6]; v10 = ' RATING \'' + this._group.getRatingName(v7.rating_id) + '\' ' + v7.operator + ' ' + v7.value; v8.push(v10); v2 = true; ++v6; } if (v2) { v9 += v8.join('\n'); v11.push(v9); } v9 = 'Group By:\r'; v2 = false; var v13 = []; v6 = 0; while (v6 < this._group_by.length) { var v4 = this._group_by[v6]; var v5; if (v4.table == com.newgrounds.SaveGroupQuery.TABLE_KEYS) { v5 = ' KEY \'' + this._group.getKeyName(v4.field) + '\''; } else { if (v4.table == com.newgrounds.SaveGroupQuery.TABLE_RATINGS) { v5 = ' RATING \'' + this._group.getRatingName(v4.field) + '\''; } else { v5 = ' ' + v4.field; } } v13.push(v5); v2 = true; ++v6; } if (v2) { v9 += v13.join('\n'); v11.push(v9); } v9 = 'Order By:\r'; v2 = false; var v12 = []; if (this.isRandomized()) { v12.push(' RANDOM'); v2 = true; } v6 = 0; while (v6 < this.sort_conditions.length) { var v3 = this.sort_conditions[v6]; if (v3.table == com.newgrounds.SaveGroupQuery.TABLE_KEYS) { v5 = ' KEY \'' + this._group.getKeyName(v3.field) + '\''; } else { if (v3.table == com.newgrounds.SaveGroupQuery.TABLE_RATINGS) { v5 = ' RATING \'' + this._group.getRatingName(v3.field) + '\' ' + ((v3.extra == 'votes') ? 'VOTES' : 'SCORE'); } else { v5 = ' ' + v3.field; } } v5 += v3.desc ? ' (DESCENDING)' : ''; v12.push(v5); v2 = true; ++v6; } if (v2) { v9 += v12.join('\n'); v11.push(v9); } v11.push('Page:\r ' + this._page); v11.push('Results Per Page:\r ' + this._num_results); return v11.join('\n'); }; v2.setResultsPerPage = function (r) { this._num_results = r; this.clearCache(); }; v2.setPage = function (p) { this._page = p; this.clearCache(); }; v2.setRandomize = function (bool) { this._randomize_results = (bool === false) ? false : true; }; v2.includeKey = function (key) { if (!this._group.getKeyID(key)) { trace('[SaveGroupQuery Error] :: \'' + key + '\' is not a valid key for the \'' + this._group.__get__name() + '\' group.'); return undefined; } this.lookup_keys[this._group.getKeyID(key)] = 1; this.clearCache(); }; v2.includeRating = function (rating) { if (!this._group.getRatingID(rating)) { trace('[SaveGroupQuery Error] :: \'' + rating + '\' is not a valid rating for the \'' + this._group.__get__name() + '\' group.'); return undefined; } this.lookup_ratings[this._group.getRatingID(rating)] = 1; this.clearCache(); }; v2.groupBy = function (field) { this.addGroupItem(com.newgrounds.SaveGroupQuery.TABLE_FILES, field); }; v2.groupByKey = function (key) { if (!this._group.getKeyID(key)) { this.error('\'' + key + '\' is not a valid key for the \'' + this._group.getName() + '\' _group'); return undefined; } this.addGroupItem(com.newgrounds.SaveGroupQuery.TABLE_KEYS, this._group.getKeyID(key)); }; v2.groupByRating = function (rating) { if (!this._group.getRatingID(rating)) { this.error('\'' + rating + '\' is not a valid rating for the \'' + this._group.getName() + '\' _group'); return undefined; } this.addGroupItem(com.newgrounds.SaveGroupQuery.TABLE_RATINGS, this._group.getRatingID(rating)); }; v2.addGroupItem = function (table, field) { this._group_by.push({'table': table, 'field': field}); this.clearCache(); }; v2.excludeKey = function (key) { delete this.lookup_keys[this._group.getKeyID(key)]; this.clearCache(); }; v2.excludeRating = function (rating) { delete this.lookup_ratings[this._group.getRatingID(rating)]; this.clearCache(); }; v2.addCondition = function (field, operator, value) { if (field == 'FILE_STATUS' && typeof value == 'string' && com.newgrounds.SaveFile.STATUS[value.toUpperCase()] !== undefined) { value = com.newgrounds.SaveFile.STATUS[value.toUpperCase()]; } if (operator == '==') { operator = '='; } if (!this.validateOperator(operator) or !this.validateValue(field, value)) { return undefined; } this.file_conditions.push({'field': field, 'operator': operator, 'value': value}); this.clearCache(); }; v2.addKeyCondition = function (key, operator, value) { if (!this._group.getKeyID(key)) { this.error('\'' + key + '\' is not a valid key for the \'' + this._group.getName() + '\' save _group'); } else { if (!this.validateOperator(operator) or !this.validateKeyValue(key, value)) { return undefined; } } this.key_conditions.push({'key_id': this._group.getKeyID(key), 'operator': operator, 'value': value}); this.clearCache(); }; v2.addRatingCondition = function (rating, operator, value, column) { if (!column) { column = 'SCORE'; } if (!this._group.getRatingID(rating)) { this.error('\'' + rating + '\' is not a valid rating for the \'' + this._group.getName() + '\' save _group'); } else { if (!this.validateOperator(operator)) { return undefined; } else { if (!com.newgrounds.ValidationTools.isNumber(value)) { this.error('Expected numeric value for rating \'' + rating + '\''); return undefined; } } } if (!com.newgrounds.SaveGroupQuery.rating_columns[column]) { var v2 = []; for (var v3 in com.newgrounds.SaveGroupQuery.rating_columns) { v2.push(v3); } this.error('Invalid rating column \'' + column + '\'. Valid columns are ' + v2.join(', ')); return undefined; } this.rating_conditions.push({'rating_id': this._group.getRatingID(rating), 'operator': operator, 'value': value, 'column': com.newgrounds.SaveGroupQuery.rating_columns[column]}); this.clearCache(); }; v2.sortOn = function (field, order) { if (!com.newgrounds.SaveGroupQuery.file_fields[field]) { var v2 = []; for (var v3 in com.newgrounds.SaveGroupQuery.file_fields) { v2.push(v3); } this.error('\'' + field + '\' is not a valid sort field. Valid fields are: ' + v2.join(', ')); return undefined; } this.addSortCondition(com.newgrounds.SaveGroupQuery.TABLE_FILES, field, order); }; v2.sortOnKey = function (key, order) { if (!this._group.getKeyID(key)) { this.error('\'' + key + '\' is not a valid key for the \'' + this._group.getName() + '\' _group'); return undefined; } this.addSortCondition(com.newgrounds.SaveGroupQuery.TABLE_KEYS, this._group.getKeyID(key), order); }; v2.sortOnRating = function (rating, order, column) { if (!this._group.getRatingID(rating)) { this.error('\'' + rating + '\' is not a valid rating for the \'' + this._group.getName() + '\' _group'); return undefined; } if (!column) { column = 'score'; } this.addSortCondition(com.newgrounds.SaveGroupQuery.TABLE_RATINGS, this._group.getRatingID(rating), order, column); }; v2.sortOnRatingScore = function (rating, order) { this.sortOnRating(rating, order, 'score'); }; v2.sortOnRatingVotes = function (rating, order) { this.sortOnRating(rating, order, 'votes'); }; v2.addSortCondition = function (table, field, order, extra) { var v7; if (!order or order == '' or order.toUpperCase() == 'ASC') { v7 = false; } else { if (order.toUpperCase() == 'DESC') { v7 = true; } else { this.error('\'' + order + '\' is not a valid sort order!'); return undefined; } } var v3 = {'table': table, 'field': field, 'desc': v7}; if (extra) { v3.extra = extra; } this.sort_conditions.push(v3); this.clearCache(); }; v2.onExecuted = function (results) { this._results = []; var v6 = 0; while (v6 < results.length) { var v2 = results[v6]; var v3 = new com.newgrounds.SaveFile(this._group); v3.setName(v2.filename); v3.setID(v2.save_id); v3.setDescription(v2.description); v3.setThumbnailURL(v2.thumb); v3.setFileURL(v2.file); if (v2.views) { v3.setViews(v2.views); } v3.setPermissions(v2.status, v2.locked); v3.authorName = v2.user_name; v3.authorID = v2.user_id; var v5 = 0; while (v5 < v2.keys.length) { v3.setKey(v2.keys[v5].id, v2.keys[v5].value); ++v5; } var v4 = 0; while (v4 < v2.ratings.length) { v3.setRating(v2.ratings[v4].id, v2.ratings[v4].votes, v2.ratings[v4].score); ++v4; } (this.getGroup()).addFile(v3); this._results.push(v3); ++v6; } this.callEventDispatcher(); }; v2.hasResults = function () { return this._results && this._results.length > 0; }; v2.callEventDispatcher = function () { com.newgrounds.API.callListener(com.newgrounds.APIEvent.QUERY_COMPLETE, true, {'query': this}); }; v2.execute = function () { if (this.hasResults() && !this.isRandomized()) { this.callEventDispatcher(); return undefined; } this._group.query = this; com.newgrounds.API.lookupSaveFiles(this._group); }; v2.processResults = function (files) { return null; }; v2.validateKeyValue = function (key, value) { var v3 = this._group.getKeyType(key); if (v3) { var v2 = com.newgrounds.SaveGroup.KEY_TYPES[v3]; if (v2 == 'float' and com.newgrounds.ValidationTools.isFloat(value)) { return true; } else { if (v2 == 'integer' and com.newgrounds.ValidationTools.isInteger(value)) { return true; } else { if (v2 == 'string' and com.newgrounds.ValidationTools.isString(value)) { return true; } } } this.error('Expected type ' + v2 + ' for key \'' + key + '\''); } return false; }; v2.validateValue = function (field, value) { if (com.newgrounds.SaveGroupQuery.file_fields[field]) { if (com.newgrounds.SaveGroupQuery.file_fields[field].type == 'integer' and com.newgrounds.ValidationTools.isInteger(value)) { return true; } else { if (com.newgrounds.SaveGroupQuery.file_fields[field].type == 'float' and com.newgrounds.ValidationTools.isFloat(value)) { return true; } else { if (com.newgrounds.SaveGroupQuery.file_fields[field].type == 'string' and com.newgrounds.ValidationTools.isString(value)) { return true; } else { this.error('Expecting ' + com.newgrounds.SaveGroupQuery.file_fields[field].type + ' value on \'' + field + '\' condition'); } } } return false; } var v2 = []; for (var v4 in com.newgrounds.SaveGroupQuery.file_fields) { v2.push(v4); } this.error('\'' + field + '\' is not a searchable field. Valid fields are: ' + v2.join(', ')); return false; }; v2.validateOperator = function (operator) { var v2 = 0; while (v2 < com.newgrounds.SaveGroupQuery.valid_operators.length) { if (operator == com.newgrounds.SaveGroupQuery.valid_operators[v2]) { return true; } ++v2; } this.error('\'' + operator + '\' is not a valid lookup operation. Valid operations are: ' + com.newgrounds.SaveGroupQuery.valid_operators.join(', ')); return false; }; v2.error = function (msg) { trace('[QUERY ERROR] :: ' + msg); }; v1.TABLE_FILES = 1; v1.TABLE_KEYS = 2; v1.TABLE_RATINGS = 3; v2._results = []; v1.file_fields = {'FILE_ID': {'id': 0, 'field': 'file_id', 'type': 'integer'}, 'AUTHOR_ID': {'id': 1, 'field': 'user_id', 'type': 'integer'}, 'AUTHOR_NAME': {'id': 2, 'field': 'user_name', 'type': 'string'}, 'FILE_NAME': {'id': 3, 'field': 'file_name', 'type': 'string'}, 'CREATED_ON': {'id': 4, 'field': 'created', 'type': 'string'}, 'UPDATED_ON': {'id': 5, 'field': 'last_update', 'type': 'string'}, 'TOTAL_VIEWS': {'id': 6, 'field': 'views', 'type': 'integer'}, 'FILE_STATUS': {'id': 7, 'field': 'status', 'type': 'integer'}}; v1.rating_columns = {'TOTAL_VOTES': 'votes', 'SCORE': 'score'}; v1.valid_operators = ['=', '<', '>', '!=', '<>', '<=', '>=', '*', '!*', '!*=', '!=*', '*=', '=*']; v2.addProperty('group', v2.__get__group, function () {}); v2.addProperty('groupId', v2.__get__groupId, function () {}); v2.addProperty('page', v2.__get__page, v2.__set__page); v2.addProperty('pages', v2.__get__pages, function () {}); v2.addProperty('randomize', v2.__get__randomize, v2.__set__randomize); v2.addProperty('results', v2.__get__results, function () {}); v2.addProperty('resultsPerPage', v2.__get__resultsPerPage, v2.__set__resultsPerPage); ASSetPropFlags(com.newgrounds.SaveGroupQuery.prototype, null, 1); } #endinitclip } movieClip 26 __Packages.com.newgrounds.encoders.BaseN { #initclip if (!_global.com) { _global.com = new Object(); } if (!_global.com.newgrounds) { _global.com.newgrounds = new Object(); } if (!_global.com.newgrounds.encoders) { _global.com.newgrounds.encoders = new Object(); } if (!_global.com.newgrounds.encoders.BaseN) { var v1 = function (hash) { this.ceiling = 100000000000000.0; if (hash) { this.hashIndex = hash; } else { this.hashIndex = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ`~@#$%^&*()+|;/'; } this.bitSize = this.hashIndex.length; this.hashVal = new Object(); this.i = 0; while (this.i < this.bitSize) { this.hashVal[this.hashIndex.charAt(this.i)] = this.i; ++this.i; } }; com.newgrounds.encoders.BaseN = v1; var v2 = v1.prototype; v2.verify = function (s) { if (this.hashVal[s] != undefined) { return true; } else { return false; } }; v2.encode = function (n, minchars) { this.debug.lastencode = ''; if (typeof this.i != 'string') { n = n.toString(); } if (n.charAt(0) == '-') { var v3 = '-'; n = n.substring(1); } else { var v3 = ''; } if ((String(n)).indexOf('.') > -1) { var v4 = (String(n)).split('.', 2); return v3 + this.baseNEncoder(v4[0], minchars) + '.' + this.baseNEncoder(v4[1]); } else { this.debug.lastencode += '\tNo decimal\r'; return v3 + this.baseNEncoder(n, minchars); } }; v2.decode = function (s) { var v4 = 1; if (s.charAt(0) == '-') { v4 = -1; s = s.substring(1, s.length); } var v3 = s.indexOf('.'); if (v3 > -1) { var v5 = Math.pow(10, this.baseNDecoder(s.substring(v3 + 1, s.length))); return (this.baseNDecoder(s.substring(0, v3)) / v5) * v4; } else { return this.baseNDecoder(s) * v4; } }; v2.baseNEncoder = function (n, minchars) { if (!minchars) { minchars = 1; } var v4 = ''; while (n != 0) { n = Math.round(n); var v3 = n % this.bitSize; if (Math.round(v3) != v3) { trace('BaseN failed on ' + n + '%' + this.bitSize + ' = ' + v3 + ' ' + int(n) + ' ' + int(this.bitSize)); } v4 = this.hashIndex.charAt(v3) + v4; this.debug.lastencode += '\t-> n:' + n + ' % bitSize:' + this.bitSize + ' = ' + v3 + ', final char=' + v4 + '\n'; n -= v3; n /= this.bitSize; } if (minchars) { while (v4.length < minchars) { v4 = this.hashIndex.charAt(0) + v4; } } return v4; }; v2.baseNDecoder = function (s) { var v2 = 0; var v6 = 0; this.i = 0; while (this.i < s.length) { var v3 = s.charAt(s.length - this.i - 1); if (v3 == this.hashIndex.charAt(0)) { var v5 = 0; } else { var v5 = this.hashVal[v3] * Math.pow(this.bitSize, this.i); } v2 += v5; if (v2 >= this.ceiling) { v6 += (v2 - v2 % this.ceiling) / this.ceiling; v2 %= this.ceiling; } ++this.i; } if (v6 > 0) { v2 = '' + v2; while (v2.length < (this.ceiling.toString()).length - 1) { v2 = '0' + v2; } v2 = '' + v6 + v2; } return v2; }; v2.debug = new Object(); ASSetPropFlags(com.newgrounds.encoders.BaseN.prototype, null, 1); } #endinitclip } movieClip 27 __Packages.com.newgrounds.encoders.ImageScanner { #initclip if (!_global.com) { _global.com = new Object(); } if (!_global.com.newgrounds) { _global.com.newgrounds = new Object(); } if (!_global.com.newgrounds.encoders) { _global.com.newgrounds.encoders = new Object(); } if (!_global.com.newgrounds.encoders.ImageScanner) { var v1 = function (the_source) { if (the_source) { this.image_source = the_source; } else { this.image_source = _root; } this.reset(); if (typeof this.image_source == 'movieclip') { if (this.image_source == _root) { this.source_width = Stage.width; this.source_height = Stage.height; } else { this.source_width = Math.floor(this.image_source._width); this.source_height = Math.floor(this.image_source._height); } this.sourceBitmap = new flash.display.BitmapData(this.source_width, this.source_height, false, 4294967295.0); this.sourceBitmap.draw(_root); } else { if (this.image_source.width) { this.source_width = this.image_source.width; this.source_height = this.image_source.height; this.sourceBitmap = this.image_source; } else { this.error('You can only use BitMaptData and MovieClip objects to create images'); } } }; com.newgrounds.encoders.ImageScanner = v1; var v2 = v1.prototype; v2.setCallback = function (target, funct) { if (target && funct) { this.callback_target = target; this.callback_function = funct; } }; v2.reset = function () { this.callback_target = null; this.callback_function = null; this.debug.bad_pixels = 0; this.hash = '0123456789aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ<>?:;-_=+()!&'; var v3 = Math.pow(this.hash.length, 2); trace('MAX COLORS: ' + v3); var v2 = Math.floor(Math.pow(v3, 0.3333333333333333)) - 1; var v4 = Math.pow(v2, 3); this.cube = v2; this.basen = new com.newgrounds.encoders.BaseN(this.hash); this.xpos = 0; this.ypos = 0; this.pixels = 0; this.busy = false; }; v2.startScan = function (w, h, s) { if (w) { this.image_width = w; } if (h) { this.image_height = h; } if (s != undefined) { this.crop = s; } var v7 = _root.getNextHighestDepth(); var v6 = _root.createEmptyMovieClip('API_image_container_' + v7, v7); var v5 = v6.createEmptyMovieClip('canvas', 100); v5.attachBitmap(this.sourceBitmap, 100); if (this.crop) { if (this.image_width / this.source_width > this.image_height / this.source_height) { this.canvas_width = this.image_width; this.canvas_height = Math.ceil(this.source_height * (this.image_width / this.source_width)); } else { this.canvas_height = this.image_height; this.canvas_width = Math.ceil(this.source_width * (this.image_height / this.source_height)); } } else { this.canvas_width = this.image_width; this.canvas_height = this.image_height; } v5._x = Math.round((this.image_width - this.canvas_width) / 2); v5._width = this.canvas_width; v5._height = this.canvas_height; this.resizedBitmap = new flash.display.BitmapData(this.image_width, this.image_height, false, 4294967295.0); this.resizedBitmap.draw(v6); v6.removeMovieClip(); this.copyBitmap = new flash.display.BitmapData(this.image_width, this.image_height, false, 4294967295.0); var v3 = '' + this.image_width; while (v3.length < 3) { v3 = '0' + v3; } var v4 = '' + this.image_height; while (v4.length < 3) { v4 = '0' + v4; } this.output = v3 + v4; this.draw_interval = setInterval(this, 'drawChunk', 10); this.busy = false; return this.resizedBitmap; }; v2.getBitmapData = function () { return this.copyBitmap; }; v2.getBytesTotal = function () { return this.image_width * this.image_height * 2; }; v2.getBytesScanned = function () { return this.pixels * 2; }; v2.getProgress = function () { return Math.round((this.getBytesScanned() / this.getBytesTotal()) * 100); }; v2.drawChunk = function () { if (!this.busy) { this.busy = true; var v2 = 0; while (v2 < this.pixels_per_chunk) { if (!this.nextPixel()) { clearInterval(this.draw_interval); this.callback_interval = setInterval(this, 'doCallback', 25); this.busy = true; break; } ++v2; } this.busy = false; } }; v2.doCallback = function () { this.busy = false; clearInterval(this.callback_interval); if (this.callback_target and this.callback_function) { this.callback_target[this.callback_function](this.output); } else { this.onScanComplete(this.output); } }; v2.onScanComplete = function (packet) { this.sendMessage('packet size: ' + this.output.length + ' bytes', 'onScanComplete'); }; v2.nextPixel = function () { var v15 = this.xpos; var v14 = this.ypos; var v7 = this.resizedBitmap.getPixel(v15, v14); var v17 = v7 >> 16 & 255; var v20 = v7 >> 8 & 255; var v16 = v7 >> 0 & 255; var v11 = Math.round(((v17 + 1) / 256) * this.cube); var v10 = Math.round(((v20 + 1) / 256) * this.cube); var v13 = Math.round(((v16 + 1) / 256) * this.cube); var v12 = v11 * (this.cube + 1) * (this.cube + 1) + v10 * (this.cube + 1) + v13; var v6 = this.basen.encode(v12, 2); this.output += v6; if (v6.length != 2) { trace('bad pixel ' + v6); } var v5 = this.basen.decode(v6); var v18 = v5; var v8 = v5 % (this.cube + 1); v5 = (v5 - v8) / (this.cube + 1); var v9 = v5 % (this.cube + 1); var v19 = (v5 - v9) / (this.cube + 1); if (v13 != v8 and v10 != v9 and v11 != v10) { ++this.debug.bad_pixels; trace('BAD PIXEL ' + this.debug.bad_pixels + ') ' + v12 + ' != ' + v18 + ' ' + v6); trace(this.basen.debug.lastencode); } var v2 = (Math.round((v19 / this.cube) * 255)).toString(16); var v4 = (Math.round((v9 / this.cube) * 255)).toString(16); var v3 = (Math.round((v8 / this.cube) * 255)).toString(16); while (v2.length < 2) { v2 = '0' + v2; } while (v4.length < 2) { v4 = '0' + v4; } while (v3.length < 2) { v3 = '0' + v3; } this.copyBitmap.setPixel(v15, v14, Number('0x' + v2 + v4 + v3)); ++this.pixels; if (this.pixels >= this.image_width * this.image_height) { return false; } ++this.xpos; if (this.xpos >= this.image_width) { this.xpos = 0; ++this.ypos; } return true; }; v2.error = function (e, f) { this.sendMessage(e, f, 'ERROR'); }; v2.sendMessage = function (msg, func, type) { var v1 = 'ImageScanner'; if (func) { v1 += '.' + func + '()'; } if (type) { v1 = type + ' in ' + v1; } v1 += ' :: ' + msg; trace(v1); }; v2.image_width = 100; v2.image_height = 100; v2.crop = true; v2.pixels_per_chunk = 500; v2.debug = new Object(); ASSetPropFlags(com.newgrounds.encoders.ImageScanner.prototype, null, 1); } #endinitclip } movieClip 28 __Packages.com.newgrounds.encoders.SerialXML { #initclip if (!_global.com) { _global.com = new Object(); } if (!_global.com.newgrounds) { _global.com.newgrounds = new Object(); } if (!_global.com.newgrounds.encoders) { _global.com.newgrounds.encoders = new Object(); } if (!_global.com.newgrounds.encoders.SerialXML) { var v1 = function () {}; com.newgrounds.encoders.SerialXML = v1; var v2 = v1.prototype; v1.decode = function (xml) { if (!(xml instanceof XML)) { xml = new XML(xml); } var v2 = com.newgrounds.encoders.SerialXML.populateObject(xml.firstChild, {}); return v2.DATA; }; v1.encode = function (obj) { var v1 = new XML(); com.newgrounds.encoders.SerialXML.populateXML(v1, obj, 'DATA'); return v1; }; v1.populateObject = function (child, object) { var v6 = child.nodeName; var v5 = com.newgrounds.encoders.SerialXML.getValue(v6, child.attributes.v); var v4 = child.attributes.n; if (object instanceof Array) { v4 = object.length; object.push(v5); } else { object[v4] = v5; } if (child.hasChildNodes()) { var v1 = 0; while (v1 < child.childNodes.length) { com.newgrounds.encoders.SerialXML.populateObject(child.childNodes[v1], object[v4]); ++v1; } } return object; }; v1.populateXML = function (child, obj, name) { if (obj === undefined) { return undefined; } var v5 = new XML(); var v2; if (obj instanceof Array) { v2 = v5.createElement(com.newgrounds.encoders.SerialXML.getType(obj)); if (name) { v2.attributes.n = name; } child.appendChild(v2); var v4 = 0; while (v4 < obj.length) { com.newgrounds.encoders.SerialXML.populateXML(v2, obj[v4]); ++v4; } } else { if (typeof obj == 'object') { v2 = v5.createElement(com.newgrounds.encoders.SerialXML.getType(obj)); if (name) { v2.attributes.n = name; } child.appendChild(v2); for (var v4 in obj) { com.newgrounds.encoders.SerialXML.populateXML(v2, obj[v4], v4); } } else { v2 = v5.createElement(com.newgrounds.encoders.SerialXML.getType(obj)); if (name) { v2.attributes.n = name; } if ((com.newgrounds.encoders.SerialXML.getType(obj)).length == 1) { v2.attributes.v = obj; } child.appendChild(v2); } } }; v1.getValue = function (type, stringval) { switch (type.toUpperCase()) { case 'O': return new Object(); break; case 'A': return new Array(); break; case 'N': return Number(stringval); break; case 'S': return String(stringval); break; case 'TRUE': return true; break; case 'FALSE': return false; break; default: return null; } }; v1.getType = function (obj) { switch (obj instanceof Array ? 'array' : typeof obj) { case 'array': return 'A'; break; case 'object': return 'O'; break; case 'string': return 'S'; break; case 'number': return 'N'; case 'boolean': return (obj === true) ? 'TRUE' : 'FALSE'; break; default: return 'NULL'; } }; ASSetPropFlags(com.newgrounds.encoders.SerialXML.prototype, null, 1); } #endinitclip } movieClip 29 __Packages.com.newgrounds.encoders.LZW2 { #initclip if (!_global.com) { _global.com = new Object(); } if (!_global.com.newgrounds) { _global.com.newgrounds = new Object(); } if (!_global.com.newgrounds.encoders) { _global.com.newgrounds.encoders = new Object(); } if (!_global.com.newgrounds.encoders.LZW2) { var v1 = function () {}; com.newgrounds.encoders.LZW2 = v1; var v2 = v1.prototype; v1.doCompressorConfig = function () { com.newgrounds.encoders.LZW2.comp_dict = []; var v1 = 0; while (v1 < 256) { com.newgrounds.encoders.LZW2.comp_dict[String.fromCharCode(v1)] = v1; ++v1; } com.newgrounds.encoders.LZW2.comp_dict.< = 256; com.newgrounds.encoders.LZW2.comp_dict.> = 257; com.newgrounds.encoders.LZW2.comp_dict.& = 258; com.newgrounds.encoders.LZW2.comp_dict." = 259; com.newgrounds.encoders.LZW2.comp_dict.\' = 260; com.newgrounds.encoders.LZW2.pos = 0; com.newgrounds.encoders.LZW2.result = ''; com.newgrounds.encoders.LZW2.buffer = ''; com.newgrounds.encoders.LZW2.nbChar = 256 + com.newgrounds.encoders.LZW2.skipnum; }; v1.compress = function (string, callback, callback_params) { com.newgrounds.encoders.LZW2.doCompressorConfig(); if (com.newgrounds.encoders.LZW2.busy) { trace('[LZW COMPRESSOR] :: Compression can not begin until previous compression or decompression is complete!'); return undefined; } com.newgrounds.encoders.LZW2.splitStr = string.split(''); string = ''; com.newgrounds.encoders.LZW2.len = com.newgrounds.encoders.LZW2.splitStr.length; com.newgrounds.encoders.LZW2.local = {'delay': 30, 'callback': callback, 'callback_params': callback_params, 'compress_chunk': function () { com.newgrounds.encoders.LZW2.compress_chunk(); }, 'busy': false, 'complete': false}; com.newgrounds.encoders.LZW2.interval = setInterval(com.newgrounds.encoders.LZW2.local, 'compress_chunk', 5); }; v1.getProgress = function () { return Math.round((com.newgrounds.encoders.LZW2.pos / com.newgrounds.encoders.LZW2.len) * 100); }; v1.compress_chunk = function () { if (com.newgrounds.encoders.LZW2.local.delay > 0) { --com.newgrounds.encoders.LZW2.local.delay; } else { if (!com.newgrounds.encoders.LZW2.local.busy) { com.newgrounds.encoders.LZW2.local.busy = true; var v1 = 0; while (v1 < com.newgrounds.encoders.LZW2.max_chunk_length) { com.newgrounds.encoders.LZW2.encode_next(); if (com.newgrounds.encoders.LZW2.local.complete) { break; } ++v1; } com.newgrounds.encoders.LZW2.local.busy = false; } } if (com.newgrounds.encoders.LZW2.local.complete) { trace('LZW2 complete ' + com.newgrounds.encoders.LZW2.nbChar + ' ' + com.newgrounds.encoders.LZW2.comp_dict.length + ' ' + com.newgrounds.encoders.LZW2.len + ' ' + com.newgrounds.encoders.LZW2.pos + ' ' + com.newgrounds.encoders.LZW2.skipnum); clearInterval(com.newgrounds.encoders.LZW2.interval); com.newgrounds.encoders.LZW2.local.callback(com.newgrounds.encoders.LZW2.result, com.newgrounds.encoders.LZW2.local.callback_params); com.newgrounds.encoders.LZW2.result = ''; com.newgrounds.encoders.LZW2.buffer = ''; } }; v1.encode_next = function () { if (com.newgrounds.encoders.LZW2.pos <= com.newgrounds.encoders.LZW2.len) { var v1 = com.newgrounds.encoders.LZW2.splitStr[com.newgrounds.encoders.LZW2.pos]; if (com.newgrounds.encoders.LZW2.comp_dict[com.newgrounds.encoders.LZW2.buffer + v1] !== undefined) { com.newgrounds.encoders.LZW2.buffer += v1; } else { com.newgrounds.encoders.LZW2.result += String.fromCharCode(com.newgrounds.encoders.LZW2.comp_dict[com.newgrounds.encoders.LZW2.buffer]); com.newgrounds.encoders.LZW2.comp_dict[com.newgrounds.encoders.LZW2.buffer + v1] = com.newgrounds.encoders.LZW2.nbChar; ++com.newgrounds.encoders.LZW2.nbChar; com.newgrounds.encoders.LZW2.buffer = v1; } ++com.newgrounds.encoders.LZW2.pos; } else { com.newgrounds.encoders.LZW2.local.complete = true; return undefined; } }; v1.comp_config = false; v1.skipnum = 5; v1.busy = false; v1.max_chunk_length = 12000; ASSetPropFlags(com.newgrounds.encoders.LZW2.prototype, null, 1); } #endinitclip } movieClip 30 __Packages.com.newgrounds.encoders.LZW { #initclip if (!_global.com) { _global.com = new Object(); } if (!_global.com.newgrounds) { _global.com.newgrounds = new Object(); } if (!_global.com.newgrounds.encoders) { _global.com.newgrounds.encoders = new Object(); } if (!_global.com.newgrounds.encoders.LZW) { var v1 = function () {}; com.newgrounds.encoders.LZW = v1; var v2 = v1.prototype; v1.setXMLSafe = function (x) { com.newgrounds.encoders.LZW.xmlsafe = x; }; v1.compress = function (str, escape_chars) { var v2 = new Array(); var v11 = com.newgrounds.encoders.LZW.xmlsafe ? 5 : 0; var v5 = 0; while (v5 < 256) { v2[String.fromCharCode(v5)] = v5; ++v5; } if (com.newgrounds.encoders.LZW.xmlsafe) { v2.< = 256; v2.> = 257; v2.& = 258; v2." = 259; v2.\' = 260; } var v7 = ''; var v8 = str.split(''); var v9 = v8.length; var v6 = 256 + v11; var v1 = ''; var v4; v5 = 0; while (v5 <= v9) { var v3 = v8[v5]; if (v2[v1 + v3] !== undefined) { v1 += v3; } else { v4 = String.fromCharCode(v2[v1]); if (escape_chars and (v2[v1] < 33 or v2[v1] > 126 or v4 == '%')) { v4 = escape(v4); } v7 += v4; v2[v1 + v3] = v6; ++v6; v1 = v3; } ++v5; } return v7; }; v1.decompress = function (str) { var v4 = new Array(); var v10 = com.newgrounds.encoders.LZW.xmlsafe ? 5 : 0; var v6 = 0; while (v6 < 256) { var v9 = String.fromCharCode(v6); v4[v6] = v9; ++v6; } if (com.newgrounds.encoders.LZW.xmlsafe) { v4[256] = '<'; v4[257] = '>'; v4[258] = '&'; v4[259] = '"'; v4[260] = '\''; } var v11 = str; var v13 = v11.split(''); var v12 = v13.length; var v7 = 256 + v10; var v1 = ''; var v2 = ''; var v8 = ''; v6 = 0; while (v6 < v12) { var v5 = v11.charCodeAt(v6); var v3 = v4[v5]; if (v1 == '') { v1 = v3; v8 += v3; } else { if (v5 <= 255 + v10) { v8 += v3; v2 = v1 + v3; v4[v7] = v2; ++v7; v1 = v3; } else { v2 = v4[v5]; if (v2 == undefined) { v2 = v1 + v1.slice(0, 1); } v8 += v2; v4[v7] = v1 + v2.slice(0, 1); ++v7; v1 = v2; } } ++v6; } return v8; }; v1.compress_fp6 = function (str) { var v3 = new Array(); var v10 = com.newgrounds.encoders.LZW.xmlsafe ? 5 : 0; var v4 = 0; while (v4 < 256) { v3[String(v4)] = v4; ++v4; } if (com.newgrounds.encoders.LZW.xmlsafe) { var v14 = String((new String('<')).charCodeAt(0)); var v11 = String((new String('>')).charCodeAt(0)); var v13 = String((new String('&')).charCodeAt(0)); var v15 = String((new String('"')).charCodeAt(0)); var v12 = String((new String('\'')).charCodeAt(0)); v3[v14] = 256; v3[v11] = 257; v3[v13] = 258; v3[v15] = 259; v3[v12] = 260; } var v7 = ''; var v16 = str; var v8 = v16.split(''); var v9 = v8.length; var v6 = 256 + v10; var v1 = new Array(); v4 = 0; while (v4 <= v9) { var v2 = v8[v4]; if (v1.length == 0) { var v5 = String(v2.charCodeAt(0)); } else { var v5 = v1.join('-') + '-' + String(v2.charCodeAt(0)); } if (v3[v5] !== undefined) { v1.push(v2.charCodeAt(0)); } else { v7 += String.fromCharCode(v3[v1.join('-')]); v3[v5] = v6; ++v6; false; v1 = new Array(); v1.push(v2.charCodeAt(0)); } ++v4; } return v7; }; v1.xmlsafe = false; ASSetPropFlags(com.newgrounds.encoders.LZW.prototype, null, 1); } #endinitclip } movieClip 31 __Packages.com.newgrounds.RemoteAuth { #initclip if (!_global.com) { _global.com = new Object(); } if (!_global.com.newgrounds) { _global.com.newgrounds = new Object(); } if (!_global.com.newgrounds.RemoteAuth) { var v1 = function (id) { this.auth_token = id; System.security.allowDomain('*'); this.receiver = new LocalConnection(); this.receiver.allowDomain = function () { return true; }; this.receiver.onAuth = function (auth_result) { trace('remote login is a success! ' + auth_result); com.newgrounds.API.onRemoteAuthentication(auth_result); }; this.receiver.connect('_' + this.auth_token); }; com.newgrounds.RemoteAuth = v1; var v2 = v1.prototype; v2.__get__token = function () { return this.auth_token; }; v2.addProperty('token', v2.__get__token, function () {}); ASSetPropFlags(com.newgrounds.RemoteAuth.prototype, null, 1); } #endinitclip } movieClip 32 __Packages.com.newgrounds.Medal { #initclip if (!_global.com) { _global.com = new Object(); } if (!_global.com.newgrounds) { _global.com.newgrounds = new Object(); } if (!_global.com.newgrounds.Medal) { var v1 = function (id, name, value, difficulty, unlocked, _icon_url) { if (id == undefined || name == undefined || value == undefined || difficulty == undefined) { com.newgrounds.API.fatalError('Medal instances require an id, name, value and difficulty'); } this._medal_id = id; this._medal_name = name; this._medal_value = value; this._medal_difficulty = difficulty; if (unlocked) { this._medal_unlocked = true; } if (_icon_url) { this._icon_url = _icon_url; } }; com.newgrounds.Medal = v1; var v2 = v1.prototype; v2.__get__difficulty = function () { return com.newgrounds.Medal.difficulty_names[this._medal_difficulty]; }; v2.__get__difficultyId = function () { return this._medal_difficulty; }; v2.__get__icon_url = function () { return this._icon_url; }; v2.__get__id = function () { return this._medal_id; }; v2.__get__name = function () { return this._medal_name; }; v2.__get__unlocked = function () { return this._medal_unlocked; }; v2.__get__value = function () { return this._medal_value; }; v2.isUnlocked = function () { return this._medal_unlocked; }; v2.unlock = function () { if (!this.isUnlocked()) { com.newgrounds.API.unlockMedal(this); } }; v2.setUnlocked = function (u) { this._medal_unlocked = u; }; v2.attachIcon = function (target, depth) { if (!depth) { depth = target.getNextHighestDepth(); } var v3 = target.createEmptyMovieClip('Asset_Medal_Icon_' + this.getID(), depth); if (this._icon_url) { v3.loadMovie(this._icon_url); } else { var v4 = flash.display.BitmapData.loadBitmap('Asset_default_medal_icon_' + this.getDifficulty(), depth); v3.attachBitmap(v4, depth, true); } }; v2.getID = function () { return this._medal_id; }; v2.getName = function () { return this._medal_name; }; v2.getValue = function () { return this._medal_value; }; v2.getDifficulty = function (as_string) { if (as_string) { return com.newgrounds.Medal.difficulty_names[this._medal_difficulty]; } else { return this._medal_difficulty; } }; v2._medal_unlocked = false; v2._icon_loaded = false; v2._icon_width = 50; v2._icon_height = 50; v2._icon_url = null; v1.difficulty_names = new Array(null, 'Easy', 'Moderate', 'Challenging', 'Difficult', 'Brutal'); v2.addProperty('difficulty', v2.__get__difficulty, function () {}); v2.addProperty('difficultyId', v2.__get__difficultyId, function () {}); v2.addProperty('icon_url', v2.__get__icon_url, function () {}); v2.addProperty('id', v2.__get__id, function () {}); v2.addProperty('name', v2.__get__name, function () {}); v2.addProperty('unlocked', v2.__get__unlocked, function () {}); v2.addProperty('value', v2.__get__value, function () {}); ASSetPropFlags(com.newgrounds.Medal.prototype, null, 1); } #endinitclip } movieClip 33 __Packages.com.newgrounds.ScoreBoard { #initclip if (!_global.com) { _global.com = new Object(); } if (!_global.com.newgrounds) { _global.com.newgrounds = new Object(); } if (!_global.com.newgrounds.ScoreBoard) { var v1 = function (id, name, tag) { this._name = name; this._id = id; if (tag !== undefined) { this._tag = tag; } }; com.newgrounds.ScoreBoard = v1; var v2 = v1.prototype; v2.exists = function () { return Number(this._id) > 0; }; v2.__get__id = function () { return this._id; }; v2.__get__name = function () { return this._name; }; v2.__get__period = function () { return this._period; }; v2.__get__tag = function () { return this._tag; }; v2.__get__page = function () { return this._page; }; v2.__get__num_results = function () { return this._num_results; }; v2.__get__scores = function () { return this._scores; }; v2.postScore = function (value, tag) { if (tag !== undefined) { this._tag = tag; } com.newgrounds.API.postScore(this._name, value, this._tag); }; v2.loadScores = function (period, page, num_results, tag) { if (period) { this._period = period; } if (page) { this._page = page; } if (num_results) { this._num_results = num_results; } this._scores = []; com.newgrounds.API.loadScores(this._name, this._period, tag); }; v2.setScores = function (scores, period, page, num_results) { if (period) { this._period = period; } if (page) { this._page = page; } if (num_results) { this._num_results = num_results; } this._scores = []; var v2 = 0; while (v2 < scores.length) { var v4 = this._num_results * (this._page - 1) + 1 + v2; this._scores.push(new com.newgrounds.Score(this, v4, scores[v2].username, scores[v2].value, scores[v2].numeric_value)); ++v2; } }; v2._period = 'Today'; v2._num_results = 10; v2._page = 1; v2._tag = ''; v2.addProperty('id', v2.__get__id, function () {}); v2.addProperty('name', v2.__get__name, function () {}); v2.addProperty('num_results', v2.__get__num_results, function () {}); v2.addProperty('page', v2.__get__page, function () {}); v2.addProperty('period', v2.__get__period, function () {}); v2.addProperty('scores', v2.__get__scores, function () {}); v2.addProperty('tag', v2.__get__tag, function () {}); ASSetPropFlags(com.newgrounds.ScoreBoard.prototype, null, 1); } #endinitclip } movieClip 34 __Packages.com.newgrounds.Score { #initclip if (!_global.com) { _global.com = new Object(); } if (!_global.com.newgrounds) { _global.com.newgrounds = new Object(); } if (!_global.com.newgrounds.Score) { var v1 = function (board, position, username, value, numeric_value) { this._board = board; this._position = position; this._username = username; this._value = value; this._numeric_value = numeric_value; }; com.newgrounds.Score = v1; var v2 = v1.prototype; v2.__get__board = function () { return this._board; }; v2.__get__position = function () { return this._position; }; v2.__get__username = function () { return this._username; }; v2.__get__value = function () { return this._value; }; v2.__get__numeric_value = function () { return this._numeric_value; }; v1.fromTime = function (time) { var v1 = time.split(':'); var v2 = Math.round(Number(v1.pop()) * 1000); if (v1.length > 0) { v2 += Number(v1.pop()) * 60; } if (v1.length > 0) { v2 += Number(v1.pop()) * 3600; } return v2; }; v1.fromDistance = function (distance) { var v1 = distance.indexOf('\''); var v5 = distance.indexOf('"', v1); var v3 = Number(distance.substr(0, v1)); var v4 = Number(distance.substring(v1 + 1, v5)); return Math.round(v3 * 12 + v4); }; v2.addProperty('board', v2.__get__board, function () {}); v2.addProperty('numeric_value', v2.__get__numeric_value, function () {}); v2.addProperty('position', v2.__get__position, function () {}); v2.addProperty('username', v2.__get__username, function () {}); v2.addProperty('value', v2.__get__value, function () {}); ASSetPropFlags(com.newgrounds.Score.prototype, null, 1); } #endinitclip } movieClip 35 __Packages.com.newgrounds.encoders.RC4 { #initclip if (!_global.com) { _global.com = new Object(); } if (!_global.com.newgrounds) { _global.com.newgrounds = new Object(); } if (!_global.com.newgrounds.encoders) { _global.com.newgrounds.encoders = new Object(); } if (!_global.com.newgrounds.encoders.RC4) { var v1 = function () {}; com.newgrounds.encoders.RC4 = v1; var v2 = v1.prototype; v1.encrypt = function (src, key) { var v3 = com.newgrounds.encoders.RC4.strToChars(src); var v1 = com.newgrounds.encoders.RC4.strToChars(key); var v2 = com.newgrounds.encoders.RC4.calculate(v3, v1); return com.newgrounds.encoders.RC4.charsToHex(v2); }; v1.encryptbin = function (src, key) { var v3 = com.newgrounds.encoders.RC4.strToChars(src); var v1 = com.newgrounds.encoders.RC4.strToChars(key); var v2 = com.newgrounds.encoders.RC4.calculate(v3, v1); return v2; }; v1.decrypt = function (src, key) { var v3 = com.newgrounds.encoders.RC4.hexToChars(src); var v1 = com.newgrounds.encoders.RC4.strToChars(key); var v2 = com.newgrounds.encoders.RC4.calculate(v3, v1); return com.newgrounds.encoders.RC4.charsToStr(v2); }; v1.initialize = function (pwd) { var v2 = 0; var v3; var v4 = pwd.length; var v1 = 0; while (v1 <= 255) { com.newgrounds.encoders.RC4.mykey[v1] = pwd[v1 % v4]; com.newgrounds.encoders.RC4.sbox[v1] = v1; ++v1; } v1 = 0; while (v1 <= 255) { v2 = (v2 + com.newgrounds.encoders.RC4.sbox[v1] + com.newgrounds.encoders.RC4.mykey[v1]) % 256; v3 = com.newgrounds.encoders.RC4.sbox[v1]; com.newgrounds.encoders.RC4.sbox[v1] = com.newgrounds.encoders.RC4.sbox[v2]; com.newgrounds.encoders.RC4.sbox[v2] = v3; ++v1; } }; v1.calculate = function (plaintxt, psw) { com.newgrounds.encoders.RC4.initialize(psw); var v1 = 0; var v2 = 0; var v9 = new Array(); var v7; var v5; var v6; var v3 = 0; while (v3 < plaintxt.length) { v1 = (v1 + 1) % 256; v2 = (v2 + com.newgrounds.encoders.RC4.sbox[v1]) % 256; v5 = com.newgrounds.encoders.RC4.sbox[v1]; com.newgrounds.encoders.RC4.sbox[v1] = com.newgrounds.encoders.RC4.sbox[v2]; com.newgrounds.encoders.RC4.sbox[v2] = v5; var v4 = (com.newgrounds.encoders.RC4.sbox[v1] + com.newgrounds.encoders.RC4.sbox[v2]) % 256; v7 = com.newgrounds.encoders.RC4.sbox[v4]; v6 = plaintxt[v3] ^ v7; v9.push(v6); ++v3; } return v9; }; v1.charsToHex = function (chars) { var v4 = new String(''); var v3 = new Array('0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'a', 'b', 'c', 'd', 'e', 'f'); var v1 = 0; while (v1 < chars.length) { v4 += v3[chars[v1] >> 4] + v3[chars[v1] & 15]; ++v1; } return v4; }; v1.hexToChars = function (hex) { var v3 = new Array(); var v1 = (hex.substr(0, 2) == '0x') ? 2 : 0; while (v1 < hex.length) { v3.push(parseInt(hex.substr(v1, 2), 16)); v1 += 2; } return v3; }; v1.charsToStr = function (chars) { var v3 = new String(''); var v1 = 0; while (v1 < chars.length) { v3 += String.fromCharCode(chars[v1]); ++v1; } return v3; }; v1.strToChars = function (str) { var v3 = new Array(); var v1 = 0; while (v1 < str.length) { v3.push(str.charCodeAt(v1)); ++v1; } return v3; }; v1.sbox = new Array(255); v1.mykey = new Array(255); ASSetPropFlags(com.newgrounds.encoders.RC4.prototype, null, 1); } #endinitclip } movieClip 36 __Packages.com.newgrounds.encoders.JSON { #initclip if (!_global.com) { _global.com = new Object(); } if (!_global.com.newgrounds) { _global.com.newgrounds = new Object(); } if (!_global.com.newgrounds.encoders) { _global.com.newgrounds.encoders = new Object(); } if (!_global.com.newgrounds.encoders.JSON) { var v1 = function () {}; com.newgrounds.encoders.JSON = v1; var v2 = v1.prototype; v1.encode = function (arg, noquotes) { var v3; var v2; var v6; var v1 = ''; var v4; if (arg.isSServerVar()) { var v8 = 'sservervariable'; } else { var v8 = typeof arg; } switch (v8) { return 'null'; case 'sservervariable': return '?' + arg.getEncodedValue(); break; case 'object': if (arg) { if (arg instanceof Array) { v2 = 0; while (v2 < arg.length) { v4 = com.newgrounds.encoders.JSON.encode(arg[v2]); if (v1) { v1 += ','; } v1 += v4; ++v2; } return '[' + v1 + ']'; } else { if (typeof arg.toString != 'undefined') { for (v2 in arg) { v4 = arg[v2]; if (typeof v4 != 'undefined' && typeof v4 != 'function') { v4 = com.newgrounds.encoders.JSON.encode(v4); if (v1) { v1 += ','; } v1 += com.newgrounds.encoders.JSON.encode(v2) + ':' + v4; } } return '{' + v1 + '}'; } } } return 'null'; case 'number': return isFinite(arg) ? String(arg) : 'null'; case 'string': v6 = arg.length; if (noquotes) { var v7 = ''; } else { var v7 = '"'; } v1 = v7; v2 = 0; while (v2 < v6) { v3 = arg.charAt(v2); if (v3 >= ' ') { if (v3 == '\\' || v3 == '"') { v1 += '\\'; } v1 += v3; } else { switch (v3) { case '\b': v1 += '\\b'; break; case '\f': v1 += '\\f'; break; case '\n': v1 += '\\n'; break; case '\r': v1 += '\\r'; break; case '\t': v1 += '\\t'; break; default: v3 = v3.charCodeAt(); v1 += '\\u00' + (Math.floor(v3 / 16)).toString(16) + (v3 % 16).toString(16); } } v2 += 1; } return v1 + v7; case 'boolean': return String(arg); default: return 'null'; } }; v1.background_encode = function (arg, callback) { if (com.newgrounds.encoders.JSON.busy) { trace('[Newgrounds Encoder] :: Cannot encode a new file until the previous file is completed'); return false; } else { if (!callback) { trace('[Newgrounds Encoder] :: Missing a callback function, skipping encode'); return false; } } com.newgrounds.encoders.JSON.busy = true; var v2 = new Date(); com.newgrounds.encoders.JSON.start = v2.getTime(); com.newgrounds.encoders.JSON.cache = {'busy': false, 'complete': false, 'arg': arg, 'target': arg, 'parents': [], 'encoded': '', 'callback': callback, 'encode_chunk': function () { com.newgrounds.encoders.JSON.encode_chunk(); }}; if (com.newgrounds.encoders.JSON.getType(arg) == 'object') { com.newgrounds.encoders.JSON.cache.encoded = '{'; com.newgrounds.encoders.JSON.interval = setInterval(com.newgrounds.encoders.JSON.cache, 'encode_chunk', 25); return true; } if (com.newgrounds.encoders.JSON.getType(arg) == 'array') { com.newgrounds.encoders.JSON.cache.encoded = '['; } com.newgrounds.encoders.JSON.interval = setInterval(com.newgrounds.encoders.JSON.cache, 'encode_chunk', 25); return true; }; v1.background_decode = function (arg, callback) { if (com.newgrounds.encoders.JSON.busy) { trace('[Newgrounds Encoder] :: Cannot decode a new file until the previous file is completed'); return false; } else { if (!callback) { trace('[Newgrounds Encoder] :: Missing a callback function, skipping decode'); return false; } } com.newgrounds.encoders.JSON.busy = true; var v1 = new Date(); com.newgrounds.encoders.JSON.start = v1.getTime(); com.newgrounds.encoders.JSON.cache = {'busy': false, 'callback': callback, 'complete': false, 'arg': arg, 'pos': 0, 'parents': ['root'], 'target': null, 'scratch': '', 'decode_chunk': function () { com.newgrounds.encoders.JSON.decode_chunk(); }}; com.newgrounds.encoders.JSON.interval = setInterval(com.newgrounds.encoders.JSON.cache, 'decode_chunk', 25); return true; }; v1.decode = function (text) { var at = 0; var ch = ' '; var _value; var _error = function (m) { throw {'name': 'JSONError', 'message': m, 'at': at - 1, 'text': text}; }; var _next = function () { ch = text.charAt(at); at += 1; return ch; }; var _white = function () { while (ch) { if (ch <= ' ') { _next(); } else { if (ch == '/') { switch (_next()) { case '/': for (;;) { if (!(_next() && ch != '\n' && ch != '\r')) break; } break; case '*': _next(); for (;;) { if (ch) { if (ch == '*') { if (_next() == '/') { _next(); break; } } else { _next(); } continue; } _error('Unterminated comment'); } break; default: _error('Syntax error'); } } else { break; } } } }; var _string = function () { var v4; var v1 = ''; var v3; var v2; var v5 = false; if (ch == '"') { while (_next()) { if (ch == '"') { _next(); return v1; } else { if (ch == '\\') { switch (_next()) { case 'b': v1 += '\b'; break; case 'f': v1 += '\f'; break; case 'n': v1 += '\n'; break; case 'r': v1 += '\r'; break; case 't': v1 += '\t'; break; case 'u': v2 = 0; v4 = 0; while (v4 < 4) { v3 = parseInt(_next(), 16); if (!isFinite(v3)) { v5 = true; break; } v2 = v2 * 16 + v3; v4 += 1; } if (v5) { v5 = false; } else { v1 += String.fromCharCode(v2); break; default: v1 += ch; } } } else { v1 += ch; } } } } _error('Bad string'); }; var _array = function () { var v1 = []; if (ch == '[') { _next(); _white(); if (ch == ']') { _next(); return v1; } while (ch) { v1.push(_value()); _white(); if (ch == ']') { _next(); return v1; } else { if (ch != ',') { break; } } _next(); _white(); } } _error('Bad array'); }; var _object = function () { var v2; var v1 = {}; if (ch == '{') { _next(); _white(); if (ch == '}') { _next(); return v1; } while (ch) { v2 = _string(); _white(); if (ch != ':') { break; } _next(); v1[v2] = _value(); _white(); if (ch == '}') { _next(); return v1; } else { if (ch != ',') { break; } } _next(); _white(); } } _error('Bad object'); }; var _number = function () { var v1 = ''; var v2; if (ch == '-') { v1 = '-'; _next(); } for (;;) { if (!(ch >= '0' && ch <= '9')) break; v1 += ch; _next(); } if (ch == '.') { v1 += '.'; for (;;) { if (!(_next() && ch >= '0' && ch <= '9')) break; v1 += ch; } } v2 = 1 * v1; if (!isFinite(v2)) { _error('Bad number'); } else { return v2; } }; var _word = function () { switch (ch) { case 't': if (_next() == 'r' && _next() == 'u' && _next() == 'e') { _next(); return true; } break; case 'f': if (_next() == 'a' && _next() == 'l' && _next() == 's' && _next() == 'e') { _next(); return false; } break; case 'n': if (_next() == 'u' && _next() == 'l' && _next() == 'l') { _next(); return null; } } _error('Syntax error'); }; _value = function () { _white(); switch (ch) { case '{': return _object(); case '[': return _array(); case '"': return _string(); case '-': return _number(); } return (ch >= '0' && ch <= '9') ? _number() : _word(); }; return _value(); }; v1.getType = function (v) { if (v instanceof Array) { return 'array'; } else { return typeof v; } }; v1.decode_chunk = function () { if (!com.newgrounds.encoders.JSON.cache.busy && !com.newgrounds.encoders.JSON.cache.complete) { com.newgrounds.encoders.JSON.cache.busy = true; var v1 = 0; while (v1 < com.newgrounds.encoders.JSON.decode_chunks) { com.newgrounds.encoders.JSON.chunk_decoder(); if (com.newgrounds.encoders.JSON.cache.complete) { break; } ++v1; } trace(Math.round((com.newgrounds.encoders.JSON.cache.pos / com.newgrounds.encoders.JSON.cache.arg.length) * 100) + '% decoded'); com.newgrounds.encoders.JSON.cache.busy = false; } if (com.newgrounds.encoders.JSON.cache.complete) { var v2 = new Date(); com.newgrounds.encoders.JSON.busy = false; clearInterval(com.newgrounds.encoders.JSON.interval); com.newgrounds.encoders.JSON.cache.callback(com.newgrounds.encoders.JSON.cache.root, v2.getTime() - com.newgrounds.encoders.JSON.start); com.newgrounds.encoders.JSON.cache.arg = ''; } }; v1.encode_chunk = function () { if (!com.newgrounds.encoders.JSON.cache.busy && !com.newgrounds.encoders.JSON.cache.complete) { com.newgrounds.encoders.JSON.cache.busy = true; var v1 = 0; while (v1 < com.newgrounds.encoders.JSON.encode_chunks) { com.newgrounds.encoders.JSON.chunk_encoder(); if (com.newgrounds.encoders.JSON.cache.complete) { break; } ++v1; } com.newgrounds.encoders.JSON.cache.busy = false; } if (com.newgrounds.encoders.JSON.cache.complete) { var v3 = new Date(); var v2 = v3.getTime(); com.newgrounds.encoders.JSON.busy = false; clearInterval(com.newgrounds.encoders.JSON.interval); com.newgrounds.encoders.JSON.cache.callback(com.newgrounds.encoders.JSON.cache.encoded, v2 - com.newgrounds.encoders.JSON.start); com.newgrounds.encoders.JSON.cache.encoded = ''; } }; v1.chunk_decoder = function () { function _object() { var v1 = com.newgrounds.encoders.JSON.cache.arg.charAt(com.newgrounds.encoders.JSON.cache.pos); if (!com.newgrounds.encoders.JSON.cache.mode) { com.newgrounds.encoders.JSON.cache.mode = 'object'; ++com.newgrounds.encoders.JSON.cache.pos; v1 = com.newgrounds.encoders.JSON.cache.arg.charAt(com.newgrounds.encoders.JSON.cache.pos); if (v1 != '"') { throw 'Malformed object key in encoded string. Keys must be wrapped in quotes ("")'; } com.newgrounds.encoders.JSON.cache.scratch = ''; _setTargetValue({}); } else { if (v1 == ',') { ++com.newgrounds.encoders.JSON.cache.pos; v1 = com.newgrounds.encoders.JSON.cache.arg.charAt(com.newgrounds.encoders.JSON.cache.pos); if (v1 != '"') { throw 'Malformed object key in encoded string. Keys must be wrapped in quotes ("")'; } com.newgrounds.encoders.JSON.cache.scratch = ''; } else { if (v1 == '}') { _useParent(); } else { if (v1 == '"') { ++com.newgrounds.encoders.JSON.cache.pos; v1 = com.newgrounds.encoders.JSON.cache.arg.charAt(com.newgrounds.encoders.JSON.cache.pos); if (v1 != ':') { throw 'Malformed object notation. Object keys and values must be separated by colons(:)'; } _addParent(com.newgrounds.encoders.JSON.cache.scratch); com.newgrounds.encoders.JSON.cache.mode = null; } else { if (v1 == '\\') { ++com.newgrounds.encoders.JSON.cache.pos; v1 = com.newgrounds.encoders.JSON.cache.arg.charAt(com.newgrounds.encoders.JSON.cache.pos); } com.newgrounds.encoders.JSON.cache.scratch += v1; } } } } ++com.newgrounds.encoders.JSON.cache.pos; } function _array() { var v1 = com.newgrounds.encoders.JSON.cache.arg.charAt(com.newgrounds.encoders.JSON.cache.pos); if (!com.newgrounds.encoders.JSON.cache.mode) { com.newgrounds.encoders.JSON.cache.mode = 'array'; ++com.newgrounds.encoders.JSON.cache.pos; v1 = com.newgrounds.encoders.JSON.cache.arg.charAt(com.newgrounds.encoders.JSON.cache.pos); _setTargetValue([]); if (v1 != ']') { _addArrayKey(); } else { _useParent(); } return undefined; } else { if (v1 == ',') { _addArrayKey(); } else { if (v1 == ']') { _useParent(); } } } ++com.newgrounds.encoders.JSON.cache.pos; } function _boolean() { var v1 = com.newgrounds.encoders.JSON.cache.arg.charAt(com.newgrounds.encoders.JSON.cache.pos); if (v1 == 't') { _setTargetValue(true); com.newgrounds.encoders.JSON.cache.pos += 3; } else { if (v1 == 'f') { _setTargetValue(false); com.newgrounds.encoders.JSON.cache.pos += 4; } else { throw 'Bool values must be true or false'; } } _useParent(); } function _null() { var v1 = com.newgrounds.encoders.JSON.cache.arg.charAt(com.newgrounds.encoders.JSON.cache.pos); if (v1 == 'n') { _setTargetValue(null); com.newgrounds.encoders.JSON.cache.pos += 2; } else { throw 'Null values must be null'; } _useParent(); } function _string() { var v1 = com.newgrounds.encoders.JSON.cache.arg.charAt(com.newgrounds.encoders.JSON.cache.pos); if (!com.newgrounds.encoders.JSON.cache.mode) { if (v1 != '"') { throw 'Strings must be wrapped in quotes ("")'; } com.newgrounds.encoders.JSON.cache.scratch = ''; com.newgrounds.encoders.JSON.cache.mode = 'string'; } else { if (v1 == '"') { _setTargetValue(com.newgrounds.encoders.JSON.cache.scratch); _useParent(); } else { if (v1 == '\\') { ++com.newgrounds.encoders.JSON.cache.pos; v1 = com.newgrounds.encoders.JSON.cache.arg.charAt(com.newgrounds.encoders.JSON.cache.pos); switch (v1) { case 'n': v1 = '\n'; break; case 'r': v1 = '\n'; break; case 't': v1 = '\t'; break; case 'u': v1 = '\\' + v1; } } com.newgrounds.encoders.JSON.cache.scratch += v1; } } ++com.newgrounds.encoders.JSON.cache.pos; } function _number() { var v1 = com.newgrounds.encoders.JSON.cache.arg.charAt(com.newgrounds.encoders.JSON.cache.pos); var v2 = '01234567890.-'; if (!com.newgrounds.encoders.JSON.cache.mode) { com.newgrounds.encoders.JSON.cache.mode = 'number'; com.newgrounds.encoders.JSON.cache.scratch = ''; } if (v2.indexOf(v1) < 0) { _setTargetValue(Number(com.newgrounds.encoders.JSON.cache.scratch)); _useParent(); } else { com.newgrounds.encoders.JSON.cache.scratch += v1; ++com.newgrounds.encoders.JSON.cache.pos; } } function _setTargetValue(newval) { var v2 = (_getParent()).obj; var v1 = com.newgrounds.encoders.JSON.cache.parents[com.newgrounds.encoders.JSON.cache.parents.length - 1]; v2[v1] = newval; } function _useParent() { com.newgrounds.encoders.JSON.cache.mode = com.newgrounds.encoders.JSON.getType((_getParent()).obj); com.newgrounds.encoders.JSON.cache.parents.pop(); } function _getParent() { var v2 = com.newgrounds.encoders.JSON.cache; var v1 = 0; while (v1 < com.newgrounds.encoders.JSON.cache.parents.length - 1) { v2 = v2[com.newgrounds.encoders.JSON.cache.parents[v1]]; ++v1; } return {'obj': v2, 'name': com.newgrounds.encoders.JSON.cache.parents[v1]}; } function _getCurrent() { var v2 = com.newgrounds.encoders.JSON.cache; var v1 = 0; while (v1 < com.newgrounds.encoders.JSON.cache.parents.length) { v2 = v2[com.newgrounds.encoders.JSON.cache.parents[v1]]; ++v1; } return {'obj': v2, 'name': com.newgrounds.encoders.JSON.cache.parents[v1]}; } function _addParent(child) { com.newgrounds.encoders.JSON.cache.parents.push(child); } function _addArrayKey() { var v1 = (_getCurrent()).obj.length; com.newgrounds.encoders.JSON.cache.parents.push(v1); com.newgrounds.encoders.JSON.cache.mode = null; } if (com.newgrounds.encoders.JSON.cache.pos >= com.newgrounds.encoders.JSON.cache.arg.length) { com.newgrounds.encoders.JSON.cache.complete = true; return undefined; } else { if (com.newgrounds.encoders.JSON.cache.mode) { ('_' + com.newgrounds.encoders.JSON.cache.mode)(); } else { var char = com.newgrounds.encoders.JSON.cache.arg.charAt(com.newgrounds.encoders.JSON.cache.pos); switch (char) { case '{': _object(); break; case '[': _array(); break; case '"': _string(); break; case 'n': _null(); break; case 't': _boolean(); break; case 'f': _boolean(); break; default: _number(); } } } }; v1.chunk_encoder = function () { if (com.newgrounds.encoders.JSON.cache.complete) { return undefined; } var v2 = com.newgrounds.encoders.JSON.getType(com.newgrounds.encoders.JSON.cache.target); switch (v2) { case 'number': com.newgrounds.encoders.JSON.cache.encoded += com.newgrounds.encoders.JSON.cache.target; com.newgrounds.encoders.JSON.getParent(); break; case 'string': com.newgrounds.encoders.JSON.cache.encoded += '"' + (com.newgrounds.encoders.JSON.cache.target.split('"')).join('\\"') + '"'; com.newgrounds.encoders.JSON.getParent(); break; case 'boolean': com.newgrounds.encoders.JSON.cache.encoded += (com.newgrounds.encoders.JSON.cache.target == true) ? 'true' : 'false'; com.newgrounds.encoders.JSON.getParent(); break; case 'null': com.newgrounds.encoders.JSON.cache.encoded += 'null'; com.newgrounds.encoders.JSON.getParent(); break; case 'array': if (com.newgrounds.encoders.JSON.cache.target.length < 1) { com.newgrounds.encoders.JSON.cache.encoded += ']'; com.newgrounds.encoders.JSON.getParent(); } else { com.newgrounds.encoders.JSON.cache.parents.push(com.newgrounds.encoders.JSON.cache.target); com.newgrounds.encoders.JSON.cache.target = com.newgrounds.encoders.JSON.cache.target[0]; if (com.newgrounds.encoders.JSON.getType(com.newgrounds.encoders.JSON.cache.target) == 'array') { com.newgrounds.encoders.JSON.cache.encoded += '['; } else { if (com.newgrounds.encoders.JSON.getType(com.newgrounds.encoders.JSON.cache.target) == 'object') { com.newgrounds.encoders.JSON.cache.encoded += '{'; } } } break; case 'object': for (var v1 in com.newgrounds.encoders.JSON.cache.target) { break; } if (v1 === undefined) { com.newgrounds.encoders.JSON.cache.encoded += '}'; com.newgrounds.encoders.JSON.getParent(); } else { com.newgrounds.encoders.JSON.cache.parents.push(com.newgrounds.encoders.JSON.cache.target); com.newgrounds.encoders.JSON.cache.target = com.newgrounds.encoders.JSON.cache.target[v1]; com.newgrounds.encoders.JSON.cache.encoded += '"' + (v1.split('"')).join('\\"') + '":'; if (com.newgrounds.encoders.JSON.getType(com.newgrounds.encoders.JSON.cache.target) == 'array') { com.newgrounds.encoders.JSON.cache.encoded += '['; } else { if (com.newgrounds.encoders.JSON.getType(com.newgrounds.encoders.JSON.cache.target) == 'object') { com.newgrounds.encoders.JSON.cache.encoded += '{'; } } } break; default: com.newgrounds.encoders.JSON.cache.encoded += 'null'; com.newgrounds.encoders.JSON.getParent(); } }; v1.getParent = function () { if (com.newgrounds.encoders.JSON.cache.parents.length > 0) { var v1 = com.newgrounds.encoders.JSON.cache.parents.pop(); if (com.newgrounds.encoders.JSON.getType(v1) == 'array') { v1.shift(); } else { for (var v3 in v1) { delete v1[v3]; break; } } if (com.newgrounds.encoders.JSON.getType(v1) == 'object' or com.newgrounds.encoders.JSON.getType(v1) == 'array') { for (var v2 in v1) { break; } if (v2 !== undefined) { com.newgrounds.encoders.JSON.cache.encoded += ','; } } com.newgrounds.encoders.JSON.cache.target = v1; } else { com.newgrounds.encoders.JSON.cache.complete = true; } }; v1.encode_chunks = 20000; v1.decode_chunks = 20000; v1.busy = false; ASSetPropFlags(com.newgrounds.encoders.JSON.prototype, null, 1); } #endinitclip } movieClip 37 __Packages.com.newgrounds.APIEventDispatcher { #initclip if (!_global.com) { _global.com = new Object(); } if (!_global.com.newgrounds) { _global.com.newgrounds = new Object(); } if (!_global.com.newgrounds.APIEventDispatcher) { var v1 = function () {}; com.newgrounds.APIEventDispatcher = v1; var v2 = v1.prototype; v2.addEventListener = function (event, callback, target) { if (!target) { throw 'Attempted to create a listener without providing a target object.'; } if (!this.listeners[event]) { this.listeners[event] = []; } else { this.removeEventListener(event, target); } this.listeners[event].push({'target': target, 'callback': callback}); }; v2.removeEventListener = function (event, target) { if (!target) { throw 'Attempted to remove a listener without providing a target object.'; } if (!this.listeners[event] || this.listeners[event].length < 1) { return undefined; } var v4 = []; var v2 = 0; while (v2 < this.listeners[event].length) { if (this.listeners[event][v2].target != target) { v4.push(this.listeners[event][v2]); } ++v2; } this.listeners[event] = v4; }; v2.dispatchEvent = function (event) { if (!this.hasEventListener(event.__get__type())) { return false; } this.collectGarbage(event.__get__type()); var v2 = 0; while (v2 < this.listeners[event.__get__type()].length) { var v4 = this.listeners[event.__get__type()][v2].callback; if (this.listeners[event.__get__type()][v2].target) { var v5 = this.listeners[event.__get__type()][v2].target; v4.call(v5, event); } else { v4(event); } ++v2; } return true; }; v2.hasEventListener = function (event) { return this.listeners[event] != undefined && this.listeners[event].length > 0; }; v2.collectGarbage = function (event) { var v5 = []; if (!this.hasEventListener) { return undefined; } var v2 = 0; while (v2 < this.listeners[event].length) { var v4 = this.listeners[event][v2].target; if (v4) { v5.push(this.listeners[event][v2]); } ++v2; } this.listeners[event] = v5; }; v2.listeners = {}; ASSetPropFlags(com.newgrounds.APIEventDispatcher.prototype, null, 1); } #endinitclip } movieClip 38 __Packages.com.newgrounds.encoders.MD5 { #initclip if (!_global.com) { _global.com = new Object(); } if (!_global.com.newgrounds) { _global.com.newgrounds = new Object(); } if (!_global.com.newgrounds.encoders) { _global.com.newgrounds.encoders = new Object(); } if (!_global.com.newgrounds.encoders.MD5) { var v1 = function () {}; com.newgrounds.encoders.MD5 = v1; var v2 = v1.prototype; v1.calculate = function (src) { return com.newgrounds.encoders.MD5.hex_md5(src); }; v1.hex_md5 = function (src) { return com.newgrounds.encoders.MD5.binl2hex(com.newgrounds.encoders.MD5.core_md5(com.newgrounds.encoders.MD5.str2binl(src), src.length * 8)); }; v1.core_md5 = function (x, len) { x[len >> 5] |= 128 << len % 32; x[(len + 64 >>> 9 << 4) + 14] = len; var v4 = 1732584193; var v3 = -271733879; var v2 = -1732584194; var v1 = 271733878; var v5 = 0; while (v5 < x.length) { var v10 = v4; var v9 = v3; var v8 = v2; var v7 = v1; v4 = com.newgrounds.encoders.MD5.md5_ff(v4, v3, v2, v1, x[v5 + 0], 7, -680876936); v1 = com.newgrounds.encoders.MD5.md5_ff(v1, v4, v3, v2, x[v5 + 1], 12, -389564586); v2 = com.newgrounds.encoders.MD5.md5_ff(v2, v1, v4, v3, x[v5 + 2], 17, 606105819); v3 = com.newgrounds.encoders.MD5.md5_ff(v3, v2, v1, v4, x[v5 + 3], 22, -1044525330); v4 = com.newgrounds.encoders.MD5.md5_ff(v4, v3, v2, v1, x[v5 + 4], 7, -176418897); v1 = com.newgrounds.encoders.MD5.md5_ff(v1, v4, v3, v2, x[v5 + 5], 12, 1200080426); v2 = com.newgrounds.encoders.MD5.md5_ff(v2, v1, v4, v3, x[v5 + 6], 17, -1473231341); v3 = com.newgrounds.encoders.MD5.md5_ff(v3, v2, v1, v4, x[v5 + 7], 22, -45705983); v4 = com.newgrounds.encoders.MD5.md5_ff(v4, v3, v2, v1, x[v5 + 8], 7, 1770035416); v1 = com.newgrounds.encoders.MD5.md5_ff(v1, v4, v3, v2, x[v5 + 9], 12, -1958414417); v2 = com.newgrounds.encoders.MD5.md5_ff(v2, v1, v4, v3, x[v5 + 10], 17, -42063); v3 = com.newgrounds.encoders.MD5.md5_ff(v3, v2, v1, v4, x[v5 + 11], 22, -1990404162); v4 = com.newgrounds.encoders.MD5.md5_ff(v4, v3, v2, v1, x[v5 + 12], 7, 1804603682); v1 = com.newgrounds.encoders.MD5.md5_ff(v1, v4, v3, v2, x[v5 + 13], 12, -40341101); v2 = com.newgrounds.encoders.MD5.md5_ff(v2, v1, v4, v3, x[v5 + 14], 17, -1502002290); v3 = com.newgrounds.encoders.MD5.md5_ff(v3, v2, v1, v4, x[v5 + 15], 22, 1236535329); v4 = com.newgrounds.encoders.MD5.md5_gg(v4, v3, v2, v1, x[v5 + 1], 5, -165796510); v1 = com.newgrounds.encoders.MD5.md5_gg(v1, v4, v3, v2, x[v5 + 6], 9, -1069501632); v2 = com.newgrounds.encoders.MD5.md5_gg(v2, v1, v4, v3, x[v5 + 11], 14, 643717713); v3 = com.newgrounds.encoders.MD5.md5_gg(v3, v2, v1, v4, x[v5 + 0], 20, -373897302); v4 = com.newgrounds.encoders.MD5.md5_gg(v4, v3, v2, v1, x[v5 + 5], 5, -701558691); v1 = com.newgrounds.encoders.MD5.md5_gg(v1, v4, v3, v2, x[v5 + 10], 9, 38016083); v2 = com.newgrounds.encoders.MD5.md5_gg(v2, v1, v4, v3, x[v5 + 15], 14, -660478335); v3 = com.newgrounds.encoders.MD5.md5_gg(v3, v2, v1, v4, x[v5 + 4], 20, -405537848); v4 = com.newgrounds.encoders.MD5.md5_gg(v4, v3, v2, v1, x[v5 + 9], 5, 568446438); v1 = com.newgrounds.encoders.MD5.md5_gg(v1, v4, v3, v2, x[v5 + 14], 9, -1019803690); v2 = com.newgrounds.encoders.MD5.md5_gg(v2, v1, v4, v3, x[v5 + 3], 14, -187363961); v3 = com.newgrounds.encoders.MD5.md5_gg(v3, v2, v1, v4, x[v5 + 8], 20, 1163531501); v4 = com.newgrounds.encoders.MD5.md5_gg(v4, v3, v2, v1, x[v5 + 13], 5, -1444681467); v1 = com.newgrounds.encoders.MD5.md5_gg(v1, v4, v3, v2, x[v5 + 2], 9, -51403784); v2 = com.newgrounds.encoders.MD5.md5_gg(v2, v1, v4, v3, x[v5 + 7], 14, 1735328473); v3 = com.newgrounds.encoders.MD5.md5_gg(v3, v2, v1, v4, x[v5 + 12], 20, -1926607734); v4 = com.newgrounds.encoders.MD5.md5_hh(v4, v3, v2, v1, x[v5 + 5], 4, -378558); v1 = com.newgrounds.encoders.MD5.md5_hh(v1, v4, v3, v2, x[v5 + 8], 11, -2022574463); v2 = com.newgrounds.encoders.MD5.md5_hh(v2, v1, v4, v3, x[v5 + 11], 16, 1839030562); v3 = com.newgrounds.encoders.MD5.md5_hh(v3, v2, v1, v4, x[v5 + 14], 23, -35309556); v4 = com.newgrounds.encoders.MD5.md5_hh(v4, v3, v2, v1, x[v5 + 1], 4, -1530992060); v1 = com.newgrounds.encoders.MD5.md5_hh(v1, v4, v3, v2, x[v5 + 4], 11, 1272893353); v2 = com.newgrounds.encoders.MD5.md5_hh(v2, v1, v4, v3, x[v5 + 7], 16, -155497632); v3 = com.newgrounds.encoders.MD5.md5_hh(v3, v2, v1, v4, x[v5 + 10], 23, -1094730640); v4 = com.newgrounds.encoders.MD5.md5_hh(v4, v3, v2, v1, x[v5 + 13], 4, 681279174); v1 = com.newgrounds.encoders.MD5.md5_hh(v1, v4, v3, v2, x[v5 + 0], 11, -358537222); v2 = com.newgrounds.encoders.MD5.md5_hh(v2, v1, v4, v3, x[v5 + 3], 16, -722521979); v3 = com.newgrounds.encoders.MD5.md5_hh(v3, v2, v1, v4, x[v5 + 6], 23, 76029189); v4 = com.newgrounds.encoders.MD5.md5_hh(v4, v3, v2, v1, x[v5 + 9], 4, -640364487); v1 = com.newgrounds.encoders.MD5.md5_hh(v1, v4, v3, v2, x[v5 + 12], 11, -421815835); v2 = com.newgrounds.encoders.MD5.md5_hh(v2, v1, v4, v3, x[v5 + 15], 16, 530742520); v3 = com.newgrounds.encoders.MD5.md5_hh(v3, v2, v1, v4, x[v5 + 2], 23, -995338651); v4 = com.newgrounds.encoders.MD5.md5_ii(v4, v3, v2, v1, x[v5 + 0], 6, -198630844); v1 = com.newgrounds.encoders.MD5.md5_ii(v1, v4, v3, v2, x[v5 + 7], 10, 1126891415); v2 = com.newgrounds.encoders.MD5.md5_ii(v2, v1, v4, v3, x[v5 + 14], 15, -1416354905); v3 = com.newgrounds.encoders.MD5.md5_ii(v3, v2, v1, v4, x[v5 + 5], 21, -57434055); v4 = com.newgrounds.encoders.MD5.md5_ii(v4, v3, v2, v1, x[v5 + 12], 6, 1700485571); v1 = com.newgrounds.encoders.MD5.md5_ii(v1, v4, v3, v2, x[v5 + 3], 10, -1894986606); v2 = com.newgrounds.encoders.MD5.md5_ii(v2, v1, v4, v3, x[v5 + 10], 15, -1051523); v3 = com.newgrounds.encoders.MD5.md5_ii(v3, v2, v1, v4, x[v5 + 1], 21, -2054922799); v4 = com.newgrounds.encoders.MD5.md5_ii(v4, v3, v2, v1, x[v5 + 8], 6, 1873313359); v1 = com.newgrounds.encoders.MD5.md5_ii(v1, v4, v3, v2, x[v5 + 15], 10, -30611744); v2 = com.newgrounds.encoders.MD5.md5_ii(v2, v1, v4, v3, x[v5 + 6], 15, -1560198380); v3 = com.newgrounds.encoders.MD5.md5_ii(v3, v2, v1, v4, x[v5 + 13], 21, 1309151649); v4 = com.newgrounds.encoders.MD5.md5_ii(v4, v3, v2, v1, x[v5 + 4], 6, -145523070); v1 = com.newgrounds.encoders.MD5.md5_ii(v1, v4, v3, v2, x[v5 + 11], 10, -1120210379); v2 = com.newgrounds.encoders.MD5.md5_ii(v2, v1, v4, v3, x[v5 + 2], 15, 718787259); v3 = com.newgrounds.encoders.MD5.md5_ii(v3, v2, v1, v4, x[v5 + 9], 21, -343485551); v4 = com.newgrounds.encoders.MD5.safe_add(v4, v10); v3 = com.newgrounds.encoders.MD5.safe_add(v3, v9); v2 = com.newgrounds.encoders.MD5.safe_add(v2, v8); v1 = com.newgrounds.encoders.MD5.safe_add(v1, v7); v5 += 16; } return new Array(v4, v3, v2, v1); }; v1.md5_cmn = function (q, a, b, x, s, t) { return com.newgrounds.encoders.MD5.safe_add(com.newgrounds.encoders.MD5.bit_rol(com.newgrounds.encoders.MD5.safe_add(com.newgrounds.encoders.MD5.safe_add(a, q), com.newgrounds.encoders.MD5.safe_add(x, t)), s), b); }; v1.md5_ff = function (a, b, c, d, x, s, t) { return com.newgrounds.encoders.MD5.md5_cmn(b & c | ~b & d, a, b, x, s, t); }; v1.md5_gg = function (a, b, c, d, x, s, t) { return com.newgrounds.encoders.MD5.md5_cmn(b & d | c & ~d, a, b, x, s, t); }; v1.md5_hh = function (a, b, c, d, x, s, t) { return com.newgrounds.encoders.MD5.md5_cmn(b ^ c ^ d, a, b, x, s, t); }; v1.md5_ii = function (a, b, c, d, x, s, t) { return com.newgrounds.encoders.MD5.md5_cmn(c ^ (b | ~d), a, b, x, s, t); }; v1.bit_rol = function (num, cnt) { return num << cnt | num >>> 32 - cnt; }; v1.safe_add = function (x, y) { var v1 = (x & 65535) + (y & 65535); var v2 = (x >> 16) + (y >> 16) + (v1 >> 16); return v2 << 16 | v1 & 65535; }; v1.str2binl = function (str) { var v3 = new Array(); var v4 = 255; var v1 = 0; while (v1 < str.length * 8) { v3[v1 >> 5] |= (str.charCodeAt(v1 / 8) & v4) << v1 % 32; v1 += 8; } return v3; }; v1.binl2hex = function (binarray) { var v4 = new String(''); var v3 = new String('0123456789abcdef'); var v1 = 0; while (v1 < binarray.length * 4) { v4 += v3.charAt(binarray[v1 >> 2] >> (v1 % 4) * 8 + 4 & 15) + v3.charAt(binarray[v1 >> 2] >> (v1 % 4) * 8 & 15); ++v1; } return v4; }; ASSetPropFlags(com.newgrounds.encoders.MD5.prototype, null, 1); } #endinitclip } movieClip 39 __Packages.com.newgrounds.components.APIConnector { #initclip if (!_global.com) { _global.com = new Object(); } if (!_global.com.newgrounds) { _global.com.newgrounds = new Object(); } if (!_global.com.newgrounds.components) { _global.com.newgrounds.components = new Object(); } if (!_global.com.newgrounds.components.APIConnector) { var v1 = function () { super(); this._x = Math.round(this._x); this._y = Math.round(this._y); if (this.fake_session and com.newgrounds.API.getHost() == 'localhost') { com.newgrounds.API.setFakeSession(true); } if (this.api_id && !com.newgrounds.API.isConnected()) { this.nextFrame(); this._visible = false; this.setGotoFrame('connecting'); if (this.error_screens) { com.newgrounds.API.addEventListener(com.newgrounds.APIEvent.NEW_VERSION_AVAILABLE, this.onNewVersion, this); com.newgrounds.API.addEventListener(com.newgrounds.APIEvent.HOST_BLOCKED, this.onBadHost, this); } if (this.medal_popups) { com.newgrounds.API.addEventListener(com.newgrounds.APIEvent.UNLOCK_MEDAL, this.doUnlock, this); } com.newgrounds.API.addEventListener(com.newgrounds.APIEvent.API_CONNECTED, this.onConnected, this); if (com.newgrounds.API.isPublishedHost()) { this.debug = false; } if (this.version) { com.newgrounds.API.setVersion(this.version); } if (!com.newgrounds.API.hasUserSession()) { var v3 = com.newgrounds.API.loadLocal('api_connector_data'); if (v3) { this.local_data = v3; } else { this.local_data = {'medals_unlocked': new Array()}; } } com.newgrounds.API.setPreload(true); com.newgrounds.API.connect(this.api_id, this.encryption_key, this.debug); } else { if (this.api_id && com.newgrounds.API.isConnected()) { this._visible = false; this.setGotoFrame('done'); } } this.stop(); }; com.newgrounds.components.APIConnector = v1; com.newgrounds.components.APIConnector extends MovieClip; var v2 = v1.prototype; v2.doUnlock = function (e) { var v5 = _root.attachMovie('NewgroundsAPIAsset_Medal_Popup', 'medal_pop_' + e.data.medal.getID(), _root.getNextHighestDepth()); if (e.data.x != undefined) { v5._x = e.data.x + 254; } else { v5._x = Stage.width; } if (e.data.x != undefined) { v5._y = e.data.y + 73; } else { v5._y = Stage.height; } v5.medal = e.data.medal; var v3 = com.newgrounds.API.getMedals(); var v2 = 0; while (v2 < v3.length) { if (v3[v2].getID() != e.data.medal.getID() && _root['medal_pop_' + v3[v2].getID()]) { _root['medal_pop_' + v3[v2].getID()]._y -= 70; } ++v2; } }; v2.onLoginError = function () { var v2 = _root.attachMovie('Asset_Login_Warning', 'Asset_Login_Warning', _root.getNextHighestDepth()); }; v2.onConnectionError = function () { var v3 = _root.attachMovie('Asset_Connection_Error', 'Asset_Connection_Error', _root.getNextHighestDepth()); this.setGotoFrame('done'); }; v2.onConnected = function (event, params) { if (event.success) { this.setGotoFrame('connected'); if (this.error_screens && com.newgrounds.API.isPublishedHost() && com.newgrounds.API.hasPublisher() && !com.newgrounds.API.hasUserSession()) { this.onLoginError(); } } else { if (this.error_screens) { this.onConnectionError(); } } }; v2.onNewVersion = function () { var v2 = _root.attachMovie('NewgroundsAsset_New_Version_Available', 'NewgroundsAsset_New_Version_Available', _root.getNextHighestDepth()); v2.official_version_url = com.newgrounds.API.getOfficialURL(); }; v2.onBadHost = function () { var v2 = _root.attachMovie('NewgroundsAsset_Illegal_Host', 'NewgroundsAsset_Illegal_Host', _root.getNextHighestDepth()); v2.official_version_url = com.newgrounds.API.getOfficialURL(); }; v2.setGotoFrame = function (frame) { if (this.goto_frame == null) { this.goto_frame = frame; this.gotoframe_interval = setInterval(this, 'gotoFrameIfLoaded', 50); } }; v2.gotoFrameIfLoaded = function () { if (this.goto_frame != null && this._framesloaded == this._totalframes) { this._visible = true; this.gotoAndStop(this.goto_frame); this.goto_frame = null; clearInterval(this.gotoframe_interval); } }; v2.goto_frame = null; ASSetPropFlags(com.newgrounds.components.APIConnector.prototype, null, 1); } #endinitclip } frame 2 { function __com_mochibot__(swfid, mc, lv, trk) { var x; var g; var s; var fv; var sb; var u; var res; var mb; var mbc; var pv; mb = '__mochibot__'; mbc = 'mochibot.com'; g = _global ? _global : _level0._root; if (g[mb + swfid]) { return g[mb + swfid]; } s = System.security; x = mc._root.getSWFVersion; fv = x ? mc.getSWFVersion() : (_global ? 6 : 5); if (!s) { s = {}; } sb = s.sandboxType; if (sb == 'localWithFile') { return null; } x = s.allowDomain; if (x) { s.allowDomain(mbc); } x = s.allowInsecureDomain; if (x) { s.allowInsecureDomain(mbc); } pv = (fv == 5) ? /:$version : System.capabilities.version; u = 'http://' + mbc + '/my/core.swf?mv=8&fv=' + fv + '&v=' + escape(pv) + '&swfid=' + escape(swfid) + '&l=' + lv + '&f=' + mc + (sb ? '&sb=' + sb : '') + (trk ? '&t=1' : ''); lv = fv > 6 ? mc.getNextHighestDepth() : (g[mb + 'level'] ? g[mb + 'level'] + 1 : lv); g[mb + 'level'] = lv; if (fv == 5) { res = '_level' + lv; if (!eval(res)) { loadMovieNum(u, lv); } return res; } res = mc.createEmptyMovieClip(mb + swfid, lv); res.loadMovie(u); return res; } __com_mochibot__('58152853', this, 10301, true); _root.kongregateServices.connect(); hint1._visible = false; hint2._visible = false; hint3._visible = false; var loadAmount = 4100000; var tick = 0; var mouseState = false; Mouse.addListener({'onMouseDown': function () { mouseState = true; }, 'onMouseUp': function () { mouseState = false; }}); onEnterFrame = function () { ++tick; var v1 = Math.floor((getBytesLoaded() / loadAmount) * 100); if (v1 > 10) { hint1._visible = true; } if (v1 > 30) { hint2._visible = true; } if (v1 > 50) { hint3._visible = true; } loading2.text = 'LOADED ' + v1; if (getBytesLoaded() > loadAmount) { if (tick % 45 > 8) { loading.text = 'PRESS TO'; loading2.text = 'START GAME'; } else { loading.text = ''; loading2.text = ''; } if (_xmouse > 330 && _ymouse > 400 && mouseState) { delete onEnterFrame; gotoAndPlay(7); } } else {} }; stop(); } movieClip 129 cover { } movieClip 136 light { frame 1 { stop(); } } movieClip 139 { } movieClip 140 { } movieClip 143 { } movieClip 157 { } movieClip 198 foes { } movieClip 201 { } movieClip 205 { } movieClip 208 { } movieClip 211 { } movieClip 214 { } movieClip 217 { } movieClip 220 { } movieClip 223 { } movieClip 226 { } movieClip 238 { } movieClip 241 newbit { } movieClip 242 punish { } movieClip 250 runbody { } movieClip 251 runbody2 { } movieClip 256 { } movieClip 259 { } movieClip 262 { } movieClip 265 { } movieClip 268 { } movieClip 271 { } movieClip 274 { } movieClip 277 { } movieClip 280 { } movieClip 283 runbodyg { } movieClip 287 runbodyp { } movieClip 290 shadow { } movieClip 292 weather { } movieClip 295 { } movieClip 306 boxes { } movieClip 313 man1 { } movieClip 318 man2 { } movieClip 322 shop1 { } movieClip 325 arrow { } movieClip 327 click { } movieClip 329 click2 { } movieClip 331 click3 { } movieClip 332 empty { } movieClip 334 fadeout { } movieClip 335 flat { } movieClip 340 hudvol { } movieClip 350 title { } movieClip 374 { frame 1 { stop(); } } movieClip 377 shopsearly { } movieClip 378 foesearly { } movieClip 387 backsearly { } movieClip 432 treatsearly { } movieClip 435 { } movieClip 436 blob2 { } movieClip 439 { } movieClip 440 blob3 { } movieClip 441 fade { } movieClip 443 sponsor { } movieClip 452 { } movieClip 483 { } movieClip 520 readback { } movieClip 546 endback { } movieClip 548 click4 { } // unknown tag 88 length 138 movieClip 551 puncs { } movieClip 554 burst { } movieClip 557 { } movieClip 558 refill { } movieClip 560 getup { } movieClip 619 { } movieClip 621 { } movieClip 623 { } movieClip 630 shopbuyearly { frame 1 { stop(); } } movieClip 633 mousebit { } frame 7 { new run(); stop(); } movieClip 666 treats { } movieClip 735 shopbuy { frame 1 { stop(); } } movieClip 742 shops { } movieClip 781 backs { } movieClip 793 soundbits { frame 1 { stop(); } } movieClip 805 ending { }




http://swfchan.com/20/96035/info.shtml
Created: 24/3 -2019 02:36:48 Last modified: 24/3 -2019 02:36:48 Server time: 13/05 -2024 09:25:31