Frame 1
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) ? (getVersion()) : (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);
}
} else {
res = mc.createEmptyMovieClip(mb + swfid, lv);
res.loadMovie(u);
}
return(res);
}
__com_mochibot__("a8a64ffd", this, 10301, true);
Stage.showMenu = false;
function playSound(id, offset, loops) {
d = sound_d++;
mc = sound.createEmptyMovieClip("s" + d, d);
snd = new Sound(mc);
mc.snd = snd;
snd.attachSound(id);
snd.mc = mc;
snd.onSoundComplete = function () {
this.mc.removeMovieClip();
};
snd.start(offset, loops);
return(mc);
}
_stageWidth = 800;
_stageHeight = 550;
Stage.scaleMode = "noScale";
_quality = "MEDIUM";
_root.createEmptyMovieClip("sound", _root.getNextHighestDepth());
_root.createEmptyMovieClip("music", _root.getNextHighestDepth());
snd = new Sound(music);
snd.setVolume(25);
snd = new Sound(sound);
snd.setVolume(45);
sound_d = 1;
Frame 2
_root.API_Settings = {movie_id:9838, enc_key:"kHu0xrTgO17VAyapito3KMsdZq7BHAAu", debug_mode:false, movie_version:""};
levelInfo = [];
info = {};
info.desc = "the first level";
info.name = "Intro";
info.type = "kill";
levelInfo.push(info);
info = {};
levelInfo.push(info);
info = {};
info.desc = "the second level";
info.name = "Intro2";
info.type = "kill";
levelInfo.push(info);
info = {};
info.type = "kill";
levelInfo.push(info);
info = {};
info.laptime = 20;
info.laps = 4;
info.desc = "race lvel";
info.name = "some race";
info.type = "race";
levelInfo.push(info);
info = {};
info.type = "kill";
levelInfo.push(info);
info = {};
info.type = "kill";
levelInfo.push(info);
info = {};
info.type = "kill";
levelInfo.push(info);
info = {};
info.laptime = 20;
info.laps = 4;
info.desc = "race lvel";
info.name = "some race";
info.type = "race";
levelInfo.push(info);
info = {};
info.type = "kill";
levelInfo.push(info);
info = {};
info.type = "kill";
levelInfo.push(info);
info = {};
info.type = "kill";
levelInfo.push(info);
info = {};
info.laptime = 20;
info.laps = 4;
info.desc = "race lvel";
info.name = "some race";
info.type = "race";
levelInfo.push(info);
info = {};
info.type = "kill";
levelInfo.push(info);
info = {};
info.type = "kill";
levelInfo.push(info);
info = {};
info.type = "kill";
levelInfo.push(info);
info = {};
info.laptime = 20;
info.laps = 4;
info.desc = "race lvel";
info.name = "some race";
info.type = "race";
levelInfo.push(info);
info = {};
info.type = "kill";
levelInfo.push(info);
info = {};
info.desc = "Golf Buggy Boss";
info.name = "Golf Buggy Boss";
info.type = "boss";
levelInfo.push(info);
info = {};
info.type = "kill";
levelInfo.push(info);
info = {};
info.type = "kill";
levelInfo.push(info);
info = {};
info.type = "kill";
levelInfo.push(info);
info = {};
info.laptime = 20;
info.laps = 4;
info.desc = "race lvel";
info.name = "some race";
info.type = "race";
levelInfo.push(info);
info = {};
info.type = "kill";
levelInfo.push(info);
info = {};
info.type = "kill";
levelInfo.push(info);
info = {};
info.type = "kill";
levelInfo.push(info);
info = {};
info.laptime = 20;
info.laps = 4;
info.desc = "race lvel";
info.name = "some race";
info.type = "race";
levelInfo.push(info);
info = {};
info.type = "kill";
levelInfo.push(info);
info = {};
info.type = "kill";
levelInfo.push(info);
info = {};
info.type = "kill";
levelInfo.push(info);
info = {};
info.laptime = 20;
info.laps = 4;
info.desc = "race lvel";
info.name = "some race";
info.type = "race";
levelInfo.push(info);
info = {};
info.type = "kill";
levelInfo.push(info);
info = {};
info.type = "kill";
levelInfo.push(info);
info = {};
info.type = "kill";
levelInfo.push(info);
info = {};
info.laptime = 15;
info.laps = 4;
info.desc = "race lvel";
info.name = "some race";
info.type = "race";
levelInfo.push(info);
info = {};
info.type = "kill";
levelInfo.push(info);
info = {};
info.type = "kill";
levelInfo.push(info);
info = {};
info.type = "kill";
levelInfo.push(info);
info = {};
info.laptime = 10;
info.laps = 7;
info.desc = "race lvel";
info.name = "some race";
info.type = "race";
levelInfo.push(info);
info = {};
info.type = "kill";
levelInfo.push(info);
info = {};
info.desc = "Golf Buggy Boss";
info.name = "Golf Buggy Boss";
info.type = "boss";
levelInfo.push(info);
info = {};
info.type = "kill";
levelInfo.push(info);
info = {};
info.laptime = 20;
info.laps = 4;
info.desc = "race lvel";
info.name = "some race";
info.type = "race";
levelInfo.push(info);
info = {};
info.type = "kill";
levelInfo.push(info);
info = {};
info.type = "kill";
levelInfo.push(info);
info = {};
info.laptime = 20;
info.desc = "race lvel";
info.name = "some race";
info.type = "race";
levelInfo.push(info);
info = {};
info.type = "kill";
levelInfo.push(info);
info = {};
info.type = "kill";
levelInfo.push(info);
info = {};
info.type = "kill";
levelInfo.push(info);
info = {};
info.laptime = 20;
info.laps = 4;
info.desc = "race lvel";
info.name = "some race";
info.type = "race";
levelInfo.push(info);
info = {};
info.type = "kill";
levelInfo.push(info);
info = {};
info.type = "kill";
levelInfo.push(info);
info = {};
info.desc = "Golf Buggy Boss";
info.name = "Golf Buggy Boss";
info.type = "boss";
levelInfo.push(info);
info = {};
info.type = "kill";
levelInfo.push(info);
info = {};
info.type = "kill";
levelInfo.push(info);
info = {};
info.laptime = 20;
info.laps = 4;
info.desc = "race lvel";
info.name = "some race";
info.type = "race";
levelInfo.push(info);
info = {};
info.type = "kill";
levelInfo.push(info);
info = {};
info.type = "kill";
levelInfo.push(info);
info = {};
info.laptime = 40;
info.laps = 2;
info.desc = "race lvel";
info.name = "some race";
info.type = "race";
levelInfo.push(info);
info = {};
info.type = "kill";
levelInfo.push(info);
info = {};
info.desc = "NG TANK";
info.name = "NG TANK";
info.type = "boss";
levelInfo.push(info);
Instance of Symbol 60 MovieClip in Frame 2
onClipEvent (load) {
this._alpha = 0;
this.onEnterFrame = function () {
this._alpha = this._alpha + 5;
if (this._alpha > 100) {
this._alpha = 100;
delete this.onEnterFrame;
}
};
}
Frame 4
function closeGarageDoors() {
playSound("garage_doors", 0.3);
garage_door.gotoAndPlay(1);
}
Instance of Symbol 945 MovieClip "garage_door" in Frame 4
onClipEvent (load) {
stop();
}
Frame 5
stop();
function registerSound(snd) {
my_sound = new Sound(_root.music);
my_sound.attachSound(snd);
my_sound.onSoundComplete = function () {
playSomeSound();
};
sounds.push(my_sound);
}
function playSomeSound() {
s = sounds[random(sounds.length)];
s.start();
}
if (!soundInitialized) {
sounds = [];
registerSound("TearsOfDawson");
registerSound("BrokenVows");
playSomeSound();
soundInitialized = true;
}
mute = false;
soundtoggle.onRelease = function () {
mute = !mute;
if (mute) {
this.gotoAndStop(2);
snd = new Sound(_root.music);
snd.setVolume(0);
} else {
this.gotoAndStop(1);
snd = new Sound(_root.music);
snd.setVolume(25);
}
};
function saveGame() {
so.data.kash = kash;
so.data.kills = kills;
so.data.upgrades = upgrades;
so.data.stats = stats;
so.data.maxlevel = maxlevel;
so.data.extras = extras;
so.flush();
}
function resumeGame() {
kash = so.data.kash;
kills = so.data.kills;
upgrades = so.data.upgrades;
stats = so.data.stats;
maxlevel = so.data.maxlevel;
if (so.data.extras == undefined) {
extras = {paint:[], tints:[], neons:[], money:[], extras:[]};
} else {
extras = so.data.extras;
}
level = maxlevel;
difficulty = 1;
if (kills == undefined) {
kills = 0;
}
}
function initNewGame() {
kash = 0;
kills = 0;
upgrades = {};
upgrades.backguns = 1;
upgrades.backgunsR = 1;
upgrades.exhaust = 1;
upgrades.missile = 1;
upgrades.car = 1;
upgrades.armour = 1;
upgrades.minigunL = 2;
upgrades.minigunR = 2;
upgrades.grillGuard = false;
upgrades.grillBlades = false;
upgrades.lights = true;
upgrades.carColour = 3;
upgrades.tintColour = 3;
upgrades.neonColour = 1;
upgrades.extra = 1;
stats = {};
stats.lifetimeKills = 0;
stats.lifetimeGunKills = 0;
stats.lifetimeMissileKills = 0;
stats.lifetimeKashEarnt = 0;
stats.lifetimeKashSpent = 0;
extras = {paint:[], tints:[], neons:[], money:[], extras:[]};
level = 1;
maxlevel = 1;
difficulty = 1;
}
function addExtra(type, num) {
for (ex in extras[type]) {
extra = extras[type][ex];
if (extra == num) {
trace("already have extra");
return(false);
}
}
extras[type].push(num);
trace("extra added");
}
function spendKash(num) {
trace(["spending", num, kash]);
if (num <= kash) {
stats.lifetimeKashSpent = stats.lifetimeKashSpent + num;
kash = kash - num;
_root.statKash = "$" + kash;
return(true);
}
_root.statKash = "$" + kash;
return(false);
}
function initGame() {
manList = [];
}
function startLevel() {
manList = [];
_root.gotoAndStop("game");
}
function gotoGarage() {
gotoAndStop ("garage");
}
function gotoLevelFinish() {
gotoAndStop ("levelfinish");
}
function addKash(k) {
kash = kash + k;
if (kash == NaN) {
trace("THE CASH FUCKED UP");
kash = 0;
}
stats.lifetimeKashEarnt = stats.lifetimeKashEarnt + k;
_root.statKash = "$" + kash;
}
function addKill() {
kills++;
stats.lifetimeKills++;
_root.statKills = kills;
}
function pulse(obj) {
d = obj._parent.getNextHighestDepth();
dup = obj.duplicateMovieClip("pulse" + d, d);
dup.clean = function () {
this.removeMovieClip();
};
caurina.transitions.Tweener.addTween(dup, {_xscale:150, _yscale:150, _alpha:0, time:0.8, delay:0, transition:"easeOutQuad", onComplete:dup.clean});
}
var so = SharedObject.getLocal("killkar2save");
trace(so.data.maxlevel);
stop();
Frame 6
stop();
addKash(0);
playMenuSnd = function () {
menuSnd.start();
};
c_y = centerpanel._y;
centerpanel._y = centerpanel._y - 800;
caurina.transitions.Tweener.addTween(centerpanel, {_y:c_y, time:1, delay:0, transition:"easeOutBack", onComplete:_root.playSound, onCompleteParams:["menusound_0"]});
l_x = leftpanel._x;
leftpanel._x = leftpanel._x - 250;
caurina.transitions.Tweener.addTween(leftpanel, {_x:l_x, time:1, delay:0, transition:"easeInExpo"});
r_x = rightpanel._x;
rightpanel._x = rightpanel._x + 250;
caurina.transitions.Tweener.addTween(rightpanel, {_x:r_x, time:1, delay:0, transition:"easeInExpo"});
Instance of Symbol 996 MovieClip in Frame 6
onClipEvent (load) {
basexs = _xscale;
baseys = _yscale;
_yscale = 200;
_xscale = 200;
_alpha = 0;
caurina.transitions.Tweener.addTween(this, {_alpha:100, _yscale:baseys, _xscale:basexs, time:0.5, delay:1, transition:"easeInQuart"});
}
Instance of Symbol 1274 MovieClip in Frame 6
on (release) {
_root.optionsMenu._visible = true;
}
Instance of Symbol 1317 MovieClip "optionsMenu" in Frame 6
onClipEvent (load) {
_visible = false;
}
Frame 7
stop();
Instance of Symbol 1319 MovieClip in Frame 7
onClipEvent (enterFrame) {
_root.debug_thing3._width = getTimer() - _root.startScript;
}
Instance of Symbol 1343 MovieClip "pickupnotice" in Frame 7
onClipEvent (load) {
function show(num) {
trace(["pickupnotics", num]);
this.gotoAndStop(num);
this._visible = true;
this._alpha = 150;
}
_visible = false;
}
onClipEvent (enterFrame) {
if (_visible) {
_alpha = (_alpha - 5);
if (_alpha < 0) {
_visible = false;
}
}
}
Instance of Symbol 1346 MovieClip "end_blackout" in Frame 7
onClipEvent (load) {
_alpha = 0;
_visible = false;
}
Instance of Symbol 1261 MovieClip "barMissiles" in Frame 7
on (release) {
_root.optionsMenu._visible = true;
}
Instance of Symbol 1319 MovieClip "debug_thing" in Frame 7
onClipEvent (enterFrame) {
_root.startScript = getTimer();
}
Instance of Symbol 1319 MovieClip "debug_thing2" in Frame 7
on (release) {
_root.game._visible = !_root.game._visible;
}
Instance of Symbol 1319 MovieClip "debug_thing3" in Frame 7
on (release) {
_root.game._visible = !_root.game._visible;
}
Frame 8
stop();
function checkMedalUnlockable(medalname) {
switch (medalname) {
case "Kraked" :
if (_root.maxlevel > 60) {
return(true);
}
break;
case "Kant Katch Up" :
if (_root.maxlevel > 58) {
return(true);
}
break;
case "Kan do" :
if (_root.maxlevel > 59) {
return(true);
}
break;
case "Kill-a-K" :
if (_root.kills > 1000) {
return(true);
}
break;
case "Kash Kow" :
if (_root.kash > 100000) {
return(true);
}
break;
case "Kustomized" :
if ((((_root.extras.paint.length > 32) && (_root.extras.tints.length > 50)) && (_root.extras.neons.length > 7)) && (_root.extras.extras.length > 7)) {
return(true);
}
break;
case "Krash the Kage" :
if (_root.maxlevel > 40) {
return(true);
}
break;
case "Kataklism" :
if (_root.kataklism) {
return(true);
}
break;
case "Krapped on" :
if (_root.krapped) {
return(true);
}
break;
case "Klean run" :
if (!_root.klean) {
break;
}
return(true);
}
return(false);
}
stop();
enkilled.txt = (("enemies killed: " + _root.numEnemiesKilled) + "/") + _root.numEnemies;
if (_root.numEnemiesKilled == _root.numEnemies) {
enkilled_bonus.txt = "+1000";
addKash(1000);
} else {
enkilled_bonus.txt = "+0";
}
timeleft.txt = "time left: " + (_root.timeLeft / 1000);
timeBonus = Math.floor(_root.timeLeft / 100);
timeleft_bonus.txt = "+" + timeBonus;
addKash(timeBonus);
if (!_root.levelWon) {
result.gotoAndStop(2);
_root.playSound("lvlend_lose" + random(4));
} else {
_root.playSound("lvlend_win" + random(3));
}
result.onEnterFrame = function () {
if (this.delay) {
this.delay--;
} else {
pulse(this.text);
this.delay = 40;
}
};
if (_root.level > _root.maxlevel) {
_root.maxlevel = _root.level;
}
got.txt = ("you got: " + Math.floor((100 * _root.numEnemiesKilled) / _root.numEnemies)) + "%";
if (_root.levelType == "race") {
req.txt = "";
got.txt = "";
}
level_over._xscale = (level_over._yscale = 1);
caurina.transitions.Tweener.addTween(level_over, {_xscale:100, _yscale:100, time:0.5, delay:0, transition:"easeInQuart", onComplete:pulse, onCompleteParams:[level_over]});
timeleft._xscale = (timeleft._yscale = 200);
timeleft._alpha = 0;
caurina.transitions.Tweener.addTween(timeleft, {_alpha:100, _yscale:100, _xscale:100, time:0.5, delay:1, transition:"easeInQuart"});
timeleft_bonus._xscale = (timeleft_bonus._yscale = 200);
timeleft_bonus._alpha = 0;
caurina.transitions.Tweener.addTween(timeleft_bonus, {_alpha:100, _yscale:100, _xscale:100, time:0.5, delay:1.2, transition:"easeInQuart"});
enkilled._xscale = (enkilled._yscale = 200);
enkilled._alpha = 0;
caurina.transitions.Tweener.addTween(enkilled, {_alpha:100, _yscale:100, _xscale:100, time:0.5, delay:1.5, transition:"easeInQuart"});
enkilled_bonus._xscale = (enkilled_bonus._yscale = 200);
enkilled_bonus._alpha = 0;
caurina.transitions.Tweener.addTween(enkilled_bonus, {_alpha:100, _yscale:100, _xscale:100, time:0.5, delay:1.7, transition:"easeInQuart"});
req._xscale = (req._yscale = 200);
req._alpha = 0;
caurina.transitions.Tweener.addTween(req, {_alpha:100, _yscale:100, _xscale:100, time:0.5, delay:2, transition:"easeInQuart"});
got._xscale = (got._yscale = 200);
got._alpha = 0;
caurina.transitions.Tweener.addTween(got, {_alpha:100, _yscale:100, _xscale:100, time:0.5, delay:2.2, transition:"easeInQuart"});
result._xscale = (result._yscale = 200);
result._alpha = 0;
caurina.transitions.Tweener.addTween(result, {_alpha:100, _yscale:100, _xscale:100, time:0.5, delay:2.5, transition:"easeInQuart"});
bg.onRelease = function () {
if (timeleft._alpha == 0) {
caurina.transitions.Tweener.addTween(timeleft, {_alpha:100, _yscale:100, _xscale:100, time:0.5, delay:0, transition:"easeInQuart"});
} else if (timeleft_bonus._alpha == 0) {
caurina.transitions.Tweener.addTween(timeleft_bonus, {_alpha:100, _yscale:100, _xscale:100, time:0.5, delay:0, transition:"easeInQuart"});
} else if (enkilled._alpha == 0) {
caurina.transitions.Tweener.addTween(enkilled, {_alpha:100, _yscale:100, _xscale:100, time:0.5, delay:0, transition:"easeInQuart"});
} else if (enkilled_bonus._alpha == 0) {
caurina.transitions.Tweener.addTween(enkilled_bonus, {_alpha:100, _yscale:100, _xscale:100, time:0.5, delay:0, transition:"easeInQuart"});
} else if (req._alpha == 0) {
caurina.transitions.Tweener.addTween(req, {_alpha:100, _yscale:100, _xscale:100, time:0.5, delay:0, transition:"easeInQuart"});
} else if (got._alpha == 0) {
caurina.transitions.Tweener.addTween(got, {_alpha:100, _yscale:100, _xscale:100, time:0.5, delay:0, transition:"easeInQuart"});
} else if (result._alpha == 0) {
caurina.transitions.Tweener.addTween(result, {_alpha:100, _yscale:100, _xscale:100, time:0.5, delay:0, transition:"easeInQuart"});
} else if (result._alpha == 100) {
_root.closeGarageDoors();
_root.sceneChange = function () {
_root.gotoGarage();
};
}
};
if (!_root.stats.cheater) {
tmp = com.Newgrounds.NewgroundsAPI.getMedals();
for (i in tmp) {
medal = tmp[i];
if (!medal.medal_unlocked) {
if (checkMedalUnlockable(medal.medal_name)) {
trace("UNLOCKING " + medal.medal_name);
_root.medal_popup.unlockMedal(medal.medal_name);
}
}
}
m = _root.test.pop();
trace(("_root.medal_popup.unlockMedal(\"" + m.medal_name) + "\");");
_root.medal_popup.unlockMedal(m.medal_name);
}
saveGame();
Instance of Symbol 1357 MovieClip "to_garage" in Frame 8
on (release) {
_root.gotoGarage();
}
Frame 9
_root.medal_popup.unlockMedal("Kraked");
Symbol 47 MovieClip Frame 1
com.Newgrounds.NewgroundsAPI.attachFlashAd(_parent[_name]);
var attachAd = function () {
com.Newgrounds.NewgroundsAPI.attachFlashAd(_parent[_name]);
};
com.Newgrounds.NewgroundsAPI.addEventListener(com.Newgrounds.NewgroundsAPI.events.ADS_APPROVED, attachAd);
background._visible = false;
Symbol 54 Button
on (release) {
getURL ("http://www.jazzastudios.com", "_blank");
}
Symbol 57 Button
on (release) {
getURL ("http://www.newgrounds.com/refer/jazza", "_blank");
}
Symbol 1427 MovieClip [__Packages.com.Newgrounds.BaseN] Frame 0
class com.Newgrounds.BaseN
{
var ceiling, hashIndex, bitSize, hashVal, i;
function BaseN (hash) {
ceiling = 100000000000000;
if (hash) {
hashIndex = hash;
} else {
hashIndex = "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ`~@#$%^&*()+|;/";
}
bitSize = hashIndex.length;
hashVal = new Object();
i = 0;
while (i < bitSize) {
hashVal[hashIndex.charAt(i)] = i;
i++;
}
}
function verify(s) {
if (hashVal[s] != undefined) {
return(true);
}
return(false);
}
function encode(n, minchars) {
debug.lastencode = "";
if (typeof(i) != "string") {
n = n.toString();
}
if (n.charAt(0) == "-") {
var _local3 = "-";
n = n.substring(1);
} else {
var _local3 = "";
}
if (String(n).indexOf(".") > -1) {
var _local4 = String(n).split(".", 2);
return(((_local3 + baseNEncoder(_local4[0], minchars)) + ".") + baseNEncoder(_local4[1]));
}
debug.lastencode = debug.lastencode + "\tNo decimal\r";
return(_local3 + baseNEncoder(n, minchars));
}
function decode(s) {
var _local4 = 1;
if (s.charAt(0) == "-") {
_local4 = -1;
s = s.substring(1, s.length);
}
var _local3 = s.indexOf(".");
if (_local3 > -1) {
var _local5 = Math.pow(10, baseNDecoder(s.substring(_local3 + 1, s.length)));
return((baseNDecoder(s.substring(0, _local3)) / _local5) * _local4);
}
return(baseNDecoder(s) * _local4);
}
function baseNEncoder(n, minchars) {
if (!minchars) {
minchars = 1;
}
var _local4 = "";
while (n != 0) {
n = Math.round(n);
var _local3 = n % bitSize;
if (Math.round(_local3) != _local3) {
trace((((((((("BaseN failed on " + n) + "%") + bitSize) + " = ") + _local3) + " ") + int(n)) + " ") + int(bitSize));
}
_local4 = hashIndex.charAt(_local3) + _local4;
debug.lastencode = debug.lastencode + (((((((("\t-> n:" + n) + " % bitSize:") + bitSize) + " = ") + _local3) + ", final char=") + _local4) + newline);
n = n - _local3;
n = n / bitSize;
}
if (minchars) {
while (_local4.length < minchars) {
_local4 = hashIndex.charAt(0) + _local4;
}
}
return(_local4);
}
function baseNDecoder(s) {
var _local2 = 0;
var _local6 = 0;
i = 0;
while (i < s.length) {
var _local3 = s.charAt((s.length - i) - 1);
if (_local3 == hashIndex.charAt(0)) {
var _local5 = 0;
} else {
var _local5 = hashVal[_local3] * Math.pow(bitSize, i);
}
_local2 = _local2 + _local5;
if (_local2 >= ceiling) {
_local6 = _local6 + ((_local2 - (_local2 % ceiling)) / ceiling);
_local2 = _local2 % ceiling;
}
i++;
}
if (_local6 > 0) {
_local2 = "" + _local2;
while (_local2.length < (ceiling.toString().length - 1)) {
_local2 = "0" + _local2;
}
_local2 = ("" + _local6) + _local2;
}
return(_local2);
}
var debug = new Object();
}
Symbol 1428 MovieClip [__Packages.com.Newgrounds.NewgroundsAPIError] Frame 0
class com.Newgrounds.NewgroundsAPIError
{
var message, name, alias;
function NewgroundsAPIError (error, msg) {
if (Number(error).toString() == String(error)) {
error = Number(error);
} else if (error_codes[String(error)]) {
error = error_codes[String(error)];
} else {
error = 0;
}
code = error;
message = msg;
name = error_names[error];
alias = aliases[error];
}
static function init_codes() {
var _local2 = new Object();
var _local1 = 0;
while (_local1 < aliases.length) {
_local2[aliases[_local1]] = _local1;
_local1++;
}
return(_local2);
}
static function init_names() {
var _local5 = new Array();
var _local3 = 0;
while (_local3 < aliases.length) {
var _local2 = aliases[_local3].toLowerCase().split("_");
var _local1 = 0;
while (_local1 < _local2.length) {
_local2[_local1] = _local2[_local1].substr(0, 1).toUpperCase() + _local2[_local1].substr(1, _local2[_local1].length);
for (var _local4 in always_caps) {
if (_local2[_local1].toUpperCase() == always_caps[_local4]) {
_local2[_local1] = _local2[_local1].toUpperCase();
}
}
_local1++;
}
_local5[_local3] = _local2.join(" ");
_local3++;
}
return(_local5);
}
function isError() {
return(true);
}
static var 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_FOLDER", "FILE_NOT_FOUND", "SITE_ID_REQUIRED", "UPLOAD_IN_PROGRESS", "USER_CANCELLED", "CONFIRM_REQUEST", "CONNECTION_FAILED");
static var always_caps = new Array("API", "URL", "ID");
static var error_codes = init_codes();
static var error_names = init_names();
var code = 0;
}
Symbol 1429 MovieClip [__Packages.com.Newgrounds.NewgroundsAPI] Frame 0
class com.Newgrounds.NewgroundsAPI
{
static var version, user_email, movie_id, debug, session_id, publisher_id, timeout, connected, tracker_id, encryption_key, user_id, user_name, host, error_format, normal_format, link_format, header_format, ad_url, ad_swf_url;
function NewgroundsAPI () {
}
static function setMovieVersion(v) {
if (v) {
version = String(v);
}
}
static function setUserEmail(e) {
user_email = e;
}
static function getOfficialVersionURL() {
var _local1 = (((((GATEWAY_URL + "?tracker_id=") + movie_id) + "&command_id=") + getCommandID("loadOfficalVersion")) + "&seed=") + Math.random();
if (debug) {
_local1 = _local1 + "&debug=1";
}
return(_local1);
}
static function hasUserSession() {
if (session_id && (publisher_id)) {
return(true);
}
if (_root.NewgroundsAPI_PublisherID && (_root.NewgroundsAPI_SessionID)) {
return(true);
}
return(false);
}
static function isNewgrounds() {
return(((publisher_id == 1) || (_root.NewgroundsAPI_PublisherID == 1)) || (getHost().toLowerCase().indexOf("ungrounded.net") > -1));
}
static function hasPublisher() {
return(publisher_id || (_root.NewgroundsAPI_PublisherID));
}
static function hasUserEmail() {
if (user_email) {
return(true);
}
return(false);
}
static function connectionTimeOut() {
clearInterval(timeout);
callListener(events.MOVIE_CONNECTED, false, new com.Newgrounds.NewgroundsAPIError("CONNECTION_FAILED", "Connection to NewgroundsAPI gateway timed out."));
}
static function connectMovie(m_id, encrypt_key, debug_mode) {
if (connected) {
return(undefined);
}
var _local2 = function () {
com.Newgrounds.NewgroundsAPI.connectionTimeOut();
};
timeout = setInterval(_local2, 8000, null);
if (!m_id) {
fatalError("NewgroundsAPI.connectMovie() - missing required movie_id parameter", "connectMovie");
}
movie_id = String(m_id);
tracker_id = Number(movie_id.substring(0, movie_id.indexOf(":")));
encryption_key = encrypt_key;
debug = debug_mode;
if (_root.NewgroundsAPI_PublisherID) {
publisher_id = _root.NewgroundsAPI_PublisherID;
if (_root.NewgroundsAPI_SessionID) {
session_id = _root.NewgroundsAPI_SessionID;
}
} else {
publisher_id = 1;
session_id = null;
user_id = 0;
user_name = "Guest";
}
if (_root.NewgroundsAPI_UserName) {
user_name = _root.NewgroundsAPI_UserName;
}
if (_root.NewgroundsAPI_UserID) {
user_id = _root.NewgroundsAPI_UserID;
}
connected = true;
sendCommand("connectMovie", {host:getHost(), movie_version:version});
}
static function getHost() {
if (!host) {
var _local1 = _url;
if ((_local1.indexOf("http://") > -1) or (_local1.indexOf("https://") > -1)) {
host = _local1.split("/")[2].toLowerCase();
} else {
host = "localhost";
}
}
return(host);
}
static function loadNewgrounds() {
sendCommand("loadNewgrounds", {host:getHost()}, true);
}
static function loadMySite() {
sendCommand("loadMySite", {host:getHost()});
}
static function loadCustomLink(link) {
sendCommand("loadCustomLink", {host:getHost(), link:link}, true);
}
static function logCustomEvent(event) {
sendCommand("logCustomEvent", {host:getHost(), event:event});
}
static function postScore(score, value, get_best) {
if ((!score) or (value == undefined)) {
sendError({command_id:getCommandID("postScore")}, new com.Newgrounds.NewgroundsAPIError("MISSING_PARAM", "missing required parameter(s)"));
return(undefined);
}
sendSecureCommand("postScore", {score:score, value:value, get_best:get_best});
}
static function getTodaysScores(score, params) {
getScores(score, "t", params, "getTodaysScores");
}
static function getYesterdaysScores(score, params) {
getScores(score, "y", params, "getYesterdaysScores");
}
static function getThisWeeksScores(score, params) {
getScores(score, "w", params, "getThisWeeksScores");
}
static function getThisMonthsScores(score, params) {
getScores(score, "m", params, "getThisMonthsScores");
}
static function getThisYearsScores(score, params) {
getScores(score, "y", params, "getThisYearsScores");
}
static function getAlltimeScores(score, params) {
getScores(score, "a", params, "getAlltimeScores");
}
static function getScores(score, period, params, command_name) {
if (!score) {
sendError({command_id:getCommandID(command_name)}, new com.Newgrounds.NewgroundsAPIError("MISSING_PARAM", "missing required score name"));
return(undefined);
}
if (!params) {
params = new Object();
}
if (!hasUserSession()) {
callListener(events.SCORES_LOADED, false, new com.Newgrounds.NewgroundsAPIError("SITE_ID_REQUIRED", ("Host '" + getHost()) + "' does not have high scores enabled"));
return(undefined);
}
params.publisher_id = publisher_id;
params.period = period;
params.score = score;
if (params.user_id) {
var _local3 = period;
} else {
var _local3 = period + "-u";
}
if (score_page_counts[_local3] == undefined) {
params.request_page_count = true;
}
sendCommand("getScores", params);
}
static function unlockMedal(medal, get_score) {
if (!medal) {
sendError({command_id:getCommandID("unlockMedal")}, new com.Newgrounds.NewgroundsAPIError("MISSING_PARAM", "missing required medal name"));
return(undefined);
}
var _local1 = new Object();
_local1.medal = medal;
if (get_score) {
_local1.get_score = get_score;
}
sendSecureCommand("unlockMedal", _local1);
}
static function loadMedals() {
if (medals) {
callListener(events.MEDALS_LOADED, true, {medals:medals});
return(undefined);
}
var _local1 = new Object();
if (hasUserSession()) {
_local1.publisher_id = publisher_id;
_local1.user_id = user_id;
}
sendCommand("getMedals", _local1);
}
static function getMedals() {
return(medals);
}
static function saveLocal(save_id, save_data, size_allocation) {
if (!sharedObjects[save_id]) {
sharedObjects[save_id] = SharedObject.getLocal((("ng_ap_secure_" + movie_id) + "_") + save_id);
}
sharedObjects[save_id].data[save_id] = encodeData(save_data);
sharedObjects[save_id].flush();
}
static function loadLocal(save_id) {
if (!sharedObjects[save_id]) {
sharedObjects[save_id] = SharedObject.getLocal((("ng_ap_secure_" + movie_id) + "_") + save_id);
}
sharedObjects[save_id].flush();
if (sharedObjects[save_id].data[save_id]) {
return(decodeData(sharedObjects[save_id].data[save_id]));
}
return(null);
}
static function encodeData(data) {
return(compressHex(com.Newgrounds.RC4.encrypt(com.Newgrounds.JSON.encode(data), encryption_key)));
}
static function decodeData(base) {
return(com.Newgrounds.JSON.decode(com.Newgrounds.RC4.decrypt(uncompressHex(base), encryption_key)));
}
static function compressHex(hex_value) {
var _local5 = hex_value.length % 6;
var _local4 = "";
var _local1 = 0;
while (_local1 < hex_value.length) {
var _local2 = Number("0x" + hex_value.substr(_local1, 6));
_local4 = _local4 + compressor.encode(_local2, 4);
_local1 = _local1 + 6;
}
return(_local5 + _local4);
}
static function uncompressHex(base_value) {
var _local8 = Number(base_value.charAt(0));
var _local7 = "";
var _local3;
var _local2 = 1;
while (_local2 < base_value.length) {
var _local6 = base_value.substr(_local2, 4);
var _local5 = compressor.decode(_local6);
var _local1 = dec2hex(_local5);
if ((_local2 + 4) < base_value.length) {
_local3 = 6;
} else {
_local3 = _local8;
}
while (_local1.length < _local3) {
_local1 = "0" + _local1;
}
_local7 = _local7 + _local1;
_local2 = _local2 + 4;
}
return(_local7);
}
static function dec2hex(dec) {
var _local4 = "0123456789ABCDEF";
var _local3 = "";
while (dec > 0) {
var _local2 = dec % 16;
_local3 = _local4.charAt(_local2) + _local3;
dec = (dec - _local2) / 16;
}
return(_local3);
}
static function saveFile(folder, filename, contents, thumbnail_source) {
if (!save_file) {
save_file = new com.Newgrounds.NewgroundsAPISaveFile(movie_id, folder, filename);
save_file.setContents(contents);
if (thumbnail_source) {
save_file.setThumbnail(thumbnail_source);
}
save_file.onError = function (msg) {
var _local1 = new com.Newgrounds.NewgroundsAPIError("PERMISSION_DENIED", msg);
com.Newgrounds.NewgroundsAPI.sendError({command_id:com.Newgrounds.NewgroundsAPI.getCommandID("saveFile")}, _local1);
com.Newgrounds.NewgroundsAPI.callListener(com.Newgrounds.NewgroundsAPI.events.FILE_SAVED, false, _local1);
};
save_file.onCancel = function (msg) {
var _local1 = new com.Newgrounds.NewgroundsAPIError("USER_CANCELLED", msg);
com.Newgrounds.NewgroundsAPI.callListener(com.Newgrounds.NewgroundsAPI.events.FILE_SAVED, false, _local1);
};
save_file.submit();
} else {
var _local1 = new com.Newgrounds.NewgroundsAPIError("UPLOAD_IN_PROGRESS", "Please wait for the previous file to finish uploading");
sendError({command_id:getCommandID("saveFile")}, _local1);
callListener(events.FILE_SAVED, false, _local1);
}
}
static function checkFilePrivs(folder, filename) {
if (user_id) {
var _local1 = user_id;
} else {
var _local1 = 0;
}
var _local2 = {folder:folder, filename:filename, user_id:_local1, publisher_id:publisher_id};
sendCommand("checkFilePrivs", _local2);
}
static function finishFileSave(folder, filename, description, share, file, thumbnail) {
var _local2;
_local2 = {folder:folder, filename:filename, description:description, share:share};
var _local1;
_local1 = {file:file, thumbnail:thumbnail};
sendSecureCommand("saveFile", _local2, null, _local1);
}
static function getFiles(folder, options) {
var _local7 = {name:1, date:2, score:3};
var _local2 = {user_only:false, sort_on:"date", page:1, results_per_page:20, sort_descending:true};
var _local6 = new Array();
for (var _local10 in _local7) {
_local6.push(("'" + _local10) + "'");
}
var _local4 = new Array();
for (var _local9 in _local2) {
_local4.push(("'" + _local9) + "'");
}
if (options.sort_descending && (!_local7[options.sort_descending])) {
var _local3 = new com.Newgrounds.NewgroundsAPIError("MISSING_PARAM", (("'" + options.sort_descending) + "' is not a valid sort_on value. Valid values are: ") + _local6.join(", "));
sendError({command_id:getCommandID("getFiles")}, _local3);
delete options.sort_descending;
}
var _local8;
if (options) {
for (var _local10 in options) {
if (_local2[_local10] == undefined) {
var _local3 = new com.Newgrounds.NewgroundsAPIError("MISSING_PARAM", (("'" + _local10) + "' is not a valid option. Valid options are: ") + _local4.join(", "));
sendError({command_id:getCommandID("getFiles")}, _local3);
delete options[_local10];
} else if (typeof(options[_local10]) != typeof(_local2[_local10])) {
var _local3 = new com.Newgrounds.NewgroundsAPIError("MISSING_PARAM", (("option '" + _local10) + "' should be the following type: ") + typeof(_local2[_local10]));
sendError({command_id:getCommandID("getFiles")}, _local3);
delete options[_local10];
}
}
_local8 = options;
} else {
_local8 = new Object();
}
if (hasUserSession()) {
_local8.publisher_id = publisher_id;
_local8.user_id = user_id;
}
_local8.folder = folder;
sendCommand("getFiles", _local8);
}
static function getConfirmation(command_name, event, msg, target, confirm, cancel) {
var _local1 = new com.Newgrounds.NewgroundsAPIError("CONFIRM_REQUEST", msg);
_local1.confirm = function () {
target[confirm]();
};
_local1.cancel = function () {
target[cancel]();
};
_local1.command = getCommandID(command_name);
callListener(event, false, _local1);
}
static function doBlockHost(event) {
_root.stop();
initTextFormats();
_root.createEmptyMovieClip("NGAPI_deny_host_overlay", _root.getNextHighestDepth());
_root.NGAPI_deny_host_overlay.lineStyle(20, 0, 100);
_root.NGAPI_deny_host_overlay.beginFill(6684672);
_root.NGAPI_deny_host_overlay.moveTo(0, 0);
_root.NGAPI_deny_host_overlay.lineTo(Stage.width, 0);
_root.NGAPI_deny_host_overlay.lineTo(Stage.width, Stage.height);
_root.NGAPI_deny_host_overlay.lineTo(0, Stage.height);
_root.NGAPI_deny_host_overlay.lineTo(0, 0);
_root.NGAPI_deny_host_overlay.endFill();
var _local2 = ("This movie has not been approved for use on " + getHost()) + ".";
_local2 = _local2 + "\r\rFor an aproved copy, please visit:\r";
var _local4 = _local2.length;
_local2 = _local2 + event.data.movie_url;
var _local3 = _local2.length;
_root.NGAPI_deny_host_overlay.createTextField("mousekill", 100, 0, 0, Stage.width, Stage.height);
_root.NGAPI_deny_host_overlay.createTextField("error", 101, (Stage.width - 400) / 2, (Stage.height / 2) - 100, 400, 200);
_root.NGAPI_deny_host_overlay.error.text = "ERROR!";
_root.NGAPI_deny_host_overlay.error.setTextFormat(error_format);
_root.NGAPI_deny_host_overlay.createTextField("message", 102, (Stage.width - 400) / 2, Stage.height / 2, 400, 200);
_root.NGAPI_deny_host_overlay.message.text = _local2;
_root.NGAPI_deny_host_overlay.message.multiline = true;
_root.NGAPI_deny_host_overlay.message.wordWrap = true;
_root.NGAPI_deny_host_overlay.message.html = true;
_root.NGAPI_deny_host_overlay.message.setTextFormat(normal_format);
link_format.url = event.data.redirect_url;
_root.NGAPI_deny_host_overlay.message.setTextFormat(_local4, _local3, link_format);
}
static function onNewVersionAvailable(event) {
_root.stop();
initTextFormats();
var _local2 = new Object();
_local2.x = Stage.width / 2;
_local2.y = Stage.height / 2;
_root.createEmptyMovieClip("NGAPI_new_version_overlay", _root.getNextHighestDepth());
_root.NGAPI_new_version_overlay.lineStyle(1, 0, 100);
_root.NGAPI_new_version_overlay.beginFill(0, 70);
_root.NGAPI_new_version_overlay.moveTo(-10, -10);
_root.NGAPI_new_version_overlay.lineTo(-10, 1000);
_root.NGAPI_new_version_overlay.lineTo(1000, 1000);
_root.NGAPI_new_version_overlay.lineTo(1000, -10);
_root.NGAPI_new_version_overlay.lineTo(-10, -10);
_root.NGAPI_new_version_overlay.endFill();
_root.NGAPI_new_version_overlay.lineStyle(10, 0, 100);
_root.NGAPI_new_version_overlay.beginFill(51);
_root.NGAPI_new_version_overlay.moveTo(_local2.x - 240, _local2.y - 120);
_root.NGAPI_new_version_overlay.lineTo(_local2.x + 240, _local2.y - 120);
_root.NGAPI_new_version_overlay.lineTo(_local2.x + 240, _local2.y + 80);
_root.NGAPI_new_version_overlay.lineTo(_local2.x - 240, _local2.y + 80);
_root.NGAPI_new_version_overlay.lineTo(_local2.x - 240, _local2.y - 120);
_root.NGAPI_new_version_overlay.endFill();
_root.NGAPI_new_version_overlay.createEmptyMovieClip("exit", 1000);
_root.NGAPI_new_version_overlay.exit.lineStyle(2, 39423, 100);
_root.NGAPI_new_version_overlay.exit.beginFill(0, 50);
_root.NGAPI_new_version_overlay.exit.moveTo(_local2.x + 210, _local2.y - 110);
_root.NGAPI_new_version_overlay.exit.lineTo(_local2.x + 230, _local2.y - 110);
_root.NGAPI_new_version_overlay.exit.lineTo(_local2.x + 230, _local2.y - 90);
_root.NGAPI_new_version_overlay.exit.lineTo(_local2.x + 210, _local2.y - 90);
_root.NGAPI_new_version_overlay.exit.lineTo(_local2.x + 210, _local2.y - 110);
_root.NGAPI_new_version_overlay.exit.endFill();
_root.NGAPI_new_version_overlay.exit.moveTo(_local2.x + 214, _local2.y - 106);
_root.NGAPI_new_version_overlay.exit.lineTo(_local2.x + 226, _local2.y - 94);
_root.NGAPI_new_version_overlay.exit.moveTo(_local2.x + 226, _local2.y - 106);
_root.NGAPI_new_version_overlay.exit.lineTo(_local2.x + 214, _local2.y - 94);
_root.NGAPI_new_version_overlay.exit.onMouseUp = function () {
if (_root.NGAPI_new_version_overlay.exit.hitTest(_root._xmouse, _root._ymouse)) {
_root.NGAPI_new_version_overlay.removeMovieClip();
}
};
var _local3 = (("Version " + event.data.movie_version) + " is now available at:") + newline;
var _local6 = _local3.length;
_local3 = _local3 + event.data.movie_url;
var _local4 = _local3.length;
_root.NGAPI_new_version_overlay.createTextField("mouseblocker", 99, -10, -10, 1000, 1000);
_root.NGAPI_new_version_overlay.createTextField("newversion", 100, _local2.x - 210, _local2.y - 90, 400, 80);
_root.NGAPI_new_version_overlay.newversion.text = "New Version Available!";
_root.NGAPI_new_version_overlay.newversion.setTextFormat(header_format);
_root.NGAPI_new_version_overlay.createTextField("message", 101, (Stage.width - 400) / 2, Stage.height / 2, 400, 40);
_root.NGAPI_new_version_overlay.message.text = _local3;
_root.NGAPI_new_version_overlay.message.multiline = true;
_root.NGAPI_new_version_overlay.message.wordWrap = true;
_root.NGAPI_new_version_overlay.message.html = true;
_root.NGAPI_new_version_overlay.message.setTextFormat(normal_format);
link_format.url = event.data.redirect_url;
_root.NGAPI_new_version_overlay.message.setTextFormat(_local6, _local4, link_format);
}
static function initTextFormats() {
if (!error_format) {
error_format = new TextFormat();
error_format.font = "Arial Black";
error_format.size = 48;
error_format.color = 16711680 /* 0xFF0000 */;
}
if (!header_format) {
header_format = new TextFormat();
header_format.font = "Arial Black";
header_format.size = 24;
header_format.color = 16777215 /* 0xFFFFFF */;
}
if (!normal_format) {
normal_format = new TextFormat();
normal_format.font = "Arial";
normal_format.bold = true;
normal_format.size = 12;
normal_format.color = 16777215 /* 0xFFFFFF */;
}
if (!link_format) {
link_format = new TextFormat();
link_format.color = 16776960 /* 0xFFFF00 */;
link_format.underline = true;
}
}
static function doEvent(e) {
switch (getCommandName(e.command_id)) {
case "connectMovie" :
clearInterval(timeout);
sendMessage("You have successfully connected to the Newgrounds API Gateway");
sendMessage(("Movie identified as \"" + e.movie_name) + "\"");
callListener(events.MOVIE_CONNECTED, e.success, {movie_name:e.movie_name});
var _local4 = false;
if (e.ad_status === -1) {
var _local6 = "This movie was not approved to run Flash Ads.";
sendWarning(_local6);
sendWarning(("visit " + AD_TERMS_URL) + " to view our approval guidelines");
if (!e.ad_url) {
callListener(events.ADS_APPROVED, false, new com.Newgrounds.NewgroundsAPIError("FLASH_ADS_NOT_APPROVED", _local6));
} else {
_local4 = true;
}
} else if (e.ad_status === 0) {
var _local6 = "Flash Ads are currently awaiting approval.";
sendNotice(_local6);
if (!e.ad_url) {
callListener(events.ADS_APPROVED, false, new com.Newgrounds.NewgroundsAPIError("FLASH_ADS_NOT_APPROVED", _local6));
} else {
_local4 = true;
}
}
if (e.ad_url) {
ad_url = unescape(e.ad_url);
if (!_local4) {
sendMessage("This movie has been approved to run Flash Ads!");
}
callListener(events.ADS_APPROVED, true);
}
if (e.deny_host) {
var _local6 = getHost() + " does not have permission to run this movie!";
sendWarning(_local6);
sendWarning("\tUpdate your API configuration to unblock " + getHost());
callListener(events.HOST_BLOCKED, true, {movie_url:unescape(e.movie_url), redirect_url:getOfficialVersionURL()});
}
if (e.movie_version) {
sendWarning("According to your API Configuration, this version is out of date.");
if (version) {
sendWarning("\tThe this movie is version " + version);
}
sendWarning("\tThe most current version is " + e.movie_version);
callListener(events.NEW_VERSION_AVAILABLE, true, {movie_version:e.movie_version, movie_url:unescape(e.movie_url), redirect_url:getOfficialVersionURL()});
}
if (e.request_portal_url) {
sendCommand("setPortalID", {portal_url:_url});
}
break;
case "logCustomEvent" :
if (e.success) {
sendMessage(("Event '" + e.event) + "' was logged.");
}
callListener(events.EVENT_LOGGED, e.success, {event:e.event});
break;
case "postScore" :
var _local7;
if (e.success) {
var _local3 = "User";
if (user_email) {
_local3 = user_email;
} else if (user_name) {
_local3 = user_name;
}
sendMessage(((((_local3 + " posted ") + e.value) + " to '") + e.score) + "'");
_local7 = {score:e.score, value:e.value, username:_local3};
}
callListener(events.SCORE_POSTED, e.success, _local7);
break;
case "getScores" :
_local7 = new Object();
if (e.user_id) {
var _local5 = e.period;
} else {
var _local5 = e.period + "-u";
}
if (e.total_pages) {
score_page_counts[_local5] = e.total_pages;
}
_local7.user_id = e.user_id;
_local7.current_page = e.current_page;
_local7.total_pages = score_page_counts[_local5];
_local7.scores = e.scores;
_local7.period = getPeriodName(e.period);
callListener(events.SCORES_LOADED, e.success, _local7);
break;
case "unlockMedal" :
if (medals) {
var _local2 = 0;
while (_local2 < medals.length) {
if (medals[_local2].medal_name === e.medal_name) {
medals[_local2].medal_unlocked = true;
break;
}
_local2++;
}
}
_local7 = {medal_name:e.medal_name, medal_value:e.medal_value, medal_difficulty:e.medal_difficulty};
callListener(events.MEDAL_UNLOCKED, e.success, _local7);
break;
case "getMedals" :
medals = e.medals;
_local7 = {medals:e.medals};
callListener(events.MEDALS_LOADED, e.success, _local7);
break;
case "getFiles" :
break;
case "getSystemFiles" :
break;
case "saveFile" :
save_file = null;
_local7 = {file_id:e.file_id, filename:e.filename, file_url:e.file_url, thumbnail:e.thumbnail, icon:e.icon};
callListener(events.FILE_SAVED, e.success, _local7);
break;
case "checkFilePrivs" :
if (save_file) {
save_file.checkPrivs(e);
} else {
_local7 = {filename:e.filename, folder:e.folder, can_read:e.can_read, can_write:e.can_write};
callListener(events.FILE_PRIVS_LOADED, e.success, _local7);
}
}
}
static function setDefaultListeners() {
var _local1 = new Array();
_local1[events.HOST_BLOCKED] = {listener:doBlockHost};
_local1[events.NEW_VERSION_AVAILABLE] = {listener:onNewVersionAvailable};
return(_local1);
}
static function addEventListener(event, listener, params) {
listeners[event] = {listener:listener, params:params};
}
static function removeEventListener(event) {
delete listeners[event];
}
static function getEventName(event) {
for (var _local2 in events) {
if (events[_local2] == event) {
return(_local2);
}
}
return(undefined);
}
static function callListener(event, success, data, target) {
echo("Fired Event: " + getEventName(event));
if (listeners[event]) {
if (data.isError()) {
listeners[event].listener({event:event, success:success, error:data, target:target}, listeners[event].params);
} else {
listeners[event].listener({event:event, success:success, data:data, target:target}, listeners[event].params);
}
}
}
static function getCommandName(id) {
return(id);
}
static function getCommandID(name) {
return(name);
}
static function getPeriodAliases() {
var _local1 = new Object();
for (var _local2 in period_aliases) {
_local1[period_aliases[_local2].alias] = _local2;
}
return(_local1);
}
static function getPeriodName(p) {
for (var _local2 in period_aliases) {
if (_local2 == p) {
return(period_aliases[_local2].name);
}
}
return(null);
}
static function getPeriodAlias(p) {
for (var _local2 in period_aliases) {
if (_local2 == p) {
return(period_aliases[_local2].alias);
}
}
return(null);
}
static function sendError(c, e) {
trace((((((("[NewgroundsAPI ERROR] :: " + getCommandName(c.command_id)) + "() - ") + e.name) + ":") + newline) + "\t\t\t\t") + e.message);
}
static function sendWarning(m, c) {
if (c) {
m = m + ((("\r[NewgroundsAPI WARNING] :: \tSee " + COMMANDS_WIKI_URL) + c.toLowerCase()) + " for additional information.");
}
trace("[NewgroundsAPI WARNING] :: " + m);
}
static function sendNotice(m, c) {
if (c) {
m = m + ((("\r[NewgroundsAPI NOTICE] :: \tSee " + COMMANDS_WIKI_URL) + c.toLowerCase()) + " for additional information.");
}
trace("[NewgroundsAPI NOTICE] :: " + m);
}
static function fatalError(m, c) {
if (c) {
m = m + ((("\r\tSee " + COMMANDS_WIKI_URL) + c.toLowerCase()) + " for additional information.");
}
throw (((("***ERROR*** frame=" + _root._currentframe) + ", class=NewgroundsAPI") + newline) + newline) + m;
}
static function sendSecureCommand(command, secure_params, unsecure_params, files) {
if (((!debug) && (!hasUserSession())) && (!hasUserEmail())) {
sendError({command_id:getCommandID(command)}, new com.Newgrounds.NewgroundsAPIError("IDENTIFICATION_REQUIRED", ("You must be logged in or provide an e-mail address ( using NewgroundsAPI.setUserEmail(\"name@domain.com\"); ) to use " + command) + "()."));
return(undefined);
}
if (!command) {
fatalError("Missing command", "sendSecureCommand");
}
if (!secure_params) {
fatalError("Missing secure_params", "sendSecureCommand");
}
if (!unsecure_params) {
unsecure_params = new Object();
}
var _local2 = "";
var _local1 = 0;
while (_local1 < 16) {
_local2 = _local2 + compression_radix.charAt(Math.floor(Math.random() * compression_radix.length));
_local1++;
}
if (debug) {
secure_params.session_id = "";
} else {
secure_params.session_id = session_id;
}
secure_params.as_version = 2;
secure_params.user_email = user_email;
secure_params.publisher_id = publisher_id;
secure_params.seed = _local2;
secure_params.command_id = getCommandID(command);
var _local8 = com.Newgrounds.MD5.calculate(_local2);
var _local6 = com.Newgrounds.RC4.encrypt(com.Newgrounds.JSON.encode(secure_params), encryption_key);
var _local7 = _local8 + _local6;
unsecure_params.secure = compressHex(_local7);
sendCommand("securePacket", unsecure_params, false, files);
}
static function sendCommand(command, params, open_browser, files) {
if ((!connected) and (command != "connectMovie")) {
var _local11 = (("NewgroundsAPI." + command) + "() - NewgroundsAPI.connectMovie() must be called before this command can be called") + newline;
fatalError(_local11, "connectMovie");
}
if (open_browser) {
var _local1 = new Object();
} else {
var _local1 = new LoadVars();
}
_local1.command_id = getCommandID(command);
_local1.tracker_id = movie_id;
if (debug) {
_local1.debug = debug;
}
if (params) {
for (var _local8 in params) {
_local1[_local8] = params[_local8];
}
}
if (files) {
for (var _local8 in files) {
_local1[_local8] = files[_local8];
}
}
echo(("OUTPUT: \r" + com.Newgrounds.JSON.encode(_local1)) + newline);
if (open_browser) {
var _local5 = (GATEWAY_URL + "?seed=") + Math.random();
for (var _local8 in _local1) {
_local5 = _local5 + ((("&" + escape(_local8)) + "=") + escape(_local1[_local8]));
}
getURL (_local5, "_blank");
_local1.removeMovieClip();
} else {
var _local9 = new LoadVars();
_local9.onData = function (data) {
com.Newgrounds.NewgroundsAPI.echo(("INPUT: \r" + data) + newline);
if (data) {
var _local1 = com.Newgrounds.JSON.decode(data);
} else {
var _local1 = {success:false};
}
if (!_local1.success) {
var _local3 = new com.Newgrounds.NewgroundsAPIError(_local1.error_code, _local1.error_msg);
com.Newgrounds.NewgroundsAPI.sendError(_local1, _local3);
} else {
com.Newgrounds.NewgroundsAPI.doEvent(_local1);
}
};
var _local4 = new Array();
for (var _local7 in _local1) {
_local4.push((_local7 + "=") + escape(_local1[_local7]));
}
echo((("POST " + GATEWAY_URL) + "?") + _local4.join("&"));
_local1.sendAndLoad((GATEWAY_URL + "?seed=") + Math.random(), _local9, "POST");
}
}
static function renderAd(target) {
if (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);
loadMovie (ad_swf_url, target.clip.ad);
callListener(events.AD_ATTACHED, true, null, target);
} else {
callListener(events.AD_ATTACHED, false, new com.Newgrounds.NewgroundsAPIError("FLASH_ADS_NOT_APPROVED", "Unable to render ad"));
}
}
static function attachFlashAd(target) {
System.security.allowDomain("http://server.cpmstar.com");
System.security.allowDomain("http://www.cpmstar.com");
System.security.allowDomain("https://server.cpmstar.com");
System.security.allowDomain("https://www.cpmstar.com");
System.security.allowInsecureDomain("http://server.cpmstar.com");
System.security.allowInsecureDomain("http://www.cpmstar.com");
System.security.allowInsecureDomain("https://server.cpmstar.com");
System.security.allowInsecureDomain("https://www.cpmstar.com");
sendMessage("You may get a security sandbox violation from this ad. This is nothing to worry about!");
if (resetAdTimer()) {
if (ad_url) {
var _local1 = new LoadVars();
_local1.onData = function (data) {
if (data) {
com.Newgrounds.NewgroundsAPI.ad_swf_url = data;
} else {
com.Newgrounds.NewgroundsAPI.ad_swf_url = null;
}
com.Newgrounds.NewgroundsAPI.renderAd(target);
};
if (ad_url.indexOf("?") > -1) {
_local1.load((ad_url + "&random=") + Math.random());
} else {
_local1.load((ad_url + "?random=") + Math.random());
}
}
} else {
renderAd(target);
}
}
static function resetAdTimer() {
if (!ad_url) {
return(false);
}
var _local1 = new Date();
if (_local1.getTime() >= ad_reset) {
ad_reset = _local1.getTime() + 300000;
return(true);
}
return(false);
}
static function sendMessage(m, r) {
var _local1 = "[NewgroundsAPI] :: " + m;
if (r) {
return(_local1);
}
trace(_local1);
}
static function echo(m) {
if (do_echo) {
trace(m);
}
}
static var do_echo = false;
static var GATEWAY_URL = "http://www.ngads.com/gateway_v2.php";
static var AD_TERMS_URL = "http://www.newgrounds.com/wiki/flashads/terms/";
static var COMMANDS_WIKI_URL = "http://www.newgrounds.com/wiki/flashapi/commands/";
static var ad_reset = 0;
static var save_file = null;
static var medals = null;
static var score_page_counts = new Object();
static var compression_radix = "/g8236klvBQ#&|;Zb*7CEA59%s`Oue1wziFp$rDVY@TKxUPWytSaGHJ>dmoMR^<0~4qNLhc(I+fjn)X";
static var compressor = new com.Newgrounds.BaseN(compression_radix);
static var errors = com.Newgrounds.NewgroundsAPIError.init_codes();
static var sharedObjects = new Object();
static var events = {MOVIE_CONNECTED:1, ADS_APPROVED:2, AD_ATTACHED:3, HOST_BLOCKED:4, NEW_VERSION_AVAILABLE:5, EVENT_LOGGED:6, SCORE_POSTED:7, SCORES_LOADED:8, MEDAL_UNLOCKED:9, MEDALS_LOADED:10, FILE_PRIVS_LOADED:11, FILE_SAVED:12};
static var listeners = setDefaultListeners();
static var periods = getPeriodAliases();
static var period_aliases = {t:{name:"Today", alias:"TODAY"}, p:{name:"Yesterday", alias:"YESTERDAY"}, w:{name:"This Week", alias:"THIS_WEEK"}, m:{name:"This Month", alias:"THIS_MONTH"}, y:{name:"This Year", alias:"THIS_YEAR"}, a:{name:"All-Time", alias:"ALL_TIME"}};
}
Symbol 1430 MovieClip [__Packages.com.Newgrounds.NewgroundsAPISaveFile] Frame 0
class com.Newgrounds.NewgroundsAPISaveFile
{
var tracker_id, folder, filename, contents, thumbnail, icon_url, thumbnail_url, description, scan, scanner;
function NewgroundsAPISaveFile (tracker_id, folder, filename) {
this.tracker_id = tracker_id;
this.folder = folder;
this.filename = filename;
contents = null;
thumbnail = null;
icon_url = null;
thumbnail_url = null;
}
function setDescription(description) {
this.description = description;
}
function setShared(share) {
this.share = share;
}
function setContents(contents) {
this.contents = contents;
}
function setThumbnail(thumb) {
if (thumb) {
thumbnail = thumb;
} else {
thumbnail = null;
}
}
function onError(msg) {
trace("[NewgroundsAPISaveFile ERROR] :: " + msg);
}
function onCancel(msg) {
trace("[NewgroundsAPISaveFile] :: " + msg);
}
function submit() {
scan = null;
com.Newgrounds.NewgroundsAPI.checkFilePrivs(folder, filename);
}
function checkPrivs(p) {
if (p.success) {
if (p.can_write) {
can_write = p.can_write;
if (p.exists) {
com.Newgrounds.NewgroundsAPI.getConfirmation("saveFile", com.Newgrounds.NewgroundsAPI.events.FILE_SAVED, ("File '" + filename) + "' exists, overwrite?", this, "startFile", "cancelFile");
} else {
startFile();
}
} else {
onError("This filename is owned by another user.");
}
} else {
onError("There was a problem looking up your file's details");
}
}
function cancelFile() {
onCancel("Overwrite was cancelled");
}
function startFile() {
if (can_write) {
if (thumbnail) {
scanner = new com.Newgrounds.ImageScanner(thumbnail);
scanner.setCallback(this, "writeFile");
scanner.startScan(100, 100, true);
} else {
writeFile();
}
} else {
onError(("You cannot write to filename \"" + filename) + "\"");
}
}
function writeFile(img) {
trace("FINISHED");
com.Newgrounds.NewgroundsAPI.finishFileSave(folder, filename, description, share, com.Newgrounds.JSON.encode(contents), img);
}
var can_write = false;
var share = true;
}
Symbol 1431 MovieClip [__Packages.com.Newgrounds.ImageScanner] Frame 0
class com.Newgrounds.ImageScanner
{
var image_source, source_width, source_height, sourceBitmap, callback_target, callback_function, hash, cube, basen, xpos, ypos, pixels, busy, canvas_width, canvas_height, resizedBitmap, copyBitmap, output, draw_interval, callback_interval;
function ImageScanner (the_source) {
if (the_source) {
image_source = the_source;
} else {
image_source = _root;
}
reset();
if (typeof(image_source) == "movieclip") {
if (image_source == _root) {
source_width = Stage.width;
source_height = Stage.height;
} else {
source_width = Math.floor(image_source._width);
source_height = Math.floor(image_source._height);
}
sourceBitmap = new flash.display.BitmapData(source_width, source_height, false, 4294967295);
sourceBitmap.draw(_root);
} else if (image_source.width) {
source_width = image_source.width;
source_height = image_source.height;
sourceBitmap = image_source;
} else {
error("You can only use BitMaptData and MovieClip objects to create images");
}
}
function setCallback(target, funct) {
if (target && (funct)) {
callback_target = target;
callback_function = funct;
}
}
function reset() {
callback_target = null;
callback_function = null;
debug.bad_pixels = 0;
hash = "0123456789aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ<>?:;-_=+()!&";
var _local3 = Math.pow(hash.length, 2);
trace("MAX COLORS: " + _local3);
var _local2 = Math.floor(Math.pow(_local3, 0.333333333333333)) - 1;
var _local4 = Math.pow(_local2, 3);
cube = _local2;
basen = new com.Newgrounds.BaseN(hash);
xpos = 0;
ypos = 0;
pixels = 0;
busy = false;
}
function startScan(w, h, s) {
if (w) {
image_width = w;
}
if (h) {
image_height = h;
}
if (s != undefined) {
crop = s;
}
var _local7 = _root.getNextHighestDepth();
var _local6 = _root.createEmptyMovieClip("API_image_container_" + _local7, _local7);
var _local5 = _local6.createEmptyMovieClip("canvas", 100);
_local5.attachBitmap(sourceBitmap, 100);
if (crop) {
if ((image_width / source_width) > (image_height / source_height)) {
canvas_width = image_width;
canvas_height = Math.ceil(source_height * (image_width / source_width));
} else {
canvas_height = image_height;
canvas_width = Math.ceil(source_width * (image_height / source_height));
}
} else {
canvas_width = image_width;
canvas_height = image_height;
}
_local5._x = Math.round((image_width - canvas_width) / 2);
_local5._width = canvas_width;
_local5._height = canvas_height;
resizedBitmap = new flash.display.BitmapData(image_width, image_height, false, 4294967295);
resizedBitmap.draw(_local6);
_local6.removeMovieClip();
copyBitmap = new flash.display.BitmapData(image_width, image_height, false, 4294967295);
var _local3 = "" + image_width;
while (_local3.length < 3) {
_local3 = "0" + _local3;
}
var _local4 = "" + image_height;
while (_local4.length < 3) {
_local4 = "0" + _local4;
}
output = _local3 + _local4;
draw_interval = setInterval(this, "drawChunk", 10);
busy = false;
return(resizedBitmap);
}
function getBitmapData() {
return(copyBitmap);
}
function getBytesTotal() {
return((image_width * image_height) * 2);
}
function getBytesScanned() {
return(pixels * 2);
}
function drawChunk() {
if (!busy) {
busy = true;
var _local2 = 0;
while (_local2 < 250) {
if (!nextPixel()) {
clearInterval(draw_interval);
callback_interval = setInterval(this, "doCallback", 25);
busy = true;
break;
}
_local2++;
}
busy = false;
}
}
function doCallback() {
busy = false;
clearInterval(callback_interval);
if (callback_target and callback_function) {
callback_target[callback_function](output);
} else {
onScanComplete(output);
}
}
function onScanComplete(packet) {
sendMessage(("packet size: " + output.length) + " bytes", "onScanComplete");
}
function nextPixel() {
var _local15 = xpos;
var _local14 = ypos;
var _local7 = resizedBitmap.getPixel(_local15, _local14);
var _local17 = (_local7 >> 16) & 255;
var _local20 = (_local7 >> 8) & 255;
var _local16 = (_local7 >> 0) & 255;
var _local11 = Math.round(((_local17 + 1) / 256) * cube);
var _local10 = Math.round(((_local20 + 1) / 256) * cube);
var _local13 = Math.round(((_local16 + 1) / 256) * cube);
var _local12 = (((_local11 * (cube + 1)) * (cube + 1)) + (_local10 * (cube + 1))) + _local13;
var _local6 = basen.encode(_local12, 2);
output = output + _local6;
if (_local6.length != 2) {
trace("bad pixel " + _local6);
}
var _local5 = basen.decode(_local6);
var _local18 = _local5;
var _local8 = _local5 % (cube + 1);
_local5 = (_local5 - _local8) / (cube + 1);
var _local9 = _local5 % (cube + 1);
var _local19 = (_local5 - _local9) / (cube + 1);
if (((_local13 != _local8) and (_local10 != _local9)) and (_local11 != _local10)) {
debug.bad_pixels++;
trace((((((("BAD PIXEL " + debug.bad_pixels) + ") ") + _local12) + " != ") + _local18) + " ") + _local6);
trace(basen.debug.lastencode);
}
var _local2 = Math.round((_local19 / cube) * 255).toString(16);
var _local4 = Math.round((_local9 / cube) * 255).toString(16);
var _local3 = Math.round((_local8 / cube) * 255).toString(16);
while (_local2.length < 2) {
_local2 = "0" + _local2;
}
while (_local4.length < 2) {
_local4 = "0" + _local4;
}
while (_local3.length < 2) {
_local3 = "0" + _local3;
}
copyBitmap.setPixel(_local15, _local14, Number((("0x" + _local2) + _local4) + _local3));
pixels++;
if (pixels >= (image_width * image_height)) {
return(false);
}
xpos++;
if (xpos >= image_width) {
xpos = 0;
ypos++;
}
return(true);
}
function error(e, f) {
sendMessage(e, f, "ERROR");
}
function sendMessage(msg, func, type) {
var _local1 = "ImageScanner";
if (func) {
_local1 = _local1 + (("." + func) + "()");
}
if (type) {
_local1 = (type + " in ") + _local1;
}
_local1 = _local1 + (" :: " + msg);
trace(_local1);
}
var image_width = 100;
var image_height = 100;
var crop = true;
var debug = new Object();
}
Symbol 1432 MovieClip [__Packages.com.Newgrounds.JSON] Frame 0
class com.Newgrounds.JSON
{
function JSON () {
}
static function encode(arg, noquotes) {
var _local3;
var _local2;
var _local6;
var _local1 = "";
var _local4;
if (arg.isSServerVar()) {
var _local8 = "sservervariable";
} else {
var _local8 = typeof(arg);
}
switch (_local8) {
case "sservervariable" :
return("?" + arg.getEncodedValue());
case "object" :
if (arg) {
if (arg instanceof Array) {
_local2 = 0;
while (_local2 < arg.length) {
_local4 = encode(arg[_local2]);
if (_local1) {
_local1 = _local1 + ",";
}
_local1 = _local1 + _local4;
_local2++;
}
return(("[" + _local1) + "]");
}
if (typeof(arg.toString) != "undefined") {
for (_local2 in arg) {
_local4 = arg[_local2];
if ((typeof(_local4) != "undefined") && (typeof(_local4) != "function")) {
_local4 = encode(_local4);
if (_local1) {
_local1 = _local1 + ",";
}
_local1 = _local1 + ((encode(_local2) + ":") + _local4);
}
}
return(("{" + _local1) + "}");
}
}
return("null");
case "number" :
return((isFinite(arg) ? (String(arg)) : "null"));
case "string" :
_local6 = arg.length;
if (noquotes) {
var _local7 = "";
} else {
var _local7 = "\"";
}
_local1 = _local7;
_local2 = 0;
while (_local2 < _local6) {
_local3 = arg.charAt(_local2);
if (_local3 >= " ") {
if ((_local3 == "\\") || (_local3 == "\"")) {
_local1 = _local1 + "\\";
}
_local1 = _local1 + _local3;
} else {
switch (_local3) {
case "\b" :
_local1 = _local1 + "\\b";
break;
case "\f" :
_local1 = _local1 + "\\f";
break;
case newline :
_local1 = _local1 + "\\n";
break;
case "\r" :
_local1 = _local1 + "\\r";
break;
case "\t" :
_local1 = _local1 + "\\t";
break;
default :
_local3 = _local3.charCodeAt();
_local1 = _local1 + (("\\u00" + Math.floor(_local3 / 16).toString(16)) + (_local3 % 16).toString(16));
}
}
_local2 = _local2 + 1;
}
return(_local1 + _local7);
case "boolean" :
return(String(arg));
}
return("null");
}
static function decode(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 = at + 1;
return(ch);
};
var _white = function () {
while (ch) {
if (ch <= " ") {
_next();
} else if (ch == "/") {
switch (_next()) {
case "/" :
while ((_next() && (ch != newline)) && (ch != "\r")) {
}
break;
case "*" :
_next();
for(;;){
if (ch) {
if (ch == "*") {
if (_next() == "/") {
_next();
// unexpected jump
}
} else {
_next();
}
} else {
_error("Unterminated comment");
}
};
break;
default :
_error("Syntax error");
}
} else {
return;
}
}
};
var _string = function () {
var _local4;
var _local1 = "";
var _local3;
var _local2;
var _local5 = false;
if (ch == "\"") {
while (_next()) {
if (ch == "\"") {
_next();
return(_local1);
}
if (ch == "\\") {
switch (_next()) {
case "b" :
_local1 = _local1 + "\b";
break;
case "f" :
_local1 = _local1 + "\f";
break;
case "n" :
_local1 = _local1 + newline;
break;
case "r" :
_local1 = _local1 + "\r";
break;
case "t" :
_local1 = _local1 + "\t";
break;
case "u" :
_local2 = 0;
_local4 = 0;
while (_local4 < 4) {
_local3 = parseInt(_next(), 16);
if (!isFinite(_local3)) {
_local5 = true;
break;
}
_local2 = (_local2 * 16) + _local3;
_local4 = _local4 + 1;
}
if (_local5) {
_local5 = false;
break;
}
_local1 = _local1 + String.fromCharCode(_local2);
break;
default :
_local1 = _local1 + ch;
}
} else {
_local1 = _local1 + ch;
}
}
}
_error("Bad string");
};
var _array = function () {
var _local1 = [];
if (ch == "[") {
_next();
_white();
if (ch == "]") {
_next();
return(_local1);
}
while (ch) {
_local1.push(_value());
_white();
if (ch == "]") {
_next();
return(_local1);
}
if (ch != ",") {
break;
}
_next();
_white();
}
}
_error("Bad array");
};
var _object = function () {
var _local2;
var _local1 = {};
if (ch == "{") {
_next();
_white();
if (ch == "}") {
_next();
return(_local1);
}
while (ch) {
_local2 = _string();
_white();
if (ch != ":") {
break;
}
_next();
_local1[_local2] = _value();
_white();
if (ch == "}") {
_next();
return(_local1);
}
if (ch != ",") {
break;
}
_next();
_white();
}
}
_error("Bad object");
};
var _number = function () {
var _local1 = "";
var _local2;
if (ch == "-") {
_local1 = "-";
_next();
}
while ((ch >= "0") && (ch <= "9")) {
_local1 = _local1 + ch;
_next();
}
if (ch == ".") {
_local1 = _local1 + ".";
while ((_next() && (ch >= "0")) && (ch <= "9")) {
_local1 = _local1 + ch;
}
}
_local2 = 1 * _local1;
if (!isFinite(_local2)) {
_error("Bad number");
} else {
return(_local2);
}
};
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"))) {
break;
}
_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());
}
}
Symbol 1433 MovieClip [__Packages.com.Newgrounds.RC4] Frame 0
class com.Newgrounds.RC4
{
function RC4 () {
}
static function encrypt(src, key) {
var _local3 = strToChars(src);
var _local1 = strToChars(key);
var _local2 = calculate(_local3, _local1);
return(charsToHex(_local2));
}
static function encryptbin(src, key) {
var _local3 = strToChars(src);
var _local1 = strToChars(key);
var _local2 = calculate(_local3, _local1);
return(_local2);
}
static function decrypt(src, key) {
var _local3 = hexToChars(src);
var _local1 = strToChars(key);
var _local2 = calculate(_local3, _local1);
return(charsToStr(_local2));
}
static function initialize(pwd) {
var _local2 = 0;
var _local3;
var _local4 = pwd.length;
var _local1 = 0;
while (_local1 <= 255) {
mykey[_local1] = pwd[_local1 % _local4];
sbox[_local1] = _local1;
_local1++;
}
_local1 = 0;
while (_local1 <= 255) {
_local2 = ((_local2 + sbox[_local1]) + mykey[_local1]) % 256;
_local3 = sbox[_local1];
sbox[_local1] = sbox[_local2];
sbox[_local2] = _local3;
_local1++;
}
}
static function calculate(plaintxt, psw) {
initialize(psw);
var _local1 = 0;
var _local2 = 0;
var _local9 = new Array();
var _local7;
var _local5;
var _local6;
var _local3 = 0;
while (_local3 < plaintxt.length) {
_local1 = (_local1 + 1) % 256;
_local2 = (_local2 + sbox[_local1]) % 256;
_local5 = sbox[_local1];
sbox[_local1] = sbox[_local2];
sbox[_local2] = _local5;
var _local4 = (sbox[_local1] + sbox[_local2]) % 256;
_local7 = sbox[_local4];
_local6 = plaintxt[_local3] ^ _local7;
_local9.push(_local6);
_local3++;
}
return(_local9);
}
static function charsToHex(chars) {
var _local4 = new String("");
var _local3 = new Array("0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "a", "b", "c", "d", "e", "f");
var _local1 = 0;
while (_local1 < chars.length) {
_local4 = _local4 + (_local3[chars[_local1] >> 4] + _local3[chars[_local1] & 15]);
_local1++;
}
return(_local4);
}
static function hexToChars(hex) {
var _local3 = new Array();
var _local1 = ((hex.substr(0, 2) == "0x") ? 2 : 0);
while (_local1 < hex.length) {
_local3.push(parseInt(hex.substr(_local1, 2), 16));
_local1 = _local1 + 2;
}
return(_local3);
}
static function charsToStr(chars) {
var _local3 = new String("");
var _local1 = 0;
while (_local1 < chars.length) {
_local3 = _local3 + String.fromCharCode(chars[_local1]);
_local1++;
}
return(_local3);
}
static function strToChars(str) {
var _local3 = new Array();
var _local1 = 0;
while (_local1 < str.length) {
_local3.push(str.charCodeAt(_local1));
_local1++;
}
return(_local3);
}
static var sbox = new Array(255);
static var mykey = new Array(255);
}
Symbol 1434 MovieClip [__Packages.com.Newgrounds.MD5] Frame 0
class com.Newgrounds.MD5
{
function MD5 () {
}
static function calculate(src) {
return(hex_md5(src));
}
static function hex_md5(src) {
return(binl2hex(core_md5(str2binl(src), src.length * 8)));
}
static function core_md5(x, len) {
x[len >> 5] = x[len >> 5] | (128 << (len % 32));
x[(((len + 64) >>> 9) << 4) + 14] = len;
var _local4 = 1732584193 /* 0x67452301 */;
var _local3 = -271733879;
var _local2 = -1732584194;
var _local1 = 271733878 /* 0x10325476 */;
var _local5 = 0;
while (_local5 < x.length) {
var _local10 = _local4;
var _local9 = _local3;
var _local8 = _local2;
var _local7 = _local1;
_local4 = md5_ff(_local4, _local3, _local2, _local1, x[_local5 + 0], 7, -680876936);
_local1 = md5_ff(_local1, _local4, _local3, _local2, x[_local5 + 1], 12, -389564586);
_local2 = md5_ff(_local2, _local1, _local4, _local3, x[_local5 + 2], 17, 606105819);
_local3 = md5_ff(_local3, _local2, _local1, _local4, x[_local5 + 3], 22, -1044525330);
_local4 = md5_ff(_local4, _local3, _local2, _local1, x[_local5 + 4], 7, -176418897);
_local1 = md5_ff(_local1, _local4, _local3, _local2, x[_local5 + 5], 12, 1200080426);
_local2 = md5_ff(_local2, _local1, _local4, _local3, x[_local5 + 6], 17, -1473231341);
_local3 = md5_ff(_local3, _local2, _local1, _local4, x[_local5 + 7], 22, -45705983);
_local4 = md5_ff(_local4, _local3, _local2, _local1, x[_local5 + 8], 7, 1770035416);
_local1 = md5_ff(_local1, _local4, _local3, _local2, x[_local5 + 9], 12, -1958414417);
_local2 = md5_ff(_local2, _local1, _local4, _local3, x[_local5 + 10], 17, -42063);
_local3 = md5_ff(_local3, _local2, _local1, _local4, x[_local5 + 11], 22, -1990404162);
_local4 = md5_ff(_local4, _local3, _local2, _local1, x[_local5 + 12], 7, 1804603682);
_local1 = md5_ff(_local1, _local4, _local3, _local2, x[_local5 + 13], 12, -40341101);
_local2 = md5_ff(_local2, _local1, _local4, _local3, x[_local5 + 14], 17, -1502002290);
_local3 = md5_ff(_local3, _local2, _local1, _local4, x[_local5 + 15], 22, 1236535329);
_local4 = md5_gg(_local4, _local3, _local2, _local1, x[_local5 + 1], 5, -165796510);
_local1 = md5_gg(_local1, _local4, _local3, _local2, x[_local5 + 6], 9, -1069501632);
_local2 = md5_gg(_local2, _local1, _local4, _local3, x[_local5 + 11], 14, 643717713);
_local3 = md5_gg(_local3, _local2, _local1, _local4, x[_local5 + 0], 20, -373897302);
_local4 = md5_gg(_local4, _local3, _local2, _local1, x[_local5 + 5], 5, -701558691);
_local1 = md5_gg(_local1, _local4, _local3, _local2, x[_local5 + 10], 9, 38016083);
_local2 = md5_gg(_local2, _local1, _local4, _local3, x[_local5 + 15], 14, -660478335);
_local3 = md5_gg(_local3, _local2, _local1, _local4, x[_local5 + 4], 20, -405537848);
_local4 = md5_gg(_local4, _local3, _local2, _local1, x[_local5 + 9], 5, 568446438);
_local1 = md5_gg(_local1, _local4, _local3, _local2, x[_local5 + 14], 9, -1019803690);
_local2 = md5_gg(_local2, _local1, _local4, _local3, x[_local5 + 3], 14, -187363961);
_local3 = md5_gg(_local3, _local2, _local1, _local4, x[_local5 + 8], 20, 1163531501);
_local4 = md5_gg(_local4, _local3, _local2, _local1, x[_local5 + 13], 5, -1444681467);
_local1 = md5_gg(_local1, _local4, _local3, _local2, x[_local5 + 2], 9, -51403784);
_local2 = md5_gg(_local2, _local1, _local4, _local3, x[_local5 + 7], 14, 1735328473);
_local3 = md5_gg(_local3, _local2, _local1, _local4, x[_local5 + 12], 20, -1926607734);
_local4 = md5_hh(_local4, _local3, _local2, _local1, x[_local5 + 5], 4, -378558);
_local1 = md5_hh(_local1, _local4, _local3, _local2, x[_local5 + 8], 11, -2022574463);
_local2 = md5_hh(_local2, _local1, _local4, _local3, x[_local5 + 11], 16, 1839030562);
_local3 = md5_hh(_local3, _local2, _local1, _local4, x[_local5 + 14], 23, -35309556);
_local4 = md5_hh(_local4, _local3, _local2, _local1, x[_local5 + 1], 4, -1530992060);
_local1 = md5_hh(_local1, _local4, _local3, _local2, x[_local5 + 4], 11, 1272893353);
_local2 = md5_hh(_local2, _local1, _local4, _local3, x[_local5 + 7], 16, -155497632);
_local3 = md5_hh(_local3, _local2, _local1, _local4, x[_local5 + 10], 23, -1094730640);
_local4 = md5_hh(_local4, _local3, _local2, _local1, x[_local5 + 13], 4, 681279174);
_local1 = md5_hh(_local1, _local4, _local3, _local2, x[_local5 + 0], 11, -358537222);
_local2 = md5_hh(_local2, _local1, _local4, _local3, x[_local5 + 3], 16, -722521979);
_local3 = md5_hh(_local3, _local2, _local1, _local4, x[_local5 + 6], 23, 76029189);
_local4 = md5_hh(_local4, _local3, _local2, _local1, x[_local5 + 9], 4, -640364487);
_local1 = md5_hh(_local1, _local4, _local3, _local2, x[_local5 + 12], 11, -421815835);
_local2 = md5_hh(_local2, _local1, _local4, _local3, x[_local5 + 15], 16, 530742520);
_local3 = md5_hh(_local3, _local2, _local1, _local4, x[_local5 + 2], 23, -995338651);
_local4 = md5_ii(_local4, _local3, _local2, _local1, x[_local5 + 0], 6, -198630844);
_local1 = md5_ii(_local1, _local4, _local3, _local2, x[_local5 + 7], 10, 1126891415);
_local2 = md5_ii(_local2, _local1, _local4, _local3, x[_local5 + 14], 15, -1416354905);
_local3 = md5_ii(_local3, _local2, _local1, _local4, x[_local5 + 5], 21, -57434055);
_local4 = md5_ii(_local4, _local3, _local2, _local1, x[_local5 + 12], 6, 1700485571);
_local1 = md5_ii(_local1, _local4, _local3, _local2, x[_local5 + 3], 10, -1894986606);
_local2 = md5_ii(_local2, _local1, _local4, _local3, x[_local5 + 10], 15, -1051523);
_local3 = md5_ii(_local3, _local2, _local1, _local4, x[_local5 + 1], 21, -2054922799);
_local4 = md5_ii(_local4, _local3, _local2, _local1, x[_local5 + 8], 6, 1873313359);
_local1 = md5_ii(_local1, _local4, _local3, _local2, x[_local5 + 15], 10, -30611744);
_local2 = md5_ii(_local2, _local1, _local4, _local3, x[_local5 + 6], 15, -1560198380);
_local3 = md5_ii(_local3, _local2, _local1, _local4, x[_local5 + 13], 21, 1309151649);
_local4 = md5_ii(_local4, _local3, _local2, _local1, x[_local5 + 4], 6, -145523070);
_local1 = md5_ii(_local1, _local4, _local3, _local2, x[_local5 + 11], 10, -1120210379);
_local2 = md5_ii(_local2, _local1, _local4, _local3, x[_local5 + 2], 15, 718787259);
_local3 = md5_ii(_local3, _local2, _local1, _local4, x[_local5 + 9], 21, -343485551);
_local4 = safe_add(_local4, _local10);
_local3 = safe_add(_local3, _local9);
_local2 = safe_add(_local2, _local8);
_local1 = safe_add(_local1, _local7);
_local5 = _local5 + 16;
}
return(new Array(_local4, _local3, _local2, _local1));
}
static function md5_cmn(q, a, b, x, s, t) {
return(safe_add(bit_rol(safe_add(safe_add(a, q), safe_add(x, t)), s), b));
}
static function md5_ff(a, b, c, d, x, s, t) {
return(md5_cmn((b & c) | ((~b) & d), a, b, x, s, t));
}
static function md5_gg(a, b, c, d, x, s, t) {
return(md5_cmn((b & d) | (c & (~d)), a, b, x, s, t));
}
static function md5_hh(a, b, c, d, x, s, t) {
return(md5_cmn((b ^ c) ^ d, a, b, x, s, t));
}
static function md5_ii(a, b, c, d, x, s, t) {
return(md5_cmn(c ^ (b | (~d)), a, b, x, s, t));
}
static function bit_rol(num, cnt) {
return((num << cnt) | (num >>> (32 - cnt)));
}
static function safe_add(x, y) {
var _local1 = (x & 65535) + (y & 65535);
var _local2 = ((x >> 16) + (y >> 16)) + (_local1 >> 16);
return((_local2 << 16) | (_local1 & 65535));
}
static function str2binl(str) {
var _local3 = new Array();
var _local4 = 255;
var _local1 = 0;
while (_local1 < (str.length * 8)) {
_local3[_local1 >> 5] = _local3[_local1 >> 5] | ((str.charCodeAt(_local1 / 8) & _local4) << (_local1 % 32));
_local1 = _local1 + 8;
}
return(_local3);
}
static function binl2hex(binarray) {
var _local4 = new String("");
var _local3 = new String("0123456789abcdef");
var _local1 = 0;
while (_local1 < (binarray.length * 4)) {
_local4 = _local4 + (_local3.charAt((binarray[_local1 >> 2] >> (((_local1 % 4) * 8) + 4)) & 15) + _local3.charAt((binarray[_local1 >> 2] >> ((_local1 % 4) * 8)) & 15));
_local1++;
}
return(_local4);
}
}
Symbol 1435 MovieClip [__Packages.caurina.transitions.Tweener] Frame 0
class caurina.transitions.Tweener
{
static var _specialPropertySplitterList, _specialPropertyModifierList, _specialPropertyList, _transitionList, _currentTimeFrame, _currentTime, _tweenList;
function Tweener () {
trace("Tweener is an static class and should not be instantiated.");
}
static function addTween(p_scopes, p_parameters) {
if (p_scopes == undefined) {
return(false);
}
var _local3;
var _local7;
var _local2;
var _local11;
if (p_scopes instanceof Array) {
_local11 = p_scopes.concat();
} else {
_local11 = [p_scopes];
}
var _local5 = caurina.transitions.TweenListObj.makePropertiesChain(p_parameters);
if (!_inited) {
init();
}
if ((!_engineExists) || (_root[getControllerName()] == undefined)) {
startEngine();
}
var _local19 = (isNaN(_local5.time) ? 0 : (_local5.time));
var _local12 = (isNaN(_local5.delay) ? 0 : (_local5.delay));
var _local4 = new Object();
var _local24 = {time:true, delay:true, useFrames:true, skipUpdates:true, transition:true, transitionParams:true, onStart:true, onUpdate:true, onComplete:true, onOverwrite:true, onError:true, rounded:true, onStartParams:true, onUpdateParams:true, onCompleteParams:true, onOverwriteParams:true, onStartScope:true, onUpdateScope:true, onCompleteScope:true, onOverwriteScope:true, onErrorScope:true, quickAdd:true};
var _local13 = new Object();
for (_local2 in _local5) {
if (!_local24[_local2]) {
if (_specialPropertySplitterList[_local2] != undefined) {
var _local8 = _specialPropertySplitterList[_local2].splitValues(_local5[_local2], _specialPropertySplitterList[_local2].parameters);
_local3 = 0;
while (_local3 < _local8.length) {
if (_specialPropertySplitterList[_local8[_local3].name] != undefined) {
var _local9 = _specialPropertySplitterList[_local8[_local3].name].splitValues(_local8[_local3].value, _specialPropertySplitterList[_local8[_local3].name].parameters);
_local7 = 0;
while (_local7 < _local9.length) {
_local4[_local9[_local7].name] = {valueStart:undefined, valueComplete:_local9[_local7].value, arrayIndex:_local9[_local7].arrayIndex, isSpecialProperty:false};
_local7++;
}
} else {
_local4[_local8[_local3].name] = {valueStart:undefined, valueComplete:_local8[_local3].value, arrayIndex:_local8[_local3].arrayIndex, isSpecialProperty:false};
}
_local3++;
}
} else if (_specialPropertyModifierList[_local2] != undefined) {
var _local10 = _specialPropertyModifierList[_local2].modifyValues(_local5[_local2]);
_local3 = 0;
while (_local3 < _local10.length) {
_local13[_local10[_local3].name] = {modifierParameters:_local10[_local3].parameters, modifierFunction:_specialPropertyModifierList[_local2].getValue};
_local3++;
}
} else {
_local4[_local2] = {valueStart:undefined, valueComplete:_local5[_local2]};
}
}
}
for (_local2 in _local4) {
if (_specialPropertyList[_local2] != undefined) {
_local4[_local2].isSpecialProperty = true;
} else if (_local11[0][_local2] == undefined) {
printError(((("The property '" + _local2) + "' doesn't seem to be a normal object property of ") + _local11[0].toString()) + " or a registered special property.");
}
}
for (_local2 in _local13) {
if (_local4[_local2] != undefined) {
_local4[_local2].modifierParameters = _local13[_local2].modifierParameters;
_local4[_local2].modifierFunction = _local13[_local2].modifierFunction;
}
}
var _local21;
if (typeof(_local5.transition) == "string") {
var _local26 = _local5.transition.toLowerCase();
_local21 = _transitionList[_local26];
} else {
_local21 = _local5.transition;
}
if (_local21 == undefined) {
_local21 = _transitionList.easeoutexpo;
}
var _local14;
var _local6;
var _local20;
_local3 = 0;
while (_local3 < _local11.length) {
_local14 = new Object();
for (_local2 in _local4) {
_local14[_local2] = new caurina.transitions.PropertyInfoObj(_local4[_local2].valueStart, _local4[_local2].valueComplete, _local4[_local2].valueComplete, _local4[_local2].arrayIndex, {}, _local4[_local2].isSpecialProperty, _local4[_local2].modifierFunction, _local4[_local2].modifierParameters);
}
if (_local5.useFrames == true) {
_local6 = new caurina.transitions.TweenListObj(_local11[_local3], _currentTimeFrame + (_local12 / _timeScale), _currentTimeFrame + ((_local12 + _local19) / _timeScale), true, _local21, _local5.transitionParams);
} else {
_local6 = new caurina.transitions.TweenListObj(_local11[_local3], _currentTime + ((_local12 * 1000) / _timeScale), _currentTime + (((_local12 * 1000) + (_local19 * 1000)) / _timeScale), false, _local21, _local5.transitionParams);
}
_local6.properties = _local14;
_local6.onStart = _local5.onStart;
_local6.onUpdate = _local5.onUpdate;
_local6.onComplete = _local5.onComplete;
_local6.onOverwrite = _local5.onOverwrite;
_local6.onError = _local5.onError;
_local6.onStartParams = _local5.onStartParams;
_local6.onUpdateParams = _local5.onUpdateParams;
_local6.onCompleteParams = _local5.onCompleteParams;
_local6.onOverwriteParams = _local5.onOverwriteParams;
_local6.onStartScope = _local5.onStartScope;
_local6.onUpdateScope = _local5.onUpdateScope;
_local6.onCompleteScope = _local5.onCompleteScope;
_local6.onOverwriteScope = _local5.onOverwriteScope;
_local6.onErrorScope = _local5.onErrorScope;
_local6.rounded = _local5.rounded;
_local6.skipUpdates = _local5.skipUpdates;
if (!_local5.quickAdd) {
removeTweensByTime(_local6.scope, _local6.properties, _local6.timeStart, _local6.timeComplete);
}
_tweenList.push(_local6);
if ((_local19 == 0) && (_local12 == 0)) {
_local20 = _tweenList.length - 1;
updateTweenByIndex(_local20);
removeTweenByIndex(_local20);
}
_local3++;
}
return(true);
}
static function addCaller(p_scopes, p_parameters) {
if (p_scopes == undefined) {
return(false);
}
var _local5;
var _local6;
if (p_scopes instanceof Array) {
_local6 = p_scopes.concat();
} else {
_local6 = [p_scopes];
}
var _local3 = p_parameters;
if (!_inited) {
init();
}
if ((!_engineExists) || (_root[getControllerName()] == undefined)) {
startEngine();
}
var _local7 = (isNaN(_local3.time) ? 0 : (_local3.time));
var _local4 = (isNaN(_local3.delay) ? 0 : (_local3.delay));
var _local9;
if (typeof(_local3.transition) == "string") {
var _local11 = _local3.transition.toLowerCase();
_local9 = _transitionList[_local11];
} else {
_local9 = _local3.transition;
}
if (_local9 == undefined) {
_local9 = _transitionList.easeoutexpo;
}
var _local2;
var _local8;
_local5 = 0;
while (_local5 < _local6.length) {
if (_local3.useFrames == true) {
_local2 = new caurina.transitions.TweenListObj(_local6[_local5], _currentTimeFrame + (_local4 / _timeScale), _currentTimeFrame + ((_local4 + _local7) / _timeScale), true, _local9, _local3.transitionParams);
} else {
_local2 = new caurina.transitions.TweenListObj(_local6[_local5], _currentTime + ((_local4 * 1000) / _timeScale), _currentTime + (((_local4 * 1000) + (_local7 * 1000)) / _timeScale), false, _local9, _local3.transitionParams);
}
_local2.properties = undefined;
_local2.onStart = _local3.onStart;
_local2.onUpdate = _local3.onUpdate;
_local2.onComplete = _local3.onComplete;
_local2.onOverwrite = _local3.onOverwrite;
_local2.onStartParams = _local3.onStartParams;
_local2.onUpdateParams = _local3.onUpdateParams;
_local2.onCompleteParams = _local3.onCompleteParams;
_local2.onOverwriteParams = _local3.onOverwriteParams;
_local2.onStartScope = _local3.onStartScope;
_local2.onUpdateScope = _local3.onUpdateScope;
_local2.onCompleteScope = _local3.onCompleteScope;
_local2.onOverwriteScope = _local3.onOverwriteScope;
_local2.onErrorScope = _local3.onErrorScope;
_local2.isCaller = true;
_local2.count = _local3.count;
_local2.waitFrames = _local3.waitFrames;
_tweenList.push(_local2);
if ((_local7 == 0) && (_local4 == 0)) {
_local8 = _tweenList.length - 1;
updateTweenByIndex(_local8);
removeTweenByIndex(_local8);
}
_local5++;
}
return(true);
}
static function removeTweensByTime(p_scope, p_properties, p_timeStart, p_timeComplete) {
var _local5 = false;
var _local4;
var _local1;
var _local7 = _tweenList.length;
var _local2;
_local1 = 0;
while (_local1 < _local7) {
if (p_scope == _tweenList[_local1].scope) {
if ((p_timeComplete > _tweenList[_local1].timeStart) && (p_timeStart < _tweenList[_local1].timeComplete)) {
_local4 = false;
for (_local2 in _tweenList[_local1].properties) {
if (p_properties[_local2] != undefined) {
if (_tweenList[_local1].onOverwrite != undefined) {
var _local3 = ((_tweenList[_local1].onOverwriteScope != undefined) ? (_tweenList[_local1].onOverwriteScope) : (_tweenList[_local1].scope));
try {
_tweenList[_local1].onOverwrite.apply(_local3, _tweenList[_local1].onOverwriteParams);
} catch(e:Error) {
handleError(_tweenList[_local1], e, "onOverwrite");
}
}
_tweenList[_local1].properties[_local2] = undefined;
delete _tweenList[_local1].properties[_local2];
_local4 = true;
_local5 = true;
}
}
if (_local4) {
if (caurina.transitions.AuxFunctions.getObjectLength(_tweenList[_local1].properties) == 0) {
removeTweenByIndex(_local1);
}
}
}
}
_local1++;
}
return(_local5);
}
static function removeTweens(p_scope) {
var _local5 = new Array();
var _local3;
_local3 = 1;
while (_local3 < arguments.length) {
if ((typeof(arguments[_local3]) == "string") && (!caurina.transitions.AuxFunctions.isInArray(arguments[_local3], _local5))) {
if (_specialPropertySplitterList[arguments[_local3]]) {
var _local6 = _specialPropertySplitterList[arguments[_local3]];
var _local4 = _local6.splitValues(p_scope, null);
var _local2 = 0;
while (_local2 < _local4.length) {
_local5.push(_local4[_local2].name);
_local2++;
}
} else {
_local5.push(arguments[_local3]);
}
}
_local3++;
}
return(affectTweens(removeTweenByIndex, p_scope, _local5));
}
static function removeAllTweens() {
var _local2 = false;
var _local1;
_local1 = 0;
while (_local1 < _tweenList.length) {
removeTweenByIndex(_local1);
_local2 = true;
_local1++;
}
return(_local2);
}
static function pauseTweens(p_scope) {
var _local3 = new Array();
var _local2;
_local2 = 1;
while (_local2 < arguments.length) {
if ((typeof(arguments[_local2]) == "string") && (!caurina.transitions.AuxFunctions.isInArray(arguments[_local2], _local3))) {
_local3.push(arguments[_local2]);
}
_local2++;
}
return(affectTweens(pauseTweenByIndex, p_scope, _local3));
}
static function pauseAllTweens() {
var _local2 = false;
var _local1;
_local1 = 0;
while (_local1 < _tweenList.length) {
pauseTweenByIndex(_local1);
_local2 = true;
_local1++;
}
return(_local2);
}
static function resumeTweens(p_scope) {
var _local3 = new Array();
var _local2;
_local2 = 1;
while (_local2 < arguments.length) {
if ((typeof(arguments[_local2]) == "string") && (!caurina.transitions.AuxFunctions.isInArray(arguments[_local2], _local3))) {
_local3.push(arguments[_local2]);
}
_local2++;
}
return(affectTweens(resumeTweenByIndex, p_scope, _local3));
}
static function resumeAllTweens() {
var _local2 = false;
var _local1;
_local1 = 0;
while (_local1 < _tweenList.length) {
resumeTweenByIndex(_local1);
_local2 = true;
_local1++;
}
return(_local2);
}
static function affectTweens(p_affectFunction, p_scope, p_properties) {
var _local5 = false;
var _local2;
if (!_tweenList) {
return(false);
}
_local2 = 0;
while (_local2 < _tweenList.length) {
if (_tweenList[_local2].scope == p_scope) {
if (p_properties.length == 0) {
p_affectFunction(_local2);
_local5 = true;
} else {
var _local4 = new Array();
var _local1;
_local1 = 0;
while (_local1 < p_properties.length) {
if (_tweenList[_local2].properties[p_properties[_local1]] != undefined) {
_local4.push(p_properties[_local1]);
}
_local1++;
}
if (_local4.length > 0) {
var _local7 = caurina.transitions.AuxFunctions.getObjectLength(_tweenList[_local2].properties);
if (_local7 == _local4.length) {
p_affectFunction(_local2);
_local5 = true;
} else {
var _local8 = splitTweens(_local2, _local4);
p_affectFunction(_local8);
_local5 = true;
}
}
}
}
_local2++;
}
return(_local5);
}
static function splitTweens(p_tween, p_properties) {
var _local6 = _tweenList[p_tween];
var _local5 = _local6.clone(false);
var _local1;
var _local2;
_local1 = 0;
while (_local1 < p_properties.length) {
_local2 = p_properties[_local1];
if (_local6.properties[_local2] != undefined) {
_local6.properties[_local2] = undefined;
delete _local6.properties[_local2];
}
_local1++;
}
var _local4;
for (_local2 in _local5.properties) {
_local4 = false;
_local1 = 0;
while (_local1 < p_properties.length) {
if (p_properties[_local1] == _local2) {
_local4 = true;
break;
}
_local1++;
}
if (!_local4) {
_local5.properties[_local2] = undefined;
delete _local5.properties[_local2];
}
}
_tweenList.push(_local5);
return(_tweenList.length - 1);
}
static function updateTweens() {
if (_tweenList.length == 0) {
return(false);
}
var _local1;
_local1 = 0;
while (_local1 < _tweenList.length) {
if (!_tweenList[_local1].isPaused) {
if (!updateTweenByIndex(_local1)) {
removeTweenByIndex(_local1);
}
if (_tweenList[_local1] == null) {
removeTweenByIndex(_local1, true);
_local1--;
}
}
_local1++;
}
return(true);
}
static function removeTweenByIndex(p_tween, p_finalRemoval) {
_tweenList[p_tween] = null;
if (p_finalRemoval) {
_tweenList.splice(p_tween, 1);
}
return(true);
}
static function pauseTweenByIndex(p_tween) {
var _local1 = _tweenList[p_tween];
if ((_local1 == null) || (_local1.isPaused)) {
return(false);
}
_local1.timePaused = getCurrentTweeningTime(_local1);
_local1.isPaused = true;
return(true);
}
static function resumeTweenByIndex(p_tween) {
var _local1 = _tweenList[p_tween];
if ((_local1 == null) || (!_local1.isPaused)) {
return(false);
}
var _local2 = getCurrentTweeningTime(_local1);
_local1.timeStart = _local1.timeStart + (_local2 - _local1.timePaused);
_local1.timeComplete = _local1.timeComplete + (_local2 - _local1.timePaused);
_local1.timePaused = undefined;
_local1.isPaused = false;
return(true);
}
static function updateTweenByIndex(i) {
var _local1 = _tweenList[i];
if ((_local1 == null) || (!_local1.scope)) {
return(false);
}
var _local13 = false;
var _local14;
var _local3;
var _local7;
var _local10;
var _local9;
var _local6;
var _local2;
var _local12;
var _local5;
var _local8 = getCurrentTweeningTime(_local1);
var _local4;
if (_local8 >= _local1.timeStart) {
_local5 = _local1.scope;
if (_local1.isCaller) {
do {
_local7 = ((_local1.timeComplete - _local1.timeStart) / _local1.count) * (_local1.timesCalled + 1);
_local10 = _local1.timeStart;
_local9 = _local1.timeComplete - _local1.timeStart;
_local6 = _local1.timeComplete - _local1.timeStart;
_local3 = _local1.transition(_local7, _local10, _local9, _local6, _local1.transitionParams);
if (_local8 >= _local3) {
if (_local1.onUpdate != undefined) {
_local12 = ((_local1.onUpdateScope != undefined) ? (_local1.onUpdateScope) : (_local5));
try {
_local1.onUpdate.apply(_local12, _local1.onUpdateParams);
} catch(e:Error) {
handleError(_local1, e, "onUpdate");
}
}
_local1.timesCalled++;
if (_local1.timesCalled >= _local1.count) {
_local13 = true;
break;
}
if (_local1.waitFrames) {
break;
}
}
} while (_local8 >= _local3);
} else {
_local14 = ((_local1.skipUpdates < 1) || (_local1.skipUpdates == undefined)) || (_local1.updatesSkipped >= _local1.skipUpdates);
if (_local8 >= _local1.timeComplete) {
_local13 = true;
_local14 = true;
}
if (!_local1.hasStarted) {
if (_local1.onStart != undefined) {
_local12 = ((_local1.onStartScope != undefined) ? (_local1.onStartScope) : (_local5));
try {
_local1.onStart.apply(_local12, _local1.onStartParams);
} catch(e:Error) {
handleError(_local1, e, "onStart");
}
}
var _local11;
for (_local2 in _local1.properties) {
if (_local1.properties[_local2].isSpecialProperty) {
if (_specialPropertyList[_local2].preProcess != undefined) {
_local1.properties[_local2].valueComplete = _specialPropertyList[_local2].preProcess(_local5, _specialPropertyList[_local2].parameters, _local1.properties[_local2].originalValueComplete, _local1.properties[_local2].extra);
}
_local11 = _specialPropertyList[_local2].getValue(_local5, _specialPropertyList[_local2].parameters, _local1.properties[_local2].extra);
} else {
_local11 = _local5[_local2];
}
_local1.properties[_local2].valueStart = (isNaN(_local11) ? (_local1.properties[_local2].valueComplete) : (_local11));
}
_local14 = true;
_local1.hasStarted = true;
}
if (_local14) {
for (_local2 in _local1.properties) {
_local4 = _local1.properties[_local2];
if (_local13) {
_local3 = _local4.valueComplete;
} else if (_local4.hasModifier) {
_local7 = _local8 - _local1.timeStart;
_local6 = _local1.timeComplete - _local1.timeStart;
_local3 = _local1.transition(_local7, 0, 1, _local6, _local1.transitionParams);
_local3 = _local4.modifierFunction(_local4.valueStart, _local4.valueComplete, _local3, _local4.modifierParameters);
} else {
_local7 = _local8 - _local1.timeStart;
_local10 = _local4.valueStart;
_local9 = _local4.valueComplete - _local4.valueStart;
_local6 = _local1.timeComplete - _local1.timeStart;
_local3 = _local1.transition(_local7, _local10, _local9, _local6, _local1.transitionParams);
}
if (_local1.rounded) {
_local3 = Math.round(_local3);
}
if (_local4.isSpecialProperty) {
_specialPropertyList[_local2].setValue(_local5, _local3, _specialPropertyList[_local2].parameters, _local1.properties[_local2].extra);
} else {
_local5[_local2] = _local3;
}
}
_local1.updatesSkipped = 0;
if (_local1.onUpdate != undefined) {
_local12 = ((_local1.onUpdateScope != undefined) ? (_local1.onUpdateScope) : (_local5));
try {
_local1.onUpdate.apply(_local12, _local1.onUpdateParams);
} catch(e:Error) {
handleError(_local1, e, "onUpdate");
}
}
} else {
_local1.updatesSkipped++;
}
}
if (_local13 && (_local1.onComplete != undefined)) {
_local12 = ((_local1.onCompleteScope != undefined) ? (_local1.onCompleteScope) : (_local5));
try {
_local1.onComplete.apply(_local12, _local1.onCompleteParams);
} catch(e:Error) {
handleError(_local1, e, "onComplete");
}
}
return(!_local13);
}
return(true);
}
static function init() {
_inited = true;
_transitionList = new Object();
caurina.transitions.Equations.init();
_specialPropertyList = new Object();
_specialPropertyModifierList = new Object();
_specialPropertySplitterList = new Object();
}
static function registerTransition(p_name, p_function) {
if (!_inited) {
init();
}
_transitionList[p_name] = p_function;
}
static function registerSpecialProperty(p_name, p_getFunction, p_setFunction, p_parameters, p_preProcessFunction) {
if (!_inited) {
init();
}
var _local1 = new caurina.transitions.SpecialProperty(p_getFunction, p_setFunction, p_parameters, p_preProcessFunction);
_specialPropertyList[p_name] = _local1;
}
static function registerSpecialPropertyModifier(p_name, p_modifyFunction, p_getFunction) {
if (!_inited) {
init();
}
var _local1 = new caurina.transitions.SpecialPropertyModifier(p_modifyFunction, p_getFunction);
_specialPropertyModifierList[p_name] = _local1;
}
static function registerSpecialPropertySplitter(p_name, p_splitFunction, p_parameters) {
if (!_inited) {
init();
}
var _local1 = new caurina.transitions.SpecialPropertySplitter(p_splitFunction, p_parameters);
_specialPropertySplitterList[p_name] = _local1;
}
static function startEngine() {
_engineExists = true;
_tweenList = new Array();
var _local2 = Math.floor(Math.random() * 999999);
var _local3 = _root.createEmptyMovieClip(getControllerName(), 31338 + _local2);
_local3.onEnterFrame = function () {
caurina.transitions.Tweener.onEnterFrame();
};
_currentTimeFrame = 0;
updateTime();
}
static function stopEngine() {
_engineExists = false;
_tweenList = null;
_currentTime = 0;
_currentTimeFrame = 0;
delete _root[getControllerName()].onEnterFrame;
_root[getControllerName()].removeMovieClip();
}
static function updateTime() {
_currentTime = getTimer();
}
static function updateFrame() {
_currentTimeFrame++;
}
static function onEnterFrame() {
updateTime();
updateFrame();
var _local1 = false;
_local1 = updateTweens();
if (!_local1) {
stopEngine();
}
}
static function setTimeScale(p_time) {
var _local1;
var _local2;
if (isNaN(p_time)) {
p_time = 1;
}
if (p_time < 1E-5) {
p_time = 1E-5;
}
if (p_time != _timeScale) {
_local1 = 0;
while (_local1 < _tweenList.length) {
_local2 = getCurrentTweeningTime(_tweenList[_local1]);
_tweenList[_local1].timeStart = _local2 - (((_local2 - _tweenList[_local1].timeStart) * _timeScale) / p_time);
_tweenList[_local1].timeComplete = _local2 - (((_local2 - _tweenList[_local1].timeComplete) * _timeScale) / p_time);
if (_tweenList[_local1].timePaused != undefined) {
_tweenList[_local1].timePaused = _local2 - (((_local2 - _tweenList[_local1].timePaused) * _timeScale) / p_time);
}
_local1++;
}
_timeScale = p_time;
}
}
static function isTweening(p_scope) {
var _local1;
_local1 = 0;
while (_local1 < _tweenList.length) {
if (_tweenList[_local1].scope == p_scope) {
return(true);
}
_local1++;
}
return(false);
}
static function getTweens(p_scope) {
var _local1;
var _local2;
var _local3 = new Array();
_local1 = 0;
while (_local1 < _tweenList.length) {
if (_tweenList[_local1].scope == p_scope) {
for (_local2 in _tweenList[_local1].properties) {
_local3.push(_local2);
}
}
_local1++;
}
return(_local3);
}
static function getTweenCount(p_scope) {
var _local1;
var _local2 = 0;
_local1 = 0;
while (_local1 < _tweenList.length) {
if (_tweenList[_local1].scope == p_scope) {
_local2 = _local2 + caurina.transitions.AuxFunctions.getObjectLength(_tweenList[_local1].properties);
}
_local1++;
}
return(_local2);
}
static function handleError(pTweening, pError, pCallBackName) {
if ((pTweening.onError != undefined) && (typeof(pTweening.onError == "function"))) {
var _local3 = ((pTweening.onErrorScope != undefined) ? (pTweening.onErrorScope) : (pTweening.scope));
try {
pTweening.onError.apply(_local3, [pTweening.scope, pError]);
} catch(metaError:Error) {
printError((((pTweening.scope.toString() + " raised an error while executing the 'onError' handler. Original error:\n ") + pError) + "\nonError error: ") + metaError);
}
} else if (pTweening.onError == undefined) {
printError((((pTweening.scope.toString() + " raised an error while executing the '") + pCallBackName.toString()) + "'handler. \n") + pError);
}
}
static function getCurrentTweeningTime(p_tweening) {
return((p_tweening.useFrames ? (_currentTimeFrame) : (_currentTime)));
}
static function getVersion() {
return("AS2 1.31.74");
}
static function getControllerName() {
return("__tweener_controller__" + getVersion());
}
static function printError(p_message) {
trace("## [Tweener] Error: " + p_message);
}
static var _engineExists = false;
static var _inited = false;
static var _timeScale = 1;
}
Symbol 1436 MovieClip [__Packages.caurina.transitions.TweenListObj] Frame 0
class caurina.transitions.TweenListObj
{
var scope, timeStart, timeComplete, useFrames, transition, transitionParams, properties, isPaused, timePaused, isCaller, updatesSkipped, timesCalled, skipUpdates, hasStarted, onStart, onUpdate, onComplete, onOverwrite, onError, onStartParams, onUpdateParams, onCompleteParams, onOverwriteParams, onStartScope, onUpdateScope, onCompleteScope, onOverwriteScope, onErrorScope, rounded, count, waitFrames;
function TweenListObj (p_scope, p_timeStart, p_timeComplete, p_useFrames, p_transition, p_transitionParams) {
scope = p_scope;
timeStart = p_timeStart;
timeComplete = p_timeComplete;
useFrames = p_useFrames;
transition = p_transition;
transitionParams = p_transitionParams;
properties = new Object();
isPaused = false;
timePaused = undefined;
isCaller = false;
updatesSkipped = 0;
timesCalled = 0;
skipUpdates = 0;
hasStarted = false;
}
function clone(omitEvents) {
var _local2 = new caurina.transitions.TweenListObj(scope, timeStart, timeComplete, useFrames, transition, transitionParams);
_local2.properties = new Object();
for (var _local3 in properties) {
_local2.properties[_local3] = properties[_local3].clone();
}
_local2.skipUpdates = skipUpdates;
_local2.updatesSkipped = updatesSkipped;
if (!omitEvents) {
_local2.onStart = onStart;
_local2.onUpdate = onUpdate;
_local2.onComplete = onComplete;
_local2.onOverwrite = onOverwrite;
_local2.onError = onError;
_local2.onStartParams = onStartParams;
_local2.onUpdateParams = onUpdateParams;
_local2.onCompleteParams = onCompleteParams;
_local2.onOverwriteParams = onOverwriteParams;
_local2.onStartScope = onStartScope;
_local2.onUpdateScope = onUpdateScope;
_local2.onCompleteScope = onCompleteScope;
_local2.onOverwriteScope = onOverwriteScope;
_local2.onErrorScope = onErrorScope;
}
_local2.rounded = rounded;
_local2.isPaused = isPaused;
_local2.timePaused = timePaused;
_local2.isCaller = isCaller;
_local2.count = count;
_local2.timesCalled = timesCalled;
_local2.waitFrames = waitFrames;
_local2.hasStarted = hasStarted;
return(_local2);
}
function toString() {
var _local2 = "\n[TweenListObj ";
_local2 = _local2 + ("scope:" + String(scope));
_local2 = _local2 + ", properties:";
var _local3 = true;
for (var _local4 in properties) {
if (!_local3) {
_local2 = _local2 + ",";
}
_local2 = _local2 + ("[name:" + properties[_local4].name);
_local2 = _local2 + (",valueStart:" + properties[_local4].valueStart);
_local2 = _local2 + (",valueComplete:" + properties[_local4].valueComplete);
_local2 = _local2 + "]";
_local3 = false;
}
_local2 = _local2 + (", timeStart:" + String(timeStart));
_local2 = _local2 + (", timeComplete:" + String(timeComplete));
_local2 = _local2 + (", useFrames:" + String(useFrames));
_local2 = _local2 + (", transition:" + String(transition));
_local2 = _local2 + (", transitionParams:" + String(transitionParams));
if (skipUpdates) {
_local2 = _local2 + (", skipUpdates:" + String(skipUpdates));
}
if (updatesSkipped) {
_local2 = _local2 + (", updatesSkipped:" + String(updatesSkipped));
}
if (onStart) {
_local2 = _local2 + (", onStart:" + String(onStart));
}
if (onUpdate) {
_local2 = _local2 + (", onUpdate:" + String(onUpdate));
}
if (onComplete) {
_local2 = _local2 + (", onComplete:" + String(onComplete));
}
if (onOverwrite) {
_local2 = _local2 + (", onOverwrite:" + String(onOverwrite));
}
if (onError) {
_local2 = _local2 + (", onError:" + String(onError));
}
if (onStartParams) {
_local2 = _local2 + (", onStartParams:" + String(onStartParams));
}
if (onUpdateParams) {
_local2 = _local2 + (", onUpdateParams:" + String(onUpdateParams));
}
if (onCompleteParams) {
_local2 = _local2 + (", onCompleteParams:" + String(onCompleteParams));
}
if (onOverwriteParams) {
_local2 = _local2 + (", onOverwriteParams:" + String(onOverwriteParams));
}
if (onStartScope) {
_local2 = _local2 + (", onStartScope:" + String(onStartScope));
}
if (onUpdateScope) {
_local2 = _local2 + (", onUpdateScope:" + String(onUpdateScope));
}
if (onCompleteScope) {
_local2 = _local2 + (", onCompleteScope:" + String(onCompleteScope));
}
if (onOverwriteScope) {
_local2 = _local2 + (", onOverwriteScope:" + String(onOverwriteScope));
}
if (onErrorScope) {
_local2 = _local2 + (", onErrorScope:" + String(onErrorScope));
}
if (rounded) {
_local2 = _local2 + (", rounded:" + String(rounded));
}
if (isPaused) {
_local2 = _local2 + (", isPaused:" + String(isPaused));
}
if (timePaused) {
_local2 = _local2 + (", timePaused:" + String(timePaused));
}
if (isCaller) {
_local2 = _local2 + (", isCaller:" + String(isCaller));
}
if (count) {
_local2 = _local2 + (", count:" + String(count));
}
if (timesCalled) {
_local2 = _local2 + (", timesCalled:" + String(timesCalled));
}
if (waitFrames) {
_local2 = _local2 + (", waitFrames:" + String(waitFrames));
}
if (hasStarted) {
_local2 = _local2 + (", hasStarted:" + String(hasStarted));
}
_local2 = _local2 + "]\n";
return(_local2);
}
static function makePropertiesChain(p_obj) {
var _local6 = p_obj.base;
if (_local6) {
var _local5 = {};
var _local2;
if (_local6 instanceof Array) {
_local2 = [];
var _local3 = 0;
while (_local3 < _local6.length) {
_local2.push(_local6[_local3]);
_local3++;
}
} else {
_local2 = [_local6];
}
_local2.push(p_obj);
var _local4;
var _local7 = _local2.length;
var _local1 = 0;
while (_local1 < _local7) {
if (_local2[_local1].base) {
_local4 = caurina.transitions.AuxFunctions.concatObjects(makePropertiesChain(_local2[_local1].base), _local2[_local1]);
} else {
_local4 = _local2[_local1];
}
_local5 = caurina.transitions.AuxFunctions.concatObjects(_local5, _local4);
_local1++;
}
if (_local5.base) {
delete _local5.base;
}
return(_local5);
}
return(p_obj);
}
}
Symbol 1437 MovieClip [__Packages.caurina.transitions.AuxFunctions] Frame 0
class caurina.transitions.AuxFunctions
{
function AuxFunctions () {
}
static function numberToR(p_num) {
return((p_num & 16711680) >> 16);
}
static function numberToG(p_num) {
return((p_num & 65280) >> 8);
}
static function numberToB(p_num) {
return(p_num & 255);
}
static function isInArray(p_string, p_array) {
var _local2 = p_array.length;
var _local1 = 0;
while (_local1 < _local2) {
if (p_array[_local1] == p_string) {
return(true);
}
_local1++;
}
return(false);
}
static function getObjectLength(p_object) {
var _local1 = 0;
for (var _local2 in p_object) {
_local1++;
}
return(_local1);
}
static function concatObjects() {
var _local4 = {};
var _local2;
var _local3 = 0;
while (_local3 < arguments.length) {
_local2 = arguments[_local3];
for (var _local5 in _local2) {
if (_local2[_local5] == null) {
delete _local4[_local5];
} else {
_local4[_local5] = _local2[_local5];
}
}
_local3++;
}
return(_local4);
}
}
Symbol 1438 MovieClip [__Packages.caurina.transitions.PropertyInfoObj] Frame 0
class caurina.transitions.PropertyInfoObj
{
var valueStart, valueComplete, originalValueComplete, arrayIndex, extra, isSpecialProperty, hasModifier, modifierFunction, modifierParameters;
function PropertyInfoObj (p_valueStart, p_valueComplete, p_originalValueComplete, p_arrayIndex, p_extra, p_isSpecialProperty, p_modifierFunction, p_modifierParameters) {
valueStart = p_valueStart;
valueComplete = p_valueComplete;
originalValueComplete = p_originalValueComplete;
arrayIndex = p_arrayIndex;
extra = p_extra;
isSpecialProperty = p_isSpecialProperty;
hasModifier = p_modifierFunction != undefined;
modifierFunction = p_modifierFunction;
modifierParameters = p_modifierParameters;
}
function clone() {
var _local2 = new caurina.transitions.PropertyInfoObj(valueStart, valueComplete, originalValueComplete, arrayIndex, extra, isSpecialProperty, modifierFunction, modifierParameters);
return(_local2);
}
function toString() {
var _local2 = "\n[PropertyInfoObj ";
_local2 = _local2 + ("valueStart:" + String(valueStart));
_local2 = _local2 + ", ";
_local2 = _local2 + ("valueComplete:" + String(valueComplete));
_local2 = _local2 + ", ";
_local2 = _local2 + ("originalValueComplete:" + String(originalValueComplete));
_local2 = _local2 + ", ";
_local2 = _local2 + ("arrayIndex:" + String(arrayIndex));
_local2 = _local2 + ", ";
_local2 = _local2 + ("extra:" + String(extra));
_local2 = _local2 + ", ";
_local2 = _local2 + ("isSpecialProperty:" + String(isSpecialProperty));
_local2 = _local2 + ", ";
_local2 = _local2 + ("hasModifier:" + String(hasModifier));
_local2 = _local2 + ", ";
_local2 = _local2 + ("modifierFunction:" + String(modifierFunction));
_local2 = _local2 + ", ";
_local2 = _local2 + ("modifierParameters:" + String(modifierParameters));
_local2 = _local2 + "]\n";
return(_local2);
}
}
Symbol 1439 MovieClip [__Packages.caurina.transitions.SpecialPropertySplitter] Frame 0
class caurina.transitions.SpecialPropertySplitter
{
var parameters;
function SpecialPropertySplitter (p_splitFunction, p_parameters) {
splitValues = p_splitFunction;
parameters = p_parameters;
}
function splitValues(p_value, p_parameters) {
return([]);
}
function toString() {
var _local2 = "";
_local2 = _local2 + "[SpecialPropertySplitter ";
_local2 = _local2 + ("splitValues:" + splitValues.toString());
_local2 = _local2 + ", ";
_local2 = _local2 + ("parameters:" + parameters.toString());
_local2 = _local2 + "]";
return(_local2);
}
}
Symbol 1440 MovieClip [__Packages.caurina.transitions.Equations] Frame 0
class caurina.transitions.Equations
{
function Equations () {
trace("Equations is a static class and should not be instantiated.");
}
static function init() {
caurina.transitions.Tweener.registerTransition("easenone", easeNone);
caurina.transitions.Tweener.registerTransition("linear", easeNone);
caurina.transitions.Tweener.registerTransition("easeinquad", easeInQuad);
caurina.transitions.Tweener.registerTransition("easeoutquad", easeOutQuad);
caurina.transitions.Tweener.registerTransition("easeinoutquad", easeInOutQuad);
caurina.transitions.Tweener.registerTransition("easeoutinquad", easeOutInQuad);
caurina.transitions.Tweener.registerTransition("easeincubic", easeInCubic);
caurina.transitions.Tweener.registerTransition("easeoutcubic", easeOutCubic);
caurina.transitions.Tweener.registerTransition("easeinoutcubic", easeInOutCubic);
caurina.transitions.Tweener.registerTransition("easeoutincubic", easeOutInCubic);
caurina.transitions.Tweener.registerTransition("easeinquart", easeInQuart);
caurina.transitions.Tweener.registerTransition("easeoutquart", easeOutQuart);
caurina.transitions.Tweener.registerTransition("easeinoutquart", easeInOutQuart);
caurina.transitions.Tweener.registerTransition("easeoutinquart", easeOutInQuart);
caurina.transitions.Tweener.registerTransition("easeinquint", easeInQuint);
caurina.transitions.Tweener.registerTransition("easeoutquint", easeOutQuint);
caurina.transitions.Tweener.registerTransition("easeinoutquint", easeInOutQuint);
caurina.transitions.Tweener.registerTransition("easeoutinquint", easeOutInQuint);
caurina.transitions.Tweener.registerTransition("easeinsine", easeInSine);
caurina.transitions.Tweener.registerTransition("easeoutsine", easeOutSine);
caurina.transitions.Tweener.registerTransition("easeinoutsine", easeInOutSine);
caurina.transitions.Tweener.registerTransition("easeoutinsine", easeOutInSine);
caurina.transitions.Tweener.registerTransition("easeincirc", easeInCirc);
caurina.transitions.Tweener.registerTransition("easeoutcirc", easeOutCirc);
caurina.transitions.Tweener.registerTransition("easeinoutcirc", easeInOutCirc);
caurina.transitions.Tweener.registerTransition("easeoutincirc", easeOutInCirc);
caurina.transitions.Tweener.registerTransition("easeinexpo", easeInExpo);
caurina.transitions.Tweener.registerTransition("easeoutexpo", easeOutExpo);
caurina.transitions.Tweener.registerTransition("easeinoutexpo", easeInOutExpo);
caurina.transitions.Tweener.registerTransition("easeoutinexpo", easeOutInExpo);
caurina.transitions.Tweener.registerTransition("easeinelastic", easeInElastic);
caurina.transitions.Tweener.registerTransition("easeoutelastic", easeOutElastic);
caurina.transitions.Tweener.registerTransition("easeinoutelastic", easeInOutElastic);
caurina.transitions.Tweener.registerTransition("easeoutinelastic", easeOutInElastic);
caurina.transitions.Tweener.registerTransition("easeinback", easeInBack);
caurina.transitions.Tweener.registerTransition("easeoutback", easeOutBack);
caurina.transitions.Tweener.registerTransition("easeinoutback", easeInOutBack);
caurina.transitions.Tweener.registerTransition("easeoutinback", easeOutInBack);
caurina.transitions.Tweener.registerTransition("easeinbounce", easeInBounce);
caurina.transitions.Tweener.registerTransition("easeoutbounce", easeOutBounce);
caurina.transitions.Tweener.registerTransition("easeinoutbounce", easeInOutBounce);
caurina.transitions.Tweener.registerTransition("easeoutinbounce", easeOutInBounce);
}
static function easeNone(t, b, c, d, p_params) {
return(((c * t) / d) + b);
}
static function easeInQuad(t, b, c, d, p_params) {
t = t / d;
return(((c * t) * t) + b);
}
static function easeOutQuad(t, b, c, d, p_params) {
t = t / d;
return((((-c) * t) * (t - 2)) + b);
}
static function easeInOutQuad(t, b, c, d, p_params) {
t = t / (d / 2);
if (t < 1) {
return((((c / 2) * t) * t) + b);
}
t--;
return((((-c) / 2) * ((t * (t - 2)) - 1)) + b);
}
static function easeOutInQuad(t, b, c, d, p_params) {
if (t < (d / 2)) {
return(easeOutQuad(t * 2, b, c / 2, d, p_params));
}
return(easeInQuad((t * 2) - d, b + (c / 2), c / 2, d, p_params));
}
static function easeInCubic(t, b, c, d, p_params) {
t = t / d;
return((((c * t) * t) * t) + b);
}
static function easeOutCubic(t, b, c, d, p_params) {
t = (t / d) - 1;
return((c * (((t * t) * t) + 1)) + b);
}
static function easeInOutCubic(t, b, c, d, p_params) {
t = t / (d / 2);
if (t < 1) {
return(((((c / 2) * t) * t) * t) + b);
}
t = t - 2;
return(((c / 2) * (((t * t) * t) + 2)) + b);
}
static function easeOutInCubic(t, b, c, d, p_params) {
if (t < (d / 2)) {
return(easeOutCubic(t * 2, b, c / 2, d, p_params));
}
return(easeInCubic((t * 2) - d, b + (c / 2), c / 2, d, p_params));
}
static function easeInQuart(t, b, c, d, p_params) {
t = t / d;
return(((((c * t) * t) * t) * t) + b);
}
static function easeOutQuart(t, b, c, d, p_params) {
t = (t / d) - 1;
return(((-c) * ((((t * t) * t) * t) - 1)) + b);
}
static function easeInOutQuart(t, b, c, d, p_params) {
t = t / (d / 2);
if (t < 1) {
return((((((c / 2) * t) * t) * t) * t) + b);
}
t = t - 2;
return((((-c) / 2) * ((((t * t) * t) * t) - 2)) + b);
}
static function easeOutInQuart(t, b, c, d, p_params) {
if (t < (d / 2)) {
return(easeOutQuart(t * 2, b, c / 2, d, p_params));
}
return(easeInQuart((t * 2) - d, b + (c / 2), c / 2, d, p_params));
}
static function easeInQuint(t, b, c, d, p_params) {
t = t / d;
return((((((c * t) * t) * t) * t) * t) + b);
}
static function easeOutQuint(t, b, c, d, p_params) {
t = (t / d) - 1;
return((c * (((((t * t) * t) * t) * t) + 1)) + b);
}
static function easeInOutQuint(t, b, c, d, p_params) {
t = t / (d / 2);
if (t < 1) {
return(((((((c / 2) * t) * t) * t) * t) * t) + b);
}
t = t - 2;
return(((c / 2) * (((((t * t) * t) * t) * t) + 2)) + b);
}
static function easeOutInQuint(t, b, c, d, p_params) {
if (t < (d / 2)) {
return(easeOutQuint(t * 2, b, c / 2, d, p_params));
}
return(easeInQuint((t * 2) - d, b + (c / 2), c / 2, d, p_params));
}
static function easeInSine(t, b, c, d, p_params) {
return((((-c) * Math.cos((t / d) * (Math.PI/2))) + c) + b);
}
static function easeOutSine(t, b, c, d, p_params) {
return((c * Math.sin((t / d) * (Math.PI/2))) + b);
}
static function easeInOutSine(t, b, c, d, p_params) {
return((((-c) / 2) * (Math.cos((Math.PI * t) / d) - 1)) + b);
}
static function easeOutInSine(t, b, c, d, p_params) {
if (t < (d / 2)) {
return(easeOutSine(t * 2, b, c / 2, d, p_params));
}
return(easeInSine((t * 2) - d, b + (c / 2), c / 2, d, p_params));
}
static function easeInExpo(t, b, c, d, p_params) {
return(((t == 0) ? (b) : (((c * Math.pow(2, 10 * ((t / d) - 1))) + b) - (c * 0.001))));
}
static function easeOutExpo(t, b, c, d, p_params) {
return(((t == d) ? (b + c) : (((c * 1.001) * ((-Math.pow(2, (-10 * t) / d)) + 1)) + b)));
}
static function easeInOutExpo(t, b, c, d, p_params) {
if (t == 0) {
return(b);
}
if (t == d) {
return(b + c);
}
t = t / (d / 2);
if (t < 1) {
return((((c / 2) * Math.pow(2, 10 * (t - 1))) + b) - (c * 0.0005));
}
t--;
return((((c / 2) * 1.0005) * ((-Math.pow(2, -10 * t)) + 2)) + b);
}
static function easeOutInExpo(t, b, c, d, p_params) {
if (t < (d / 2)) {
return(easeOutExpo(t * 2, b, c / 2, d, p_params));
}
return(easeInExpo((t * 2) - d, b + (c / 2), c / 2, d, p_params));
}
static function easeInCirc(t, b, c, d, p_params) {
t = t / d;
return(((-c) * (Math.sqrt(1 - (t * t)) - 1)) + b);
}
static function easeOutCirc(t, b, c, d, p_params) {
t = (t / d) - 1;
return((c * Math.sqrt(1 - (t * t))) + b);
}
static function easeInOutCirc(t, b, c, d, p_params) {
t = t / (d / 2);
if (t < 1) {
return((((-c) / 2) * (Math.sqrt(1 - (t * t)) - 1)) + b);
}
t = t - 2;
return(((c / 2) * (Math.sqrt(1 - (t * t)) + 1)) + b);
}
static function easeOutInCirc(t, b, c, d, p_params) {
if (t < (d / 2)) {
return(easeOutCirc(t * 2, b, c / 2, d, p_params));
}
return(easeInCirc((t * 2) - d, b + (c / 2), c / 2, d, p_params));
}
static function easeInElastic(t, b, c, d, p_params) {
if (t == 0) {
return(b);
}
t = t / d;
if (t == 1) {
return(b + c);
}
var _local2 = ((p_params.period == undefined) ? (d * 0.3) : (p_params.period));
var _local5;
var _local1 = p_params.amplitude;
if ((!_local1) || (_local1 < Math.abs(c))) {
_local1 = c;
_local5 = _local2 / 4;
} else {
_local5 = (_local2 / (Math.PI*2)) * Math.asin(c / _local1);
}
t = t - 1;
return((-((_local1 * Math.pow(2, 10 * t)) * Math.sin((((t * d) - _local5) * (Math.PI*2)) / _local2))) + b);
}
static function easeOutElastic(t, b, c, d, p_params) {
if (t == 0) {
return(b);
}
t = t / d;
if (t == 1) {
return(b + c);
}
var _local3 = ((p_params.period == undefined) ? (d * 0.3) : (p_params.period));
var _local5;
var _local1 = p_params.amplitude;
if ((!_local1) || (_local1 < Math.abs(c))) {
_local1 = c;
_local5 = _local3 / 4;
} else {
_local5 = (_local3 / (Math.PI*2)) * Math.asin(c / _local1);
}
return((((_local1 * Math.pow(2, -10 * t)) * Math.sin((((t * d) - _local5) * (Math.PI*2)) / _local3)) + c) + b);
}
static function easeInOutElastic(t, b, c, d, p_params) {
if (t == 0) {
return(b);
}
t = t / (d / 2);
if (t == 2) {
return(b + c);
}
var _local3 = ((p_params.period == undefined) ? (d * 0.45) : (p_params.period));
var _local5;
var _local1 = p_params.amplitude;
if ((!_local1) || (_local1 < Math.abs(c))) {
_local1 = c;
_local5 = _local3 / 4;
} else {
_local5 = (_local3 / (Math.PI*2)) * Math.asin(c / _local1);
}
if (t < 1) {
t = t - 1;
return((-0.5 * ((_local1 * Math.pow(2, 10 * t)) * Math.sin((((t * d) - _local5) * (Math.PI*2)) / _local3))) + b);
}
t = t - 1;
return(((((_local1 * Math.pow(2, -10 * t)) * Math.sin((((t * d) - _local5) * (Math.PI*2)) / _local3)) * 0.5) + c) + b);
}
static function easeOutInElastic(t, b, c, d, p_params) {
if (t < (d / 2)) {
return(easeOutElastic(t * 2, b, c / 2, d, p_params));
}
return(easeInElastic((t * 2) - d, b + (c / 2), c / 2, d, p_params));
}
static function easeInBack(t, b, c, d, p_params) {
var _local1 = ((p_params.overshoot == undefined) ? 1.70158 : (p_params.overshoot));
t = t / d;
return((((c * t) * t) * (((_local1 + 1) * t) - _local1)) + b);
}
static function easeOutBack(t, b, c, d, p_params) {
var _local2 = ((p_params.overshoot == undefined) ? 1.70158 : (p_params.overshoot));
t = (t / d) - 1;
return((c * (((t * t) * (((_local2 + 1) * t) + _local2)) + 1)) + b);
}
static function easeInOutBack(t, b, c, d, p_params) {
var _local2 = ((p_params.overshoot == undefined) ? 1.70158 : (p_params.overshoot));
t = t / (d / 2);
if (t < 1) {
_local2 = _local2 * 1.525;
return(((c / 2) * ((t * t) * (((_local2 + 1) * t) - _local2))) + b);
}
t = t - 2;
_local2 = _local2 * 1.525;
return(((c / 2) * (((t * t) * (((_local2 + 1) * t) + _local2)) + 2)) + b);
}
static function easeOutInBack(t, b, c, d, p_params) {
if (t < (d / 2)) {
return(easeOutBack(t * 2, b, c / 2, d, p_params));
}
return(easeInBack((t * 2) - d, b + (c / 2), c / 2, d, p_params));
}
static function easeInBounce(t, b, c, d, p_params) {
return((c - easeOutBounce(d - t, 0, c, d)) + b);
}
static function easeOutBounce(t, b, c, d, p_params) {
t = t / d;
if (t < 0.363636363636364) {
return((c * ((7.5625 * t) * t)) + b);
}
if (t < 0.727272727272727) {
t = t - 0.545454545454545;
return((c * (((7.5625 * t) * t) + 0.75)) + b);
}
if (t < 0.909090909090909) {
t = t - 0.818181818181818;
return((c * (((7.5625 * t) * t) + 0.9375)) + b);
}
t = t - 0.954545454545455;
return((c * (((7.5625 * t) * t) + 0.984375)) + b);
}
static function easeInOutBounce(t, b, c, d, p_params) {
if (t < (d / 2)) {
return((easeInBounce(t * 2, 0, c, d) * 0.5) + b);
}
return(((easeOutBounce((t * 2) - d, 0, c, d) * 0.5) + (c * 0.5)) + b);
}
static function easeOutInBounce(t, b, c, d, p_params) {
if (t < (d / 2)) {
return(easeOutBounce(t * 2, b, c / 2, d, p_params));
}
return(easeInBounce((t * 2) - d, b + (c / 2), c / 2, d, p_params));
}
}
Symbol 1441 MovieClip [__Packages.caurina.transitions.SpecialProperty] Frame 0
class caurina.transitions.SpecialProperty
{
var getValue, setValue, parameters, preProcess;
function SpecialProperty (p_getFunction, p_setFunction, p_parameters, p_preProcessFunction) {
getValue = p_getFunction;
setValue = p_setFunction;
parameters = p_parameters;
preProcess = p_preProcessFunction;
}
function toString() {
var _local2 = "";
_local2 = _local2 + "[SpecialProperty ";
_local2 = _local2 + ("getValue:" + getValue.toString());
_local2 = _local2 + ", ";
_local2 = _local2 + ("setValue:" + setValue.toString());
_local2 = _local2 + ", ";
_local2 = _local2 + ("parameters:" + parameters.toString());
_local2 = _local2 + ", ";
_local2 = _local2 + ("preProcess:" + preProcess.toString());
_local2 = _local2 + "]";
return(_local2);
}
}
Symbol 1442 MovieClip [__Packages.caurina.transitions.SpecialPropertyModifier] Frame 0
class caurina.transitions.SpecialPropertyModifier
{
var modifyValues, getValue;
function SpecialPropertyModifier (p_modifyFunction, p_getFunction) {
modifyValues = p_modifyFunction;
getValue = p_getFunction;
}
function toString() {
var _local2 = "";
_local2 = _local2 + "[SpecialPropertyModifier ";
_local2 = _local2 + ("modifyValues:" + modifyValues.toString());
_local2 = _local2 + ", ";
_local2 = _local2 + ("getValue:" + getValue.toString());
_local2 = _local2 + "]";
return(_local2);
}
}
Symbol 80 MovieClip Frame 40
stop();
Symbol 92 Button
on (release) {
startMovie();
}
Symbol 93 MovieClip Frame 1
function timerHandler() {
if (!loadingComplete) {
var _local4 = _root.getBytesLoaded() / _root.getBytesTotal();
bar._xscale = 100 * _local4;
if (_local4 == 1) {
loadingComplete = true;
if (AUTO_PLAY) {
startMovie();
} else {
gotoAndStop ("loaded");
}
return(undefined);
}
}
dt = getTimer() - time;
time = time + dt;
frameAccum = frameAccum + dt;
var _local3 = 0;
while ((frameAccum >= FRAME_TIME) && (_local3 < MAX_FRAME_SKIP)) {
advanceFrame(tankLogo, true, true);
advanceFrame(loadingText, false, true);
advanceFrame(barGfx, false, true);
if (loadingComplete) {
advanceFrame(this, false, false);
}
(frameAccum = frameAccum - FRAME_TIME);
_local3++;
}
updateAfterEvent();
}
function advanceFrame(clip, recurse, loop) {
if (!clip) {
return(undefined);
}
clip.stop();
if (clip._currentframe == clip._totalframes) {
if (loop) {
clip.gotoAndStop(1);
}
} else {
clip.nextFrame();
}
if (recurse) {
for (childName in clip) {
if (typeof(clip[childName]) == "movieclip") {
advanceFrame(clip[childName], recurse, loop);
}
}
}
}
function startMovie() {
clearInterval(intervalId);
_root.play();
}
_root.stop();
stop();
var FRAME_TIME = 33.3333333333333;
var AUTO_PLAY = false;
var MAX_FRAME_SKIP = 5;
var loadingComplete;
var intervalId;
var time;
var frameAccum;
loadingComplete = false;
intervalId = setInterval(this, "timerHandler", FRAME_TIME / 2);
frameAccum = 0;
time = getTimer();
timerHandler();
Symbol 96 Button
on (release) {
this._visible = false;
}
Symbol 105 MovieClip Frame 1
_visible = false;
var checkConnection = function (event) {
if (!event.success) {
_visible = true;
gotoAndStop (3);
}
};
if (com.Newgrounds.NewgroundsAPI.isNewgrounds() || (_root.API_Settings.debug_mode)) {
com.Newgrounds.NewgroundsAPI.addEventListener(com.Newgrounds.NewgroundsAPI.events.MOVIE_CONNECTED, checkConnection);
if ((!com.Newgrounds.NewgroundsAPI.hasUserSession()) && (!_root.API_Settings.debug_mode)) {
_visible = true;
gotoAndStop (2);
}
}
com.Newgrounds.NewgroundsAPI.setMovieVersion(_root.API_Settings.movie_version);
com.Newgrounds.NewgroundsAPI.connectMovie(_root.API_Settings.movie_id, _root.API_Settings.enc_key, _root.API_Settings.debug_mode);
com.Newgrounds.NewgroundsAPI.loadMedals();
stop();
Symbol 118 MovieClip Frame 1
function unlockMedal(m_name) {
clearInterval(pop_delay);
var _local1 = com.Newgrounds.NewgroundsAPI.getMedals();
var _local2 = null;
for (i in _local1) {
if (_local1[i].medal_name == m_name) {
_local2 = _local1[i];
medal_name = _local2.medal_name;
medal_value = _local2.medal_value + "pts";
com.Newgrounds.NewgroundsAPI.unlockMedal(medal_name);
clearInterval(pop_delay);
pop_delay = setInterval(endDelay, 3000);
_visible = true;
gotoAndPlay (2);
break;
}
}
}
function endDelay(params) {
gotoAndPlay (10);
clearInterval(pop_delay);
}
var pop_delay;
var medal_name = "?????";
var medal_value = "???";
_visible = false;
Symbol 118 MovieClip Frame 10
var myBitmapData = flash.display.BitmapData.loadBitmap(medal_name + ".jpg");
medal_icon.attachBitmap(myBitmapData, 111);
stop();
Instance of Symbol 117 MovieClip in Symbol 118 MovieClip Frame 10
onClipEvent (load) {
delay = 60;
}
onClipEvent (enterFrame) {
delay--;
if (delay < 0) {
_parent.play();
}
}
Symbol 124 MovieClip Frame 20
stop();
Symbol 125 MovieClip Frame 25
stop();
Symbol 163 MovieClip Frame 1
_root.stop();
Symbol 163 MovieClip Frame 265
_root.play();
Symbol 183 MovieClip Frame 2
stop();
Symbol 187 MovieClip Frame 1
var colorTrans = (new flash.geom.ColorTransform());
colorTrans.redOffset = -_parent._parent._parent.r;
colorTrans.greenOffset = -_parent._parent._parent.g;
colorTrans.blueOffset = -_parent._parent._parent.b;
var trans = (new flash.geom.Transform(this));
trans.colorTransform = colorTrans;
Symbol 190 MovieClip Frame 1
var colorTrans = (new flash.geom.ColorTransform());
colorTrans.redOffset = -_parent._parent._parent.r;
colorTrans.greenOffset = -_parent._parent._parent.g;
colorTrans.blueOffset = -_parent._parent._parent.b;
var trans = (new flash.geom.Transform(this));
trans.colorTransform = colorTrans;
Symbol 200 MovieClip Frame 1
var colorTrans = (new flash.geom.ColorTransform());
if (!(_parent.r === undefined)) {
colorTrans.redOffset = -_parent.r;
colorTrans.greenOffset = -_parent.g;
colorTrans.blueOffset = -_parent.b;
} else {
colorTrans.redOffset = -_parent._parent._parent.r;
colorTrans.greenOffset = -_parent._parent._parent.g;
colorTrans.blueOffset = -_parent._parent._parent.b;
}
var trans = (new flash.geom.Transform(this));
trans.colorTransform = colorTrans;
Symbol 204 MovieClip Frame 1
var colorTrans = (new flash.geom.ColorTransform());
colorTrans.redOffset = -_parent._parent._parent.r;
colorTrans.greenOffset = -_parent._parent._parent.g;
colorTrans.blueOffset = -_parent._parent._parent.b;
var trans = (new flash.geom.Transform(this));
trans.colorTransform = colorTrans;
Instance of Symbol 198 MovieClip [deadguyleg] in Symbol 209 MovieClip Frame 1
onClipEvent (load) {
if (_parent._parent.no_lleg) {
this._visible = false;
}
}
Instance of Symbol 198 MovieClip [deadguyleg] in Symbol 209 MovieClip Frame 1
onClipEvent (load) {
if (_parent._parent.no_rleg) {
this._visible = false;
}
}
Instance of Symbol 202 MovieClip [deadguyarm] in Symbol 209 MovieClip Frame 1
onClipEvent (load) {
if (_parent._parent.no_rarm) {
this._visible = false;
}
}
Instance of Symbol 202 MovieClip [deadguyarm] in Symbol 209 MovieClip Frame 1
onClipEvent (load) {
if (_parent._parent.no_larm) {
this._visible = false;
}
}
Instance of Symbol 206 MovieClip [deadguytorso] in Symbol 209 MovieClip Frame 1
onClipEvent (load) {
if (_parent._parent.no_torso) {
this._visible = false;
}
}
Instance of Symbol 208 MovieClip [deadguyhead] in Symbol 209 MovieClip Frame 1
onClipEvent (load) {
if (_parent._parent.no_head) {
this._visible = false;
}
}
Symbol 209 MovieClip Frame 15
stop();
Symbol 210 MovieClip Frame 1
function die() {
this._visible = true;
delete this.onEnterFrame;
this.gotoAndStop("dead");
}
function slideAway(amount, deg) {
this._visible = true;
this.gotoAndStop("dead");
this._rotation = deg - 90;
this.yspeed = Math.sin(toRadian * deg) * amount;
this.xspeed = Math.cos(toRadian * deg) * amount;
this.onEnterFrame = function () {
this._x = this._x - ((xspeed = xspeed * 0.9));
this._y = this._y - ((yspeed = yspeed * 0.9));
if ((((Math.abs(xspeed) + Math.abs(yspeed)) < 0.1) || (_parent.detectIfOutsideBorder(this))) || (_parent.detectObstacle(this))) {
_parent.bloodSpill(this._x, this._y);
delete this.onEnterFrame;
}
mat = new flash.geom.Matrix();
mat.rotate((this._rotation / 180) * Math.PI);
mat.tx = this._x;
mat.ty = this._y;
_root.game.bd.draw(_root.blood_spot, mat);
};
}
speed = 1.5;
this.cacheAsBitmap = true;
_root.manList.push(this);
human = true;
this.r = random(200);
this.g = random(200);
this.b = random(200);
_rotation = ((_rotation == 0) ? (random(360)) : (_rotation));
toRadian = (Math.PI/180);
scared = 0;
walkaway = 0;
fearable = true;
this.onEnterFrame = function () {
if (!(_parent.gamestate === "intro")) {
buffer = 50;
this.moving = true;
if (this._x < ((-buffer) - _root.game._x)) {
this.moving = false;
}
if (this._x > ((_root._stageWidth - _root.game._x) + buffer)) {
this.moving = false;
}
if (this._y < ((-buffer) - _root.game._y)) {
this.moving = false;
}
if (this._y > ((_root._stageHeight - _root.game._y) + buffer)) {
this.moving = false;
}
if (!this.moving) {
this._visible = false;
} else {
this._visible = true;
if (walkaway > 0) {
walkaway--;
}
if (scared > 0) {
scared--;
speed = 3;
this.gotoAndStop("running");
} else {
speed = 1.5;
this.gotoAndStop("walk");
}
this._rotation = this._rotation + (random(3) - 1);
turnaround = false;
buffer = 30;
narwhal = random(60) - 30;
if (this._x < (_parent.background.borderSize + buffer)) {
_rotation = (-90 + narwhal);
walkaway = 10;
}
if (this._y < (_parent.background.borderSize + buffer)) {
_rotation = (0 + narwhal);
walkaway = 10;
}
if (this._x > ((_parent.background._width - _parent.background.borderSize) - buffer)) {
_rotation = (90 + narwhal);
walkaway = 10;
}
if (this._y > ((_parent.background._height - _parent.background.borderSize) - buffer)) {
_rotation = (180 + narwhal);
walkaway = 10;
}
this.yspeed = Math.cos(toRadian * this._rotation) * this.speed;
this.xspeed = Math.sin(toRadian * this._rotation) * this.speed;
pt = {x:this._x, y:this._y};
_parent.localToGlobal(pt);
for (o in _parent.obstacleList) {
obs = _parent.obstacleList[o];
if (obs.hitTest(this)) {
if (obs.hitTest(pt.x, pt.y, true)) {
walkaway = 30;
_rotation = (_rotation + 180);
this.yspeed = Math.cos(toRadian * this._rotation) * this.speed;
this.xspeed = Math.sin(toRadian * this._rotation) * this.speed;
}
}
}
this._x = this._x - this.xspeed;
this._y = this._y + this.yspeed;
}
}
};
gotoAndStop ("walk");
Symbol 222 MovieClip Frame 3
stop();
Symbol 225 MovieClip Frame 2
stop();
Symbol 231 MovieClip Frame 5
stop();
Symbol 324 MovieClip Frame 54
stop();
Symbol 382 MovieClip Frame 3
stop();
Symbol 391 MovieClip Frame 1
stop();
Symbol 423 MovieClip Frame 1
stop();
Symbol 423 MovieClip Frame 10
stop();
Symbol 430 MovieClip Frame 1
stop();
Symbol 436 MovieClip Frame 5
stop();
Symbol 441 MovieClip Frame 4
stop();
Symbol 448 MovieClip Frame 6
stop();
Instance of Symbol 436 MovieClip in Symbol 449 MovieClip Frame 1
onClipEvent (enterFrame) {
gotoAndStop(_root.upgrades.minigunR);
}
Instance of Symbol 436 MovieClip in Symbol 449 MovieClip Frame 1
onClipEvent (enterFrame) {
gotoAndStop(_root.upgrades.minigunL);
}
Instance of Symbol 441 MovieClip "backgunsR" in Symbol 449 MovieClip Frame 1
onClipEvent (enterFrame) {
gotoAndStop(_root.upgrades.backgunsR);
}
Instance of Symbol 441 MovieClip "backgunsL" in Symbol 449 MovieClip Frame 1
onClipEvent (enterFrame) {
gotoAndStop(_root.upgrades.backguns);
}
Instance of Symbol 448 MovieClip in Symbol 449 MovieClip Frame 1
onClipEvent (enterFrame) {
gotoAndStop(_root.upgrades.missile);
}
Symbol 449 MovieClip Frame 2
stop();
Instance of Symbol 222 MovieClip "neons" in Symbol 450 MovieClip Frame 1
onClipEvent (enterFrame) {
gotoAndStop(_root.upgrades.neonColour);
}
Instance of Symbol 225 MovieClip in Symbol 450 MovieClip Frame 1
onClipEvent (enterFrame) {
if (_root.upgrades.grillBlades) {
_visible = true;
gotoAndStop (2);
} else if (_root.upgrades.grillGuard) {
_visible = true;
gotoAndStop (1);
} else {
_visible = false;
}
}
Instance of Symbol 231 MovieClip in Symbol 450 MovieClip Frame 1
onClipEvent (enterFrame) {
gotoAndStop(_root.upgrades.exhaust);
}
Instance of Symbol 324 MovieClip "base" in Symbol 450 MovieClip Frame 1
onClipEvent (enterFrame) {
gotoAndStop(_root.upgrades.carColour);
}
Instance of Symbol 382 MovieClip in Symbol 450 MovieClip Frame 1
onClipEvent (enterFrame) {
gotoAndStop(_root.upgrades.tintColour);
}
Instance of Symbol 391 MovieClip in Symbol 450 MovieClip Frame 1
onClipEvent (enterFrame) {
gotoAndStop(_root.upgrades.extra);
}
Instance of Symbol 394 MovieClip "lights" in Symbol 450 MovieClip Frame 1
onClipEvent (enterFrame) {
this._visible = _root.upgrades.lights;
}
Instance of Symbol 450 MovieClip "innercar" in Symbol 451 MovieClip Frame 1
/* no clip actions */
Symbol 457 MovieClip Frame 2
stop();
Symbol 461 MovieClip Frame 1
ptype = "money";
if (!this.registered) {
this.registered = true;
used = false;
for (ex in _root.extras[ptype]) {
extra = _root.extras[ptype][ex];
trace(extra);
if (extra == _root.level) {
trace("extra hidden");
_visible = false;
used = true;
}
}
if (!used) {
_parent.registerPickup(this);
}
}
Symbol 465 MovieClip Frame 1
ptype = "paint";
if (!this.registered) {
this.registered = true;
used = false;
for (ex in _root.extras[ptype]) {
extra = _root.extras[ptype][ex];
trace(extra);
if (extra == _root.level) {
trace("extra hidden");
_visible = false;
used = true;
}
}
if (!used) {
_parent.registerPickup(this);
}
}
Symbol 475 MovieClip Frame 2
stop();
Symbol 478 MovieClip Frame 10
_parent.gotoAndStop("walk");
Symbol 481 MovieClip Frame 1
function die() {
this._visible = true;
delete this.onEnterFrame;
this.gotoAndStop("dead");
}
function slideAway(amount, deg) {
this._visible = true;
this.gotoAndStop("dead");
this._rotation = deg - 90;
this.yspeed = Math.sin(toRadian * deg) * amount;
this.xspeed = Math.cos(toRadian * deg) * amount;
this.onEnterFrame = function () {
this._x = this._x - ((xspeed = xspeed * 0.9));
this._y = this._y - ((yspeed = yspeed * 0.9));
if ((((Math.abs(xspeed) + Math.abs(yspeed)) < 0.1) || (_parent.detectIfOutsideBorder(this))) || (_parent.detectObstacle(this))) {
_parent.bloodSpill(this._x, this._y);
delete this.onEnterFrame;
}
mat = new flash.geom.Matrix();
mat.rotate((this._rotation / 180) * Math.PI);
mat.tx = this._x;
mat.ty = this._y;
_root.game.bd.draw(_root.blood_spot, mat);
};
}
function fireBullet() {
_root.playSound("enemy_shot");
gotoAndStop ("shoot");
d = _parent.getNextHighestDepth();
bullet = _parent.attachMovie("minigun_ammo", "bullet" + d, d);
bullet.onEnterFrame = _parent.enBulletOEF;
bullet._rotation = this._rotation + 90;
bullet._x = this._x;
bullet._y = this._y;
}
speed = 1.5;
this.r = random(200);
this.g = random(200);
this.b = random(200);
_root.manList.push(this);
human = true;
_rotation = ((_rotation == 0) ? (random(360)) : (_rotation));
toRadian = (Math.PI/180);
scared = 0;
walkaway = 0;
counter = -random(50);
this.onEnterFrame = function () {
if (!(_parent.gamestate === "intro")) {
buffer = 50;
this.moving = true;
if (this._x < ((-buffer) - _root.game._x)) {
this.moving = false;
}
if (this._x > ((_root._stageWidth - _root.game._x) + buffer)) {
this.moving = false;
}
if (this._y < ((-buffer) - _root.game._y)) {
this.moving = false;
}
if (this._y > ((_root._stageHeight - _root.game._y) + buffer)) {
this.moving = false;
}
if (!this.moving) {
this._visible = false;
} else {
this._visible = true;
counter++;
if (counter >= (45 - (_root.difficulty * 5))) {
counter = 0;
fireBullet();
}
speed = 1;
if (walkaway > 0) {
walkaway--;
} else {
this._rotation = ((Math.atan2(this._y - this._parent.car._y, this._x - this._parent.car._x) * 180) / Math.PI) + 90;
}
turnaround = false;
narwhal = random(60) - 30;
if (this._x < _parent.background.borderSize) {
_rotation = (-90 + narwhal);
walkaway = 10;
}
if (this._y < _parent.background.borderSize) {
_rotation = (0 + narwhal);
walkaway = 10;
}
if (this._x > (_parent.background._width - _parent.background.borderSize)) {
_rotation = (90 + narwhal);
walkaway = 10;
}
if (this._y > (_parent.background._height - _parent.background.borderSize)) {
_rotation = (180 + narwhal);
walkaway = 10;
}
if ((Math.abs(this._x - _parent.car._x) + Math.abs(this._y - _parent.car._y)) > 200) {
this.yspeed = Math.cos(toRadian * this._rotation) * this.speed;
this.xspeed = Math.sin(toRadian * this._rotation) * this.speed;
pt = {x:this._x, y:this._y};
_parent.localToGlobal(pt);
for (o in _parent.obstacleList) {
obs = _parent.obstacleList[o];
if (obs.hitTest(this)) {
if (obs.hitTest(pt.x, pt.y, true)) {
walkaway = 30;
_rotation = (_rotation + 180);
this.yspeed = Math.cos(toRadian * this._rotation) * this.speed;
this.xspeed = Math.sin(toRadian * this._rotation) * this.speed;
}
}
}
this._x = this._x - this.xspeed;
this._y = this._y + this.yspeed;
}
}
}
};
gotoAndStop ("walk");
Symbol 483 MovieClip Frame 1
_parent.registerObstacle(this);
_alpha = 0;
Symbol 492 MovieClip Frame 2
stop();
Symbol 496 MovieClip Frame 1
ptype = "tints";
if (!this.registered) {
this.registered = true;
used = false;
for (ex in _root.extras[ptype]) {
extra = _root.extras[ptype][ex];
trace(extra);
if (extra == _root.level) {
trace("extra hidden");
_visible = false;
used = true;
}
}
if (!used) {
_parent.registerPickup(this);
}
}
Symbol 498 MovieClip Frame 1
_parent.registerObstacle(this);
_alpha = 0;
Symbol 501 MovieClip Frame 1
function findCarDir() {
y = this._y - _parent.car._y;
x = this._x - _parent.car._x;
d = ((Math.atan2(y, x) * toDegree) + 720) % 360;
return(d);
}
toDegree = 57.2957795130823;
degSoFar = 0;
lastCarDir = findCarDir();
startCarDir = findCarDir();
laps = 0;
this.onEnterFrame = function () {
carDir = findCarDir();
if (Math.abs(lastCarDir - carDir) < 200) {
if ((carDir <= startCarDir) && (wasGT)) {
trace("anticlockwise lap?!?!?");
laps++;
}
if ((carDir > startCarDir) && (!wasGT)) {
trace("clockwise lap?!?!?");
laps--;
}
}
wasGT = carDir > startCarDir;
lastCarDir = carDir;
};
Symbol 508 MovieClip Frame 2
stop();
Symbol 512 MovieClip Frame 1
ptype = "extras";
if (!this.registered) {
this.registered = true;
used = false;
for (ex in _root.extras[ptype]) {
extra = _root.extras[ptype][ex];
trace(extra);
if (extra == _root.level) {
trace("extra hidden");
_visible = false;
used = true;
}
}
if (!used) {
_parent.registerPickup(this);
}
}
Symbol 517 MovieClip Frame 2
stop();
Symbol 520 MovieClip Frame 2
stop();
Symbol 524 MovieClip Frame 1
if (!this.registered) {
this.registered = true;
_parent.registerPickup(this);
}
ptype = "ammo";
Symbol 528 MovieClip Frame 1
if (!this.registered) {
this.registered = true;
_parent.registerPickup(this);
}
ptype = "health";
Symbol 532 MovieClip Frame 1
ptype = "neons";
if (!this.registered) {
this.registered = true;
used = false;
for (ex in _root.extras[ptype]) {
extra = _root.extras[ptype][ex];
trace(extra);
if (extra == _root.level) {
trace("extra hidden");
_visible = false;
used = true;
}
}
if (!used) {
_parent.registerPickup(this);
}
}
Symbol 540 MovieClip Frame 2
stop();
Symbol 546 MovieClip Frame 1
_parent.registerObstacle(this);
_alpha = 0;
Symbol 555 MovieClip Frame 2
stop();
Symbol 557 MovieClip Frame 1
_parent.registerObstacle(this);
_alpha = 0;
Symbol 561 MovieClip Frame 2
stop();
Symbol 564 MovieClip Frame 2
stop();
Symbol 572 MovieClip Frame 2
stop();
Symbol 574 MovieClip Frame 1
_alpha = 80;
Symbol 579 MovieClip Frame 2
stop();
Symbol 581 MovieClip Frame 2
stop();
Symbol 586 MovieClip Frame 2
stop();
Symbol 591 MovieClip Frame 2
stop();
Symbol 598 MovieClip Frame 1
function die() {
delete this.onEnterFrame;
this.gotoAndStop(2);
_parent.blastMarks(this);
_parent.addExplosion(this._x, this._y);
}
function fireBullet() {
d = _parent.getNextHighestDepth();
bullet = _parent.attachMovie("minigun_ammo", "bullet" + d, d);
bullet.boss = true;
bullet.onEnterFrame = _parent.enBulletOEF;
bullet._rotation = gun._rotation + 90;
bullet._x = this._x;
bullet._y = this._y;
}
function fireMissile() {
_root.playSound("missilefire");
d = _parent.getNextHighestDepth();
bullet = _parent.attachMovie("missile_1", "bullet" + d, d);
bullet.onEnterFrame = _parent.enMissileOEF;
bullet._x = this._x;
bullet._y = this._y;
bullet._rotation = gun._rotation + 90;
bullet.speed = _parent.missileBaseSpeed;
return(bullet);
}
function slideAway(amount, deg) {
}
_root.manList.push(this);
stop();
this.health = (this.maxhealth = 3);
toRadian = (Math.PI/180);
toDegree = 57.2957795130823;
scared = 0;
counter = random(50);
this.onEnterFrame = function () {
if (!(_parent.gamestate === "intro")) {
buffer = 50;
this.moving = true;
if (this._x < ((-buffer) - _root.game._x)) {
this.moving = false;
}
if (this._x > ((_root._stageWidth - _root.game._x) + buffer)) {
this.moving = false;
}
if (this._y < ((-buffer) - _root.game._y)) {
this.moving = false;
}
if (this._y > ((_root._stageHeight - _root.game._y) + buffer)) {
this.moving = false;
}
if (!this.moving) {
this._visible = false;
} else {
this._visible = true;
pt1 = {x:this._x, y:this._y};
pt2 = {x:this._parent.car._x, y:this._parent.car._y};
dist = _parent.findDist(pt1, pt2);
frames = dist / 25;
predict_x = this._parent.car._x + (frames * this._parent.car.xspeed);
predict_y = this._parent.car._y - (frames * this._parent.car.yspeed);
gun._rotation = (Math.atan2(this._y - predict_y, this._x - predict_x) * toDegree) + 90;
counter++;
if (counter >= (45 - (_root.difficulty * 5))) {
counter = 0;
fireMissile();
}
}
}
};
Symbol 601 MovieClip Frame 2
stop();
Symbol 602 MovieClip Frame 2
stop();
Symbol 607 MovieClip Frame 1
function die() {
this._visible = true;
delete this.onEnterFrame;
clr = new Color(this);
clr.setRGB(0);
trace("buggyboss hit");
this.counter = 80;
this.onEnterFrame = function () {
if (random(10) == 1) {
d = this._parent.getNextHighestDepth();
smoke = this._parent.attachMovie("trail_smoke", "s" + d, d);
smoke._x = (this._x - 25) + random(50);
smoke._y = (this._y - 25) + random(50);
smoke._rotation = random(360);
smoke.onEnterFrame = this._parent.trailSmokeOEF;
}
this.counter--;
if (this.counter <= 0) {
_parent.blastMarks(this);
_parent.deRegisterObstacle(this);
_parent.addExplosion(this._x, this._y);
this._visible = false;
delete this.onEnterFrame;
}
};
}
function fireBullet() {
d = _parent.getNextHighestDepth();
bullet = _parent.attachMovie("minigun_ammo", "bullet" + d, d);
_root.playSound("enemy_shot");
bullet.onEnterFrame = _parent.enBulletOEF;
bullet._rotation = this._rotation + 90;
bullet._x = this._x + ((((l = !l)) ? 1 : -1) * 20);
bullet._y = this._y;
}
function slideAway(amount, deg) {
}
_root.manList.push(this);
_parent.registerObstacle(this);
this.cacheAsBitmap = true;
this.enemy = true;
this.health = (this.maxhealth = (this.boss ? 60 : 10));
toRadian = (Math.PI/180);
toDegree = 57.2957795130823;
scared = 0;
counter = random(50);
stagecounter = 50;
attackstage = 0;
speed = 2;
this.onEnterFrame = function () {
if (!(_parent.gamestate === "intro")) {
buffer = 50;
this.moving = true;
if (this._x < ((-buffer) - _root.game._x)) {
this.moving = false;
}
if (this._x > ((_root._stageWidth - _root.game._x) + buffer)) {
this.moving = false;
}
if (this._y < ((-buffer) - _root.game._y)) {
this.moving = false;
}
if (this._y > ((_root._stageHeight - _root.game._y) + buffer)) {
this.moving = false;
}
if (!this.moving) {
this._visible = false;
} else {
this._visible = true;
stagecounter++;
counter++;
if (this.boss) {
switch (attackstage) {
case 0 :
if (stagecounter > 80) {
stagecounter = 0;
attackstage++;
}
break;
case 1 :
if (counter >= 10) {
counter = 0;
fireBullet();
}
if (stagecounter > 100) {
stagecounter = 0;
attackstage++;
}
break;
case 2 :
if (counter >= 1) {
counter = 0;
fireBullet();
}
if (stagecounter <= 50) {
break;
}
stagecounter = 0;
attackstage = 0;
}
} else if (counter >= 10) {
counter = 0;
fireBullet();
}
premove = {x:this._x, y:this._y};
this._rotation = (Math.atan2(this._y - this._parent.car._y, this._x - this._parent.car._x) * toDegree) + 90;
this.yspeed = Math.cos(toRadian * this._rotation) * this.speed;
this.xspeed = Math.sin(toRadian * this._rotation) * this.speed;
if ((Math.abs(this._x - _parent.car._x) + Math.abs(this._y - _parent.car._y)) > 400) {
this._y = this._y + this.yspeed;
this._x = this._x - this.xspeed;
} else if ((Math.abs(this._x - _parent.car._x) + Math.abs(this._y - _parent.car._y)) < 100) {
}
if (_parent.detectWallObstacle(this)) {
this._x = premove.x;
this._y = premove.y;
}
}
}
};
Symbol 611 MovieClip Frame 2
stop();
Symbol 616 MovieClip Frame 1
function die() {
this._visible = true;
delete this.onEnterFrame;
clr = new Color(this);
clr.setRGB(0);
trace("buggy hit");
this.counter = 80;
this.onEnterFrame = function () {
if (random(10) == 1) {
d = this._parent.getNextHighestDepth();
smoke = this._parent.attachMovie("trail_smoke", "s" + d, d);
smoke._x = (this._x - 25) + random(50);
smoke._y = (this._y - 25) + random(50);
smoke._rotation = random(360);
smoke.onEnterFrame = this._parent.trailSmokeOEF;
}
this.counter--;
if (this.counter <= 0) {
_parent.blastMarks(this);
_parent.deRegisterObstacle(this);
_parent.addExplosion(this._x, this._y);
this._visible = false;
delete this.onEnterFrame;
}
};
}
function fireBullet() {
_root.playSound("enemy_shot");
d = _parent.getNextHighestDepth();
bullet = _parent.attachMovie("minigun_ammo", "bullet" + d, d);
bullet.onEnterFrame = _parent.enBulletOEF;
bullet._rotation = this._rotation + 90;
bullet._x = this._x;
bullet._y = this._y;
}
function slideAway(amount, deg) {
}
_root.manList.push(this);
_parent.registerObstacle(this);
this.cacheAsBitmap = true;
this.enemy = true;
this.health = (this.maxhealth = 5);
toRadian = (Math.PI/180);
toDegree = 57.2957795130823;
scared = 0;
counter = -random(50);
speed = 2;
this.onEnterFrame = function () {
if (!(_parent.gamestate === "intro")) {
buffer = 50;
this.moving = true;
if (this._x < ((-buffer) - _root.game._x)) {
this.moving = false;
}
if (this._x > ((_root._stageWidth - _root.game._x) + buffer)) {
this.moving = false;
}
if (this._y < ((-buffer) - _root.game._y)) {
this.moving = false;
}
if (this._y > ((_root._stageHeight - _root.game._y) + buffer)) {
this.moving = false;
}
if (!this.moving) {
this._visible = false;
} else {
this._visible = true;
counter++;
if (counter >= (35 - (_root.difficulty * 5))) {
counter = 0;
fireBullet();
}
premove = {x:this._x, y:this._y};
this._rotation = (Math.atan2(this._y - this._parent.car._y, this._x - this._parent.car._x) * toDegree) + 90;
this.yspeed = Math.cos(toRadian * this._rotation) * this.speed;
this.xspeed = Math.sin(toRadian * this._rotation) * this.speed;
if ((Math.abs(this._x - _parent.car._x) + Math.abs(this._y - _parent.car._y)) > 400) {
this._y = this._y + this.yspeed;
this._x = this._x - this.xspeed;
} else if ((Math.abs(this._x - _parent.car._x) + Math.abs(this._y - _parent.car._y)) < 100) {
}
if (_parent.detectWallObstacle(this)) {
this._x = premove.x;
this._y = premove.y;
}
}
}
};
Symbol 621 MovieClip Frame 2
stop();
Symbol 628 MovieClip Frame 1
this.onEnterFrame = function () {
buffer = 50;
this.moving = true;
if (this._x < ((-buffer) - _root.game._x)) {
this.moving = false;
}
if (this._x > ((_root._stageWidth - _root.game._x) + buffer)) {
this.moving = false;
}
if (this._y < ((-buffer) - _root.game._y)) {
this.moving = false;
}
if (this._y > ((_root._stageHeight - _root.game._y) + buffer)) {
this.moving = false;
}
if (!this.moving) {
this._visible = false;
} else {
this._visible = true;
}
};
Symbol 630 MovieClip Frame 2
stop();
Symbol 632 MovieClip Frame 2
stop();
Symbol 637 MovieClip Frame 2
stop();
Symbol 639 MovieClip Frame 2
stop();
Symbol 642 MovieClip Frame 2
stop();
Symbol 644 MovieClip Frame 2
stop();
Symbol 648 MovieClip Frame 2
stop();
Symbol 649 MovieClip Frame 2
stop();
Symbol 651 MovieClip Frame 2
stop();
Symbol 653 MovieClip Frame 2
stop();
Symbol 654 MovieClip Frame 2
stop();
Symbol 656 MovieClip Frame 2
stop();
Symbol 658 MovieClip Frame 2
stop();
Symbol 661 MovieClip Frame 2
stop();
Symbol 668 MovieClip Frame 2
stop();
Symbol 669 MovieClip Frame 2
stop();
Symbol 671 MovieClip Frame 2
stop();
Symbol 673 MovieClip Frame 2
stop();
Symbol 678 MovieClip Frame 2
stop();
Symbol 687 MovieClip Frame 1
function die() {
trace("boss hit");
}
function fireBullet() {
_root.playSound("enemy_shot");
d = _parent.getNextHighestDepth();
bullet = _parent.attachMovie("minigun_ammo", "bullet" + d, d);
bullet.boss = true;
bullet.onEnterFrame = _parent.enBulletOEF;
bullet._rotation = mc.gl._rotation + 90;
bullet._x = this._x + ((((l = !l)) ? 1 : -1) * 20);
bullet._y = this._y;
}
function slideAway(amount, deg) {
}
_root.manList.push(this);
_parent.registerObstacle(this);
this.cacheAsBitmap = true;
this.enemy = true;
this.health = (this.maxhealth = 70);
toRadian = (Math.PI/180);
toDegree = 57.2957795130823;
scared = 0;
counter = random(50);
stagecounter = 50;
attackstage = 0;
this.onEnterFrame = function () {
stagecounter++;
counter++;
switch (attackstage) {
case 0 :
if (stagecounter > 80) {
stagecounter = 0;
attackstage++;
}
break;
case 1 :
if (counter >= 10) {
counter = 0;
fireBullet();
}
if (stagecounter > 100) {
stagecounter = 0;
attackstage++;
}
break;
case 2 :
if (counter >= 1) {
counter = 0;
fireBullet();
}
if (stagecounter <= 50) {
break;
}
stagecounter = 0;
attackstage = 0;
}
mc.gl._rotation = (Math.atan2(this._y - this._parent.car._y, this._x - this._parent.car._x) * toDegree) + 90;
mc.gr._rotation = (Math.atan2(this._y - this._parent.car._y, this._x - this._parent.car._x) * toDegree) - 90;
};
Symbol 690 MovieClip Frame 1
stop();
Symbol 702 MovieClip Frame 1
Symbol 702 MovieClip Frame 2
stop();
Symbol 704 MovieClip Frame 1
Symbol 704 MovieClip Frame 2
stop();
Symbol 708 MovieClip Frame 2
stop();
Symbol 713 MovieClip Frame 2
stop();
Symbol 715 MovieClip Frame 2
stop();
Symbol 720 MovieClip Frame 2
stop();
Symbol 722 MovieClip Frame 2
stop();
Symbol 724 MovieClip Frame 2
stop();
Symbol 727 MovieClip Frame 1
Symbol 727 MovieClip Frame 2
stop();
Symbol 734 MovieClip Frame 2
stop();
Symbol 737 MovieClip Frame 1
function die() {
this._visible = true;
delete this.onEnterFrame;
this.gotoAndStop("dead");
}
function slideAway(amount, deg) {
this._visible = true;
this.gotoAndStop("dead");
this._rotation = deg - 90;
this.yspeed = Math.sin(toRadian * deg) * amount;
this.xspeed = Math.cos(toRadian * deg) * amount;
this.onEnterFrame = function () {
this._x = this._x - ((xspeed = xspeed * 0.9));
this._y = this._y - ((yspeed = yspeed * 0.9));
mat = new flash.geom.Matrix();
mat.rotate((this._rotation / 180) * Math.PI);
mat.tx = this._x;
mat.ty = this._y;
_root.game.bd.draw(_root.blood_spot, mat);
};
}
function fireBullet() {
_root.playSound("enemy_shot");
gotoAndStop ("shoot");
d = _parent.getNextHighestDepth();
bullet = _parent.attachMovie("minigun_ammo", "bullet" + d, d);
bullet.onEnterFrame = _parent.enBulletOEF;
bullet._rotation = this._rotation + 90;
bullet._x = this._x;
bullet._y = this._y;
}
speed = 1.5;
this.r = random(200);
this.g = random(200);
this.b = random(200);
_root.manList.push(this);
human = true;
_rotation = ((_rotation == 0) ? (random(360)) : (_rotation));
toRadian = (Math.PI/180);
scared = 0;
walkaway = 0;
counter = -random(10);
this.onEnterFrame = function () {
if (!(_parent.gamestate === "intro")) {
buffer = 50;
this.moving = true;
if (this._x < ((-buffer) - _root.game._x)) {
this.moving = false;
}
if (this._x > ((_root._stageWidth - _root.game._x) + buffer)) {
this.moving = false;
}
if (this._y < ((-buffer) - _root.game._y)) {
this.moving = false;
}
if (this._y > ((_root._stageHeight - _root.game._y) + buffer)) {
this.moving = false;
}
if (!this.moving) {
this._visible = false;
} else {
this._visible = true;
counter++;
if (counter == (20 - (_root.difficulty * 2))) {
counter = 0;
fireBullet();
}
speed = 1;
if (walkaway > 0) {
walkaway--;
} else {
this._rotation = ((Math.atan2(this._y - this._parent.car._y, this._x - this._parent.car._x) * 180) / Math.PI) + 90;
}
turnaround = false;
narwhal = random(60) - 30;
if (this._x < _parent.background.borderSize) {
_rotation = (-90 + narwhal);
walkaway = 10;
}
if (this._y < _parent.background.borderSize) {
_rotation = (0 + narwhal);
walkaway = 10;
}
if (this._x > (_parent.background._width - _parent.background.borderSize)) {
_rotation = (90 + narwhal);
walkaway = 10;
}
if (this._y > (_parent.background._height - _parent.background.borderSize)) {
_rotation = (180 + narwhal);
walkaway = 10;
}
if ((Math.abs(this._x - _parent.car._x) + Math.abs(this._y - _parent.car._y)) > 200) {
this.yspeed = Math.cos(toRadian * this._rotation) * this.speed;
this.xspeed = Math.sin(toRadian * this._rotation) * this.speed;
pt = {x:this._x, y:this._y};
_parent.localToGlobal(pt);
for (o in _parent.obstacleList) {
obs = _parent.obstacleList[o];
if (obs.hitTest(this)) {
if (obs.hitTest(pt.x, pt.y, true)) {
walkaway = 30;
_rotation = (_rotation + 180);
this.yspeed = Math.cos(toRadian * this._rotation) * this.speed;
this.xspeed = Math.sin(toRadian * this._rotation) * this.speed;
}
}
}
this._x = this._x - this.xspeed;
this._y = this._y + this.yspeed;
}
}
}
};
gotoAndStop ("walk");
Symbol 741 MovieClip Frame 2
stop();
Symbol 743 MovieClip Frame 2
stop();
Symbol 759 MovieClip Frame 22
_parent.gotoAndStop("walk");
Symbol 775 MovieClip Frame 40
stop();
Symbol 776 MovieClip Frame 1
function die() {
delete this.onEnterFrame;
this.gotoAndStop("die");
trace("boss hit");
}
function fireBullet() {
d = _parent.getNextHighestDepth();
bullet = _parent.attachMovie("minigun_ammo", "bullet" + d, d);
bullet.onEnterFrame = _parent.enBulletOEF;
bullet._rotation = this._rotation + 90;
bullet._x = this._x;
bullet._y = this._y;
trace([bullet._x, bullet._y, bullet._rotation]);
}
function slideAway(amount, deg) {
}
if (this.health == undefined) {
_root.manList.push(this);
this.health = (this.maxhealth = 50);
}
toRadian = (Math.PI/180);
toDegree = 57.2957795130823;
scared = 0;
counter = random(50);
this.speed = 5;
this.onEnterFrame = function () {
this._rotation = (Math.atan2(this._y - this._parent.car._y, this._x - this._parent.car._x) * toDegree) + 90;
if ((Math.abs(this._x - _parent.car._x) + Math.abs(this._y - _parent.car._y)) > 50) {
this._y = this._y + (Math.cos(toRadian * this._rotation) * this.speed);
this._x = this._x - (Math.sin(toRadian * this._rotation) * this.speed);
} else if (this._currentframe == 2) {
_parent.damageCar(10);
deg = Math.atan2(_parent.car._y - this._y, _parent.car._x - this._x) * toDegree;
_parent.car.momentumRotation = deg;
_parent.car.momentumSpeed = 100;
_parent.car.drift = 15;
gotoAndStop ("cut");
}
};
gotoAndStop ("walk");
Symbol 799 MovieClip Frame 20
stop();
Symbol 800 MovieClip Frame 1
function die() {
this.gotoAndStop("die");
trace("boss hit");
}
function fireBullet() {
d = _parent.getNextHighestDepth();
bullet = _parent.attachMovie("minigun_ammo", "bullet" + d, d);
bullet.onEnterFrame = _parent.enBulletOEF;
bullet._rotation = this._rotation + 90;
bullet._x = this._x;
bullet._y = this._y;
trace([bullet._x, bullet._y, bullet._rotation]);
}
function slideAway(amount, deg) {
}
if (this.health == undefined) {
_root.manList.push(this);
this.health = (this.maxhealth = 30);
}
toRadian = (Math.PI/180);
toDegree = 57.2957795130823;
scared = 0;
counter = random(50);
this.speed = 2;
this.onEnterFrame = function () {
counter++;
if (counter >= (15 - _root.difficulty)) {
counter = 0;
fireBullet();
}
this._rotation = (Math.atan2(this._y - this._parent.car._y, this._x - this._parent.car._x) * toDegree) + 90;
if ((Math.abs(this._x - _parent.car._x) + Math.abs(this._y - _parent.car._y)) > 200) {
this._y = this._y + (Math.cos(toRadian * this._rotation) * this.speed);
this._x = this._x - (Math.sin(toRadian * this._rotation) * this.speed);
}
};
gotoAndStop ("walk");
Symbol 806 MovieClip Frame 2
stop();
Symbol 808 MovieClip Frame 1
_parent.registerObstacle(this);
_alpha = 0;
Symbol 809 MovieClip Frame 2
stop();
Symbol 813 MovieClip Frame 2
stop();
Symbol 816 MovieClip Frame 2
stop();
Symbol 817 MovieClip Frame 2
stop();
Symbol 826 MovieClip Frame 2
stop();
Symbol 833 MovieClip Frame 2
stop();
Symbol 834 MovieClip Frame 2
stop();
Symbol 843 MovieClip Frame 1
function die() {
delete this.onEnterFrame;
clr = new Color(this);
clr.setRGB(0);
trace("buggy hit");
this.counter = 80;
this.onEnterFrame = function () {
if (random(10) == 1) {
d = this._parent.getNextHighestDepth();
smoke = this._parent.attachMovie("trail_smoke", "s" + d, d);
smoke._x = (this._x - 25) + random(50);
smoke._y = (this._y - 25) + random(50);
smoke._rotation = random(360);
smoke.onEnterFrame = this._parent.trailSmokeOEF;
}
this.counter--;
if (this.counter <= 0) {
_parent.blastMarks(this);
_parent.deRegisterObstacle(this);
_parent.addExplosion(this._x, this._y);
this._visible = false;
delete this.onEnterFrame;
}
};
}
function fireBullet() {
d = _parent.getNextHighestDepth();
bullet = _parent.attachMovie("minigun_ammo", "bullet" + d, d);
bullet.onEnterFrame = _parent.enBulletOEF;
bullet._rotation = this._rotation + 90;
bullet._x = this._x + ((((l = !l)) ? 1 : -1) * 20);
bullet._y = this._y;
}
function fireMissile() {
trace("firing missile");
_root.playSound("missilefire");
d = _parent.getNextHighestDepth();
bullet = _parent.attachMovie("missile_1", "bullet" + d, d);
bullet.onEnterFrame = _parent.enMissileOEF;
bullet.boss = true;
bullet._x = this._x;
bullet._y = this._y;
bullet._rotation = (this.gun._rotation + this._rotation) + 90;
bullet.speed = _parent.missileBaseSpeed;
return(bullet);
}
function slideAway(amount, deg) {
}
_root.manList.push(this);
_parent.registerObstacle(this);
this.enemy = true;
this.health = (this.maxhealth = 100);
toRadian = (Math.PI/180);
toDegree = 57.2957795130823;
scared = 0;
counter = random(50);
stagecounter = 50;
attackstage = 0;
speed = 2;
this.onEnterFrame = function () {
buffer = 50;
this.moving = true;
if (this._x < ((-buffer) - _root.game._x)) {
this.moving = false;
}
if (this._x > ((_root._stageWidth - _root.game._x) + buffer)) {
this.moving = false;
}
if (this._y < ((-buffer) - _root.game._y)) {
this.moving = false;
}
if (this._y > ((_root._stageHeight - _root.game._y) + buffer)) {
this.moving = false;
}
if (_parent.gamestate == "intro") {
} else {
this._visible = true;
pt1 = {x:this._x, y:this._y};
pt2 = {x:this._parent.car._x, y:this._parent.car._y};
dist = _parent.findDist(pt1, pt2);
frames = dist / 25;
predict_x = this._parent.car._x + (frames * this._parent.car.xspeed);
predict_y = this._parent.car._y - (frames * this._parent.car.yspeed);
gun._rotation = (Math.atan2(this._y - predict_y, this._x - predict_x) * toDegree) + 90;
gun._rotation = gun._rotation - this._rotation;
counter++;
if (counter > 20) {
counter = 0;
missile = fireMissile();
i = 0;
while (i < 10) {
missile.onEnterFrame();
i++;
}
}
this._rotation = (Math.atan2(this._y - this._parent.car._y, this._x - this._parent.car._x) * toDegree) + 90;
if ((Math.abs(this._x - _parent.car._x) + Math.abs(this._y - _parent.car._y)) > 400) {
this.yspeed = Math.cos(toRadian * this._rotation) * this.speed;
this.xspeed = Math.sin(toRadian * this._rotation) * this.speed;
this._y = this._y + this.yspeed;
this._x = this._x - this.xspeed;
}
}
};
Symbol 844 MovieClip [game] Frame 1
function handleKeypress(keycode) {
for (att in keyConfig) {
if (keyConfig[att] == keycode) {
doAction(att);
}
}
}
function doAction(action) {
if (!(gamestate === "intro")) {
switch (action) {
case "fireMissile" :
case "fireMissile2" :
if (numMissiles <= 0) {
break;
}
numMissiles--;
counterMissiles = 0;
if (_root.upgrades.missile > 1) {
_root.playSound("missilefire");
}
switch (_root.upgrades.missile) {
case 1 :
break;
case 2 :
fireMissile();
break;
case 3 :
m = fireMissile();
m._rotation = m._rotation + 5;
m = fireMissile();
m._rotation = m._rotation - 5;
break;
case 4 :
m = fireMissile();
m = fireMissile();
m._rotation = m._rotation + 5;
m = fireMissile();
m._rotation = m._rotation - 5;
break;
case 5 :
m = fireMissile();
m._rotation = m._rotation + 10;
m = fireMissile();
m._rotation = m._rotation - 10;
m = fireMissile();
m._rotation = m._rotation + 5;
m = fireMissile();
m._rotation = m._rotation - 5;
break;
case 6 :
fireMissile();
m = fireMissile();
m._rotation = m._rotation + 10;
m = fireMissile();
m._rotation = m._rotation - 10;
m = fireMissile();
m._rotation = m._rotation + 5;
m = fireMissile();
m._rotation = m._rotation - 5;
}
}
}
}
function fireMissile() {
d = this.getNextHighestDepth();
bullet = this.attachMovie("missile_1", "bullet" + d, d);
bullet.onEnterFrame = missileOEF;
bullet._x = car._x;
bullet._y = car._y;
bullet._rotation = car._rotation - 90;
bullet.speed = missileBaseSpeed;
return(bullet);
}
function flashMessageIngame(txt, x, y) {
d = this.getNextHighestDepth();
msg = this.attachMovie("flashMessage", "msg" + d, d);
msg.txt = txt;
msg._x = x;
msg._y = y;
msg.onEnterFrame = flashMessageOEF;
}
function flashMessageOEF() {
this._alpha = this._alpha - 5;
this._y--;
if (this._alpha < 0) {
this.removeMovieClip();
}
}
function bulletOEF() {
xspeed = Math.cos(toRadian * this._rotation) * bulletSpeed;
yspeed = Math.sin(toRadian * this._rotation) * bulletSpeed;
step = 0;
while (step < 2) {
this._x = this._x + xspeed;
this._y = this._y + yspeed;
pt1 = {x:this._x, y:this._y};
for (m in _root.manList) {
man = _root.manList[m];
if (man._visible) {
pt2 = {x:man._x, y:man._y};
if ((man.human && (findDistSq(pt1, pt2) < 100)) || ((!man.human) && (man.hitTest(this)))) {
kataklism_test = false;
if (man.health) {
man.health--;
trace("health reduced to " + man.health);
showEnemyHealth(man);
} else {
_root.stats.lifetimeGunKills++;
bloodSplatter(man._x, man._y, this._rotation);
bloodSplatter(man._x, man._y, this._rotation + 15);
bloodSplatter(man._x, man._y, this._rotation - 15);
if (man.human) {
man._rotation = this._rotation + 90;
}
killMan(man, m);
}
_root.addKash(3);
this.removeMovieClip();
}
}
}
if (detectIfOutsideBackground(this) || (detectWallObstacle(this))) {
this.removeMovieClip();
}
step++;
}
}
function enBulletOEF() {
xspeed = Math.cos(toRadian * this._rotation) * bulletSpeed;
yspeed = Math.sin(toRadian * this._rotation) * bulletSpeed;
step = 0;
while (step < 2) {
this._x = this._x + xspeed;
this._y = this._y + yspeed;
if (detectIfOutsideBackground(this)) {
this.removeMovieClip();
}
if (!this.boss) {
if (detectWallObstacle(this)) {
this.removeMovieClip();
}
}
if (car.innercar.hitTest(this)) {
trace("enemy bullet hit car");
damageCar(2);
this.removeMovieClip();
}
step++;
}
}
function missileOEF() {
xspeed = Math.cos(toRadian * this._rotation) * this.speed;
yspeed = Math.sin(toRadian * this._rotation) * this.speed;
this._x = this._x + xspeed;
this._y = this._y + yspeed;
this.speed = ((this.speed * 10) + missileTopSpeed) / 11;
d = this._parent.getNextHighestDepth();
trail = this._parent.attachMovie("trail_smoke", "smoke" + d, d);
trail.cacheAsBitmap = true;
trail._rotation = random(360);
trail._x = this._x;
trail._y = this._y;
trail.onEnterFrame = trailSmokeOEF;
for (m in _root.manList) {
man = _root.manList[m];
if (man._visible) {
if (man.hitTest(this)) {
dmg = (man.boss ? 1 : 4);
if (man.health > dmg) {
man.health = man.health - dmg;
trace("health reduced to " + man.health);
showEnemyHealth(man);
} else {
man._rotation = this._rotation + 90;
killMan(man, m);
if (man.human) {
explodeMan(man, 5);
}
_root.stats.lifetimeMissileKills++;
}
detonateMissile(this);
}
}
}
if (detectIfOutsideBorder(this) || (detectObstacle(this))) {
detonateMissile(this);
}
}
function enMissileOEF() {
xspeed = Math.cos(toRadian * this._rotation) * this.speed;
yspeed = Math.sin(toRadian * this._rotation) * this.speed;
this._x = this._x + xspeed;
this._y = this._y + yspeed;
this.speed = ((this.speed * 10) + missileTopSpeed) / 11;
d = this._parent.getNextHighestDepth();
trail = this._parent.attachMovie("trail_smoke", "smoke" + d, d);
trail.cacheAsBitmap = true;
trail._rotation = random(360);
trail._x = this._x;
trail._y = this._y;
trail.onEnterFrame = trailSmokeOEF;
if (detectIfOutsideBackground(this)) {
explodeMissile(this);
}
if (!this.boss) {
if (detectWallObstacle(this)) {
explodeMissile(this);
}
}
if (detectCar(this)) {
trace("enemy missile hit car");
if (this.boss) {
damageCar(15);
} else {
damageCar(5);
}
vec = combineVectors(this._rotation + 90, this.speed, car.momentumRotation, car.momentumSpeed, 1);
car.momentumRotation = vec[0];
car.momentumSpeed = vec[1];
car.drift = car.drift + (5 * _root.difficulty);
explodeMissile(this);
}
}
function killCar() {
smoke = this.attachMovie("explosion", "smoke" + d, d);
smoke._x = car._x;
smoke._y = car._y;
smoke.onEnterFrame = explosionOEF;
clr = new Color(car);
clr.setRGB(0);
}
function trailSmokeOEF() {
xspeed = Math.cos(toRadian * this._rotation) * 0.5;
yspeed = Math.sin(toRadian * this._rotation) * 0.5;
this._x = this._x + xspeed;
this._y = this._y + yspeed;
this._xscale = (this._yscale = this._yscale - 10);
if (this._yscale < 5) {
this.removeMovieClip();
}
}
function explosionSmokeOEF() {
xspeed = Math.cos(toRadian * this._rotation) * 0.5;
yspeed = Math.sin(toRadian * this._rotation) * 0.5;
this._x = this._x + xspeed;
this._y = this._y + yspeed;
this._alpha = this._alpha - 3;
if (this._alpha < 0) {
this.removeMovieClip();
}
}
function explosionOEF() {
if (this._currentframe == this._totalframes) {
this.removeMovieClip();
}
}
function detonateMissile(missile) {
pt1 = {x:missile._x, y:missile._y};
for (m in _root.manList) {
man = _root.manList[m];
if (!man.boss) {
pt2 = {x:man._x, y:man._y};
d = findDistSq(pt1, pt2);
if (d < 10000) {
killMan(man, m);
man.slideAway(10 - (Math.sqrt(d) / 10), Math.atan2(pt1.y - pt2.y, pt1.x - pt2.x) * toDegree);
if (man.human) {
explodeMan(man);
}
}
}
}
explodeMissile(missile);
}
function explodeMissile(missile) {
_root.playSound("explosion" + random(4));
d = missile._parent.getNextHighestDepth();
addExplosion(missile._x, missile._y);
missile.removeMovieClip();
}
function addExplosion(x, y) {
smoke = _root.game.attachMovie("explosion", "smoke" + d, d);
smoke.cacheAsBitmap = true;
smoke._x = x;
smoke._y = y;
smoke._rotation = random(360);
smoke.onEnterFrame = explosionOEF;
smoke._xscale = (smoke._yscale = 50);
}
function killMan(man, m) {
if (_root.manList[m] == man) {
if (man.human) {
bloodSpill(man._x, man._y);
}
if (info.type == "race") {
flashMessageIngame("+1 sec", man._x, man._y);
bonusTime++;
}
_root.addKill();
_root.addKash(10);
man.die();
man.health = 0;
_root.manList.splice(m, 1);
if (_root.manList.length == 0) {
trace(_root.level);
if (_root.maxlevel < _root.level) {
_root.maxlevel = _root.level;
}
if (!(info.type === "race")) {
trace("ALL MEN KILLED ENDGAME");
endGame();
}
}
}
}
function explodeMan(man, severity) {
if (severity == undefined) {
severity = 3;
}
parts = ["arm", "arm", "head", "leg", "leg"];
vars = ["larm", "rarm", "head", "lleg", "rleg"];
i = 0;
while (i < severity) {
p = random(parts.length);
if (!man["no_" + vars[p]]) {
man["no_" + vars[p]] = true;
d = _root.game.goreLayer.getNextHighestDepth();
part = _root.game.goreLayer.attachMovie("deadguy" + parts[p], "part" + d, d);
part.r = man.r;
part.g = man.g;
part.b = man.b;
part._x = man._x;
part._y = man._y;
part.onEnterFrame = bodyPartOEF;
part.direction = (man._rotation - 120) + random(60);
part.speed = 10 + random(20);
part.upspeed = 10 + random(10);
part._rotation = random(360);
part.rotspeed = random(15) - 7;
}
i++;
}
}
function bodyPartOEF() {
this.speed = this.speed * 0.9;
this.upspeed = this.upspeed - 2;
this._xscale = (this._yscale = this._yscale + this.upspeed);
xspeed = Math.cos(toRadian * this.direction) * this.speed;
yspeed = Math.sin(toRadian * this.direction) * this.speed;
this._x = this._x + xspeed;
this._y = this._y + yspeed;
this._rotation = this._rotation + this.rotspeed;
if (detectIfOutsideBorder(this) || (detectObstacle(this))) {
this.direction = this.direction + 180;
}
if (this._xscale < 100) {
this._xscale = (this._yscale = 100);
bloodSplatter(this._x, this._y, this.direction);
if (random(2)) {
bloodLeak(this._x, this._y);
delete this.onEnterFrame;
} else {
this.upspeed = this.upspeed * -0.5;
}
}
}
function showEnemyHealth(enemy) {
if (enemy.healthbar._x == undefined) {
d = _root.game.getNextHighestDepth();
bar = _root.game.attachMovie("enemy_healthbar", "bar" + d, d);
enemy.healthbar = bar;
bar.enemy = enemy;
bar._xscale = (bar._yscale = 0);
caurina.transitions.Tweener.addTween(bar, {_yscale:100, _xscale:100, time:1, delay:0, transition:"easeOutQuad"});
bar.onEnterFrame = enemy_healthbarOEF;
}
enemy.healthbar.timer = 0;
}
function enemy_healthbarOEF() {
this._x = this.enemy._x;
this._y = this.enemy._y;
this.bar._xscale = (100 * this.enemy.health) / this.enemy.maxhealth;
this.timer++;
if ((this.timer >= 100) || (this.enemy.health < 1)) {
this.removeMovieClip();
}
}
function detectObstacle(obj) {
for (o in obstacleList) {
obs = obstacleList[o];
if (obs.hitTest(obj)) {
pt = {x:obj._x, y:obj._y};
obj._parent.localToGlobal(pt);
if (obs.hitTest(pt.x, pt.y, true)) {
return(true);
}
}
}
return(false);
}
function detectWallObstacle(obj) {
for (o in obstacleList) {
obs = obstacleList[o];
if ((!obs.enemy) && (obs.hitTest(obj))) {
pt = {x:obj._x, y:obj._y};
obj._parent.localToGlobal(pt);
if (obs.hitTest(pt.x, pt.y, true)) {
return(true);
}
}
}
return(false);
}
function detectCar(obj) {
obs = car.innercar;
if (obs.hitTest(obj)) {
pt = {x:obj._x, y:obj._y};
obj._parent.localToGlobal(pt);
if (obs.hitTest(pt.x, pt.y, true)) {
return(true);
}
}
return(false);
}
function detectIfOutsideBackground(obj) {
if ((((obj._x < 0) || (obj._y < 0)) || (obj._x > background._width)) || (obj._y > background._height)) {
return(true);
}
return(false);
}
function detectIfOutsideBorder(obj) {
if ((((obj._x < background.borderSize) || (obj._y < background.borderSize)) || (obj._x > (background._width - background.borderSize))) || (obj._y > (background._height - background.borderSize))) {
return(true);
}
return(false);
}
function registerObstacle(obj) {
obstacleList.push(obj);
}
function deRegisterObstacle(obj) {
for (o in obstacleList) {
ob = obstacleList[o];
if (obj == ob) {
obstacleList.splice(o, 1);
}
}
}
function registerBooster(obj) {
boosterList.push(obj);
}
function registerPickup(obj) {
trace("registered pickup ");
trace(obj);
pickupList.push(obj);
}
function findDist(pt1, pt2) {
distx = pt1.x - pt2.x;
disty = pt1.y - pt2.y;
dist = Math.sqrt(Math.pow(distx, 2) + Math.pow(disty, 2));
return(dist);
}
function findDistSq(pt1, pt2) {
distx = pt1.x - pt2.x;
disty = pt1.y - pt2.y;
dist = Math.pow(distx, 2) + Math.pow(disty, 2);
return(dist);
}
function endGame() {
if (!(gamestate === "ending")) {
gamestate = "ending";
_root.timeLeft = timeLimit - (getTimer() - startTime);
if (_root.timeLeft < 0) {
_root.timeLeft = 0;
}
_root.numEnemiesKilled = _root.numEnemies - _root.manList.length;
driveSnd.stop();
_root.end_blackout._visible = true;
_root.end_blackout._alpha = 0;
_root.end_blackout.onEnterFrame = blackoutOEF;
_root.closeGarageDoors();
_root.sceneChange = function () {
trace(engine_loop.snd.getVolume());
engine_loop.snd.setVolume(0);
engine_loop.snd.stop();
engine_loop.removeMovieClip();
if (_root.level > 60) {
_root.gotoAndStop("gameover");
} else {
_root.gotoLevelFinish();
}
};
_root.levelWon = false;
_root.levelType = info.type;
if (info.type == "kill") {
if ((_root.manList.length / _root.numEnemies) <= 0.2) {
_root.level++;
_root.levelWon = true;
}
}
if (info.type == "boss") {
if (_root.manList.length == 0) {
_root.level++;
_root.levelWon = true;
}
}
if (info.type == "race") {
if (Math.abs(raceMarker.laps) >= numLaps) {
_root.level++;
_root.levelWon = true;
}
}
if (_root.levelWon) {
if ((car.health == 100) && (car.innercar.blood._currentframe == 1)) {
_root.klean = true;
}
if ((car.health <= 5) && (car.health > 0)) {
_root.krapped = true;
}
if ((info.type == "kill") && (kataklism_test)) {
_root.kataklism = true;
}
}
}
}
function blackoutOEF() {
this._alpha = this._alpha + 10;
if (this._alpha > 100) {
delete this.onEnterFrame;
}
}
function fireBullet(leftGun) {
_root.playSound("bulletshot");
d = this.getNextHighestDepth();
bullet = this.attachMovie("minigun_ammo", "bullet" + d, d);
bullet.onEnterFrame = bulletOEF;
if (leftGun) {
lr = -15;
} else {
lr = 15;
}
lr_c = Math.cos(toRadian * car._rotation);
lr_s = Math.sin(toRadian * car._rotation);
fb = 26;
fb_c = Math.cos(toRadian * (car._rotation - 90));
fb_s = Math.sin(toRadian * (car._rotation - 90));
bullet._x = (car._x + (fb_c * fb)) + (lr_c * lr);
bullet._y = (car._y + (fb_s * fb)) + (lr_s * lr);
bullet._rotation = car._rotation - 90;
}
function reduceDelayOEF() {
if (this.delay > 0) {
this.delay--;
} else {
this.delay = 0;
}
}
function combineVectors(v1_rot, v1_pow, v2_rot, v2_pow, ratio) {
n = ratio;
v1_y = Math.cos(toRadian * v1_rot) * v1_pow;
v1_x = Math.sin(toRadian * v1_rot) * v1_pow;
v2_x = Math.sin(toRadian * v2_rot) * v2_pow;
v2_y = Math.cos(toRadian * v2_rot) * v2_pow;
n_x = ((v2_x * ratio) + v1_x) / (ratio + 1);
n_y = ((v2_y * ratio) + v1_y) / (ratio + 1);
n_pow = Math.sqrt(Math.pow(n_x, 2) + Math.pow(n_y, 2));
n_rot = Math.atan2(n_x, n_y) * toDegree;
return([n_rot, n_pow]);
}
function damageCar(num) {
num = num * (0.5 + (_root.difficulty * 0.5));
num = num * (1 - (_root.upgrades.armour * 0.1));
car.health = car.health - num;
if (_root.invincible) {
car.health = 100;
}
_root.healthbar.setHealth(car.health);
car.innercar.damage.gotoAndStop(10 - Math.floor(car.health / 10));
if (car.health <= 0) {
trace("KAR KILLED ENDGAME");
killCar();
endGame();
}
}
function blastMarks(obj) {
i = 0;
while (i < 10) {
mat = new flash.geom.Matrix();
mat.rotate(random(360) * toRadian);
mat.tx = obj._x;
mat.ty = obj._y;
bd.draw(_root.blastmark, mat);
i++;
}
}
function bloodLeak(x, y) {
d = background.getNextHighestDepth();
b = background.attachMovie("blood_spill_" + random(2), "spill" + d, d);
b._x = (x + random(9)) - 4;
b._y = (y + random(9)) - 4;
b.onEnterFrame = function () {
if ((this.j = !this.j)) {
mat = new flash.geom.Matrix();
mat.a = (mat.d = this._xscale / 100);
mat.tx = this._x;
mat.ty = this._y;
bd.draw(this, mat);
}
};
b.clean = function () {
this.removeMovieClip();
};
s = random(200) + 200;
if (_root.bloodyhell) {
s = s + (300 + random(200));
}
caurina.transitions.Tweener.addTween(b, {_yscale:s, _xscale:s, time:5, delay:random(2), transition:"easeOutQuart", onComplete:b.clean});
}
function bloodSpill(x, y) {
i = 0;
while (i < 4) {
bloodLeak(x, y);
i++;
}
}
function bloodSplatter(x, y, dir) {
dy = Math.sin(toRadian * dir) * 5;
dx = Math.cos(toRadian * dir) * 5;
mat = new flash.geom.Matrix();
i = 0;
while (i < 10) {
rx = random(31) - 15;
ry = random(31) - 15;
rd = random(10) + i;
d = (Math.abs(rx) + Math.abs(ry)) + rd;
mat.tx = (x + (dx * rd)) + rx;
mat.ty = (y + (dy * rd)) + ry;
mat.a = (mat.d = (0.5 + (random(50) / 100)) * ((40 - d) / 40));
bd.draw(_root.blood_spot, mat);
i++;
}
}
engine_loop = _root.playSound("rev_loop", 0, 1000);
engine_loop.gameFrame = _root._currentframe;
engine_loop.onEnterFrame = function () {
this.snd.setVolume(50 + (speed * 5));
if (!(this.gameFrame === _root._currentframe)) {
trace("shut off engine");
this.snd.stop();
this.removeMovieClip();
}
};
skid_loop = _root.playSound("skid_loop", 0, 1000);
skid_loop.gameFrame = _root._currentframe;
skid_loop.snd.setVolume(0);
skid_loop.onEnterFrame = function () {
this.snd.setVolume(0 + (car.drift * 10));
if (!(this.gameFrame === _root._currentframe)) {
trace("shut off engine");
this.snd.stop();
this.removeMovieClip();
}
};
stop();
this.cacheAsBitmap = true;
gotoAndStop(_root.level);
bulletSpeed = 15;
missileBaseSpeed = 5 + _root.difficulty;
missileTopSpeed = 15 + (_root.difficulty * 8);
numLaps = 7;
lapTime = 60;
bonusTime = 0;
keyConfig = new Object();
keyConfig.fireGun = 87;
keyConfig.fireGun2 = 65;
keyConfig.fireMissile = 68;
keyConfig.fireMissile2 = 83;
Key.removeListener(_root.keyListener);
_root.keyListener = new Object();
_root.keyListener.onKeyDown = function () {
handleKeypress(Key.getCode());
};
_root.keyListener.onKeyUp = function () {
};
Key.addListener(_root.keyListener);
trace("setup keylistener");
if (background.borderSize == undefined) {
background.borderSize = 50;
}
neon_basex = car.innercar.neons._x;
neon_basey = car.innercar.neons._y;
obstacleList = new Array();
boosterList = new Array();
pickupList = new Array();
startTime = getTimer();
timeLimit = 30000 + (5000 * Math.floor(_root.level / 3));
speed = 0;
rotspeed = 0;
toRadian = (Math.PI/180);
toDegree = 57.2957795130823;
cornerlist = new Array();
cornerlist.push(car.innercar.fl);
cornerlist.push(car.innercar.fr);
cornerlist.push(car.innercar.bl);
cornerlist.push(car.innercar.br);
cornerlist.push(car.innercar.l);
cornerlist.push(car.innercar.r);
gamestate = "intro";
kataklism_test = true;
car.momentumSpeed = 0;
car.momentumRotation = car._rotation;
car.drift = 0;
carHistoryList = new Array();
numObsHit = 0;
car.health = 100;
car.xspeed = 0;
car.yspeed = 0;
damageCar(0);
maxLeftBullets = _root.upgrades.minigunL * 5;
maxRightBullets = _root.upgrades.minigunR * 5;
numLeftBullets = maxLeftBullets;
numRightBullets = maxRightBullets;
counterLeftBullets = 0;
counterRightBullets = 0;
maxMissiles = 1;
numMissiles = 1;
counterMissiles = 0;
_root.numEnemies = undefined;
w = background.background._width;
h = background.background._height;
w = ((w > 2880) ? 2880 : (w));
h = ((h > 2880) ? 2880 : (h));
bd = new flash.display.BitmapData(w, h, false, 0);
background.grassmask.cacheAsBitmp = true;
background.grass.cacheAsBitmp = true;
background.grass.setMask(background.grassmask);
background.roadmask.cacheAsBitmp = true;
background.road.cacheAsBitmp = true;
background.road.setMask(background.roadmask);
trace(["masking", background.stonemask, background.stone]);
background.stonemask.cacheAsBitmp = true;
background.stone.cacheAsBitmp = true;
background.stone.setMask(background.stonemask);
bd.draw(background);
background.attachBitmap(bd, 1);
narwhalMC = _root.createEmptyMovieClip("narwhal", _root.getNextHighestDepth());
caurina.transitions.Tweener.addTween(_root.game_status_text, {_y:_root.game_status_text._y, _yscale:_root.game_status_text._yscale, _xscale:_root.game_status_text._xscale, time:0.5, delay:3, transition:"easeOutQuart"});
_root.game_status_text._xscale = (_root.game_status_text._yscale = 300);
_root.game_status_text._y = _root.game_status_text._y + 350;
this.onEnterFrame = function () {
if (!(gamestate === "intro")) {
this.mainLoop();
}
if ((oldgamestate == "intro") && (!(gamestate === "intro"))) {
startTime = getTimer();
}
oldgamestate = gamestate;
if (_root.numEnemies == undefined) {
_root.numEnemies = _root.manList.length;
}
if (info.type == "kill") {
_root.game_status_text.txt = "targets: ";
_root.game_status_text.txt = _root.game_status_text.txt + (((_root.numEnemies - _root.manList.length) + "/") + _root.numEnemies);
}
if (info.type == "race") {
_root.game_status_text.txt = "laps: ";
if (info.laps > 0) {
numLaps = info.laps;
}
if (info.laptime > 0) {
lapTime = info.laptime;
}
_root.game_status_text.txt = _root.game_status_text.txt + ((Math.abs(raceMarker.laps) + "/") + numLaps);
if (Math.abs(raceMarker.laps) >= numLaps) {
trace("RACE OVER ENDGAME");
endGame();
} else {
timeLimit = (((Math.abs(raceMarker.laps) + 1) * lapTime) + bonusTime) * 1000;
}
}
n = 10;
trg = ((_root._stageWidth / 2) - car._x) - (car.xspeed * 15);
_x = (((_x * n) + trg) / (n + 1));
trg = ((_root._stageHeight / 2) - car._y) + (car.yspeed * 15);
_y = (((_y * n) + trg) / (n + 1));
if (_x > 0) {
_x = 0;
}
if (_y > 0) {
_y = 0;
}
if (_x < (_root._stageWidth - background._width)) {
_x = (_root._stageWidth - background._width);
}
if (_y < (_root._stageHeight - background._height)) {
_y = (_root._stageHeight - background._height);
}
};
this.mainLoop = function () {
function carHitHeadon() {
cor = car.innercar.f;
pt = {x:cor._x, y:cor._y};
car.innercar.localToGlobal(pt);
for (o in obstacleList) {
obs = obstacleList[o];
if (obs.hitTest(car)) {
if (obs.hitTest(pt.x, pt.y, true)) {
return(true);
}
}
}
}
function carHitObs() {
for (c in cornerlist) {
cor = cornerlist[c];
cor.pt = {x:cor._x, y:cor._y};
car.innercar.localToGlobal(cor.pt);
}
for (o in obstacleList) {
obs = obstacleList[o];
if (obs.hitTest(car)) {
opt = {x:obs._x, y:obs._y};
for (c in cornerlist) {
cor = cornerlist[c];
pt = cor.pt;
if (obs.hitTest(pt.x, pt.y, true)) {
hitObs = true;
trace(c);
return(true);
}
}
}
}
return(false);
}
starttime = getTimer();
timePassed = getTimer() - startTime;
secondsLeft = Math.ceil((timeLimit - timePassed) / 1000);
if (secondsLeft < 0) {
secondsLeft = 0;
}
_root.statTimeLeft = ((Math.floor(secondsLeft / 60) + ":") + (((secondsLeft % 60) < 10) ? "0" : "")) + (secondsLeft % 60);
if (timePassed > timeLimit) {
if (gamestate == "playing") {
trace("TIME LIMIT OVER ENDGAME");
endGame();
}
}
if (Key.isDown(keyConfig.fireGun) || (Key.isDown(keyConfig.fireGun2))) {
leftGun = !leftGun;
if (leftGun) {
if (_root.upgrades.minigunL > 1) {
if (numLeftBullets > 0) {
numLeftBullets--;
fireBullet(leftGun);
}
}
} else if (_root.upgrades.minigunR > 1) {
if (numRightBullets > 0) {
numRightBullets--;
fireBullet(leftGun);
}
}
}
counterLeftBullets++;
if (counterLeftBullets > (60 - (_root.upgrades.minigunL * 11))) {
counterLeftBullets = 0;
numLeftBullets++;
if (numLeftBullets > maxLeftBullets) {
numLeftBullets = maxLeftBullets;
}
}
counterRightBullets++;
if (counterRightBullets > (60 - (_root.upgrades.minigunR * 11))) {
counterRightBullets = 0;
numRightBullets++;
if (numRightBullets > maxRightBullets) {
numRightBullets = maxRightBullets;
}
}
counterMissiles++;
if (counterMissiles > (50 - (_root.upgrades.missile * 5))) {
counterMissiles = 0;
numMissiles++;
if (numMissiles > maxMissiles) {
numMissiles = maxMissiles;
}
}
_root.barLeftBullets.mask._xscale = (100 * numLeftBullets) / maxLeftBullets;
_root.barRightBullets.mask._xscale = (100 * numRightBullets) / maxRightBullets;
_root.barMissiles.gotoAndStop(numMissiles + 1);
if (Key.isDown(38)) {
speed = speed + (1.5 + (_parent.upgrades.exhaust * 0.2));
if (_root.nos) {
if (Key.isDown(16)) {
speed = ((speed * 5) + 40) / 6;
if (car.drift < 2) {
car.drift = 2;
}
}
}
} else if (Key.isDown(40)) {
speed = speed - 1;
}
if (_root.soundOn) {
spc = Math.abs(speed) / 15;
}
speedkey = ((speed > 5) ? 5 : (speed));
speedkey = ((speedkey < -5) ? -5 : (speedkey));
speed = speed * 0.9;
if (car.drift <= 0) {
car.momentumSpeed = speed;
car.momentumRotation = car._rotation;
} else {
car.drift--;
vec = combineVectors(car._rotation, speed, car.momentumRotation, car.momentumSpeed, 4);
car.momentumRotation = vec[0];
car.momentumSpeed = vec[1];
}
if (Key.isDown(32)) {
car.drift = 10;
car.momentumSpeed = car.momentumSpeed * 0.9;
speed = speed * 0.8;
speedkey = speedkey * 1.3;
}
speedkey = speedkey * 0.3;
rotspeed = rotspeed * 0.8;
if (Key.isDown(37)) {
rotspeed = rotspeed - (speedkey * 1.1);
} else if (Key.isDown(39)) {
rotspeed = rotspeed + (speedkey * 1.1);
}
if ((rotspeed > 5) || (rotspeed < -5)) {
car.drift = car.drift + 1.8;
car.drift = car.drift * 0.9;
}
premove = {x:car._x, y:car._y, rotation:car._rotation};
carHistoryList.unshift(premove);
if (carHistoryList.length > 10) {
carHistoryList.pop();
}
car._rotation = car._rotation + rotspeed;
car.yspeed = Math.cos(toRadian * car._rotation) * speed;
car.xspeed = Math.sin(toRadian * car._rotation) * speed;
xdrift = Math.sin(toRadian * car.momentumRotation) * car.momentumSpeed;
ydrift = Math.cos(toRadian * car.momentumRotation) * car.momentumSpeed;
car.innercar.neons._x = neon_basex + (Math.sin((toRadian * car._rotation) + 45) * 2);
car.innercar.neons._y = neon_basey + (Math.cos((toRadian * car._rotation) + 45) * 2);
xdelta = xdrift + ((car.xspeed - xdrift) * ((10 - car.drift) / 10));
ydelta = ydrift + ((car.yspeed - ydrift) * ((10 - car.drift) / 10));
car._x = car._x + xdelta;
car._y = car._y - ydelta;
for (c in cornerlist) {
cor = cornerlist[c];
pt = {x:cor._x, y:cor._y};
car.innercar.localToGlobal(pt);
cor.pt = pt;
}
zapLayer.clear();
carpt = {x:car._x, y:car._y};
for (m in _root.manList) {
man = _root.manList[m];
if (man._visible) {
manpt = {x:man._x, y:man._y};
distSq = findDistSq(manpt, carpt);
if (distSq < 10000) {
zappable = false;
if ((_parent.upgrades.backgunsR > 1) || (_parent.upgrades.backguns > 1)) {
manDirection = Math.atan2(carpt.y - manpt.y, carpt.x - manpt.x) * toDegree;
manDirection = manDirection - 90;
if (((car._rotation - manDirection) > 0) && ((car._rotation - manDirection) < 180)) {
left = true;
gunmc = car.innercar.weapons.backgunsL;
pt = {x:gunmc._x, y:gunmc._y};
if (_parent.upgrades.backguns > 1) {
if (!gunmc.delay) {
zappable = true;
}
}
} else {
left = false;
gunmc = car.innercar.weapons.backgunsR;
pt = {x:gunmc._x, y:gunmc._y};
if (_parent.upgrades.backgunsR > 1) {
if (!gunmc.delay) {
zappable = true;
}
}
}
}
if (zappable) {
car.innercar.weapons.localToGlobal(pt);
this.globalToLocal(pt);
zapLayer.lineStyle(1, 5077213);
zapLayer.moveTo(pt.x, pt.y);
variance = 10;
midpt = {x:((pt.x + pt.x) + manpt.x) / 3, y:((pt.y + pt.y) + manpt.y) / 3};
zapLayer.lineTo((midpt.x + random((variance * 2) + 1)) - variance, (midpt.y + random((variance * 2) + 1)) - variance);
if (distSq < 5000) {
kataklism_test = false;
if (man.health) {
man.health--;
trace("health reduced to " + man.health);
showEnemyHealth(man);
} else {
killMan(man, m);
}
_root.addKash(5);
zapLayer.lineStyle(5, 5077213);
midpt = {x:((pt.x + manpt.x) + manpt.x) / 3, y:((pt.y + manpt.y) + manpt.y) / 3};
zapLayer.lineTo((midpt.x + random((variance * 2) + 1)) - variance, (midpt.y + random((variance * 2) + 1)) - variance);
zapLayer.lineTo(man._x, man._y);
gunmc.delay = 60 - (10 * (left ? (_parent.upgrades.backguns) : (_parent.upgrades.backgunsR)));
gunmc.onEnterFrame = reduceDelayOEF;
}
}
if (_root.difficulty) {
if (_root.level > 10) {
if (man.fearable) {
man.scared = man.scared + 5;
if (man.walkaway < 1) {
trgrot = (Math.atan2(man._y - car._y, man._x - car._x) * toDegree) - 90;
man._rotation = trgrot;
}
}
}
}
if (man.human) {
if (car.innercar.hitarea.hitTest(man._x + _x, man._y + _y, true)) {
kataklism_test = false;
_root.playSound("runoverperson" + random(2));
if (_root.upgrades.grillBlades) {
damageCar(-1);
}
if (_root.soundOn) {
snd = new Sound(car);
snd.attachSound("hit" + random(3));
snd.setVolume(_root.soundVol);
snd.start();
}
man._rotation = (Math.atan2(man._y - car._y, man._x - car._x) * toDegree) + 90;
killMan(man, m);
cornerlist[0].blood = 100;
cornerlist[1].blood = 100;
if (speed > 10) {
explodeMan(man, 1);
bloodSplatter(man._x, man._y, car._rotation - 90);
bloodSplatter(man._x, man._y, (car._rotation - 90) + 45);
bloodSplatter(man._x, man._y, (car._rotation - 90) - 45);
}
car.innercar.blood.nextFrame();
}
}
}
}
}
for (p in pickupList) {
pup = pickupList[p];
if (pup.hitTest(car)) {
pup._visible = false;
trace(["picking up", pup.ptype]);
switch (pup.ptype) {
case "points" :
break;
case "ammo" :
_root.pickupnotice.show(7);
numLeftBullets = maxLeftBullets;
numRightBullets = maxRightBullets;
break;
case "immunity" :
break;
case "extras" :
_root.pickupnotice.show(4);
_root.addExtra(pup.ptype, _root.level);
break;
case "neons" :
_root.pickupnotice.show(3);
_root.addExtra(pup.ptype, _root.level);
break;
case "paint" :
_root.pickupnotice.show(2);
_root.addExtra(pup.ptype, _root.level);
break;
case "tints" :
_root.pickupnotice.show(1);
_root.addExtra(pup.ptype, _root.level);
break;
case "money" :
_root.addExtra(pup.ptype, _root.level);
_root.pickupnotice.show(5);
_root.addKash(500);
break;
case "health" :
_root.pickupnotice.show(6);
damageCar(-50);
break;
case "life" :
_root.lives++;
_root.livesleft.nextFrame();
}
pickupList.splice(p, 1);
}
}
for (b in boosterList) {
booster = boosterList[b];
if (booster.hitTest(car.innercar)) {
pt1 = {x:booster._x, y:booster._y};
pt2 = {x:car._x, y:car._y};
if (findDistSq(pt1, pt2) < 2500) {
trace("boost");
car.drift = car.drift + 4;
if (car.drift > 15) {
car.drift = 15;
}
trace(car.drift);
speed = speed + 4;
vec = combineVectors(car.momentumRotation, car.momentumSpeed, booster._rotation, 100, 1);
trace(car.momentumRotation);
car.momentumRotation = vec[0];
car.momentumSpeed = vec[1];
}
}
}
hitObs = false;
stack = 0;
while (carHitObs()) {
trace("hit! move back one " + (stack++));
if (stack > 20) {
trace("fuck im stuck!!");
damageCar(100);
break;
}
trace(carHistoryList.length);
oldLoc = carHistoryList.shift();
car._x = oldLoc.x;
car._y = oldLoc.y;
car._rotation = oldLoc.rotation;
if (carHitHeadon()) {
speed = speed * -0.5;
} else {
speed = speed * 0.5;
car.drift = 10;
if ((c == 0) || (c == 2)) {
rotspeed = rotspeed + 3;
} else {
rotspeed = rotspeed - 3;
}
if ((c == 4) || (c == 0)) {
vec = combineVectors(car.momentumRotation, car.momentumSpeed, car._rotation + 90, 10, 1);
car.momentumRotation = vec[0];
car.momentumSpeed = vec[1];
}
if ((c == 5) || (c == 1)) {
vec = combineVectors(car.momentumRotation, car.momentumSpeed, car._rotation - 90, 10, 1);
car.momentumRotation = vec[0];
car.momentumSpeed = vec[1];
}
}
}
if (numObsHit > 2) {
numObsHit--;
oldLoc = carHistoryList.shift();
car._x = oldLoc.x;
car._y = oldLoc.y;
car._rotation = oldLoc.rotation;
speed = 0;
rotspeed = 0;
car.momentumSpeed = 0;
car.drift = 0;
}
if (hitObs) {
numObsHit++;
} else {
numObsHit = 0;
}
if (numObsHit >= 6) {
oldpos = carHistoryList.pop();
car._x = oldpos.x;
car._y = oldpos.y;
car._rotation = oldpos.rotation;
speed = 0;
rotspeed = 0;
car.momentumSpeed = 0;
car.drift = 0;
}
bloodcolour = 8192000 /* 0x7D0000 */;
c = 0;
while (c < 4) {
cor = cornerlist[c];
this.globalToLocal(cor.pt);
if (bd.getPixel(cor.pt.x, cor.pt.y) == bloodcolour) {
cor.blood = 100;
}
if (cor.blood) {
cor.blood = cor.blood - 3;
} else {
cor.blood = 0;
}
if (cor.blood > 0) {
narwhalMC.lineStyle(cor.blood / 20, bloodcolour, cor.blood);
} else {
narwhalMC.lineStyle(car.drift / 4, 0, car.drift * 5);
}
if (!(cor.lastpt === undefined)) {
narwhalMC.moveTo(cor.lastpt.x, cor.lastpt.y);
narwhalMC.lineTo(cor.pt.x, cor.pt.y);
}
cor.lastpt = cor.pt;
c++;
}
bd.draw(narwhalMC);
narwhalMC.clear();
switch (Math.floor(car._rotation / 90)) {
case -2 :
t = car.innercar.br.pt.y;
r = car.innercar.bl.pt.x;
b = car.innercar.fl.pt.y;
l = car.innercar.fr.pt.x;
break;
case -1 :
t = car.innercar.fr.pt.y;
r = car.innercar.br.pt.x;
b = car.innercar.bl.pt.y;
l = car.innercar.fl.pt.x;
break;
case 0 :
t = car.innercar.fl.pt.y;
r = car.innercar.fr.pt.x;
b = car.innercar.br.pt.y;
l = car.innercar.bl.pt.x;
break;
case 1 :
t = car.innercar.bl.pt.y;
r = car.innercar.fl.pt.x;
b = car.innercar.fr.pt.y;
l = car.innercar.br.pt.x;
}
flagt = t < background.borderSize;
flagr = r > (background._width - background.borderSize);
flagb = b > (background._height - background.borderSize);
flagl = l < background.borderSize;
if (flagb) {
if (car.yspeed > 0) {
flagb = false;
}
}
if (((flagt or flagr) or flagb) or flagl) {
trace("trbl!");
trace([flagt, flagr, flagb, flagl]);
if (flagt || (flagb)) {
if (((360 + car._rotation) % 180) > 90) {
rotspeed = rotspeed - 6;
} else {
rotspeed = rotspeed + 6;
}
} else if (((360 + car._rotation) % 180) < 90) {
rotspeed = rotspeed - 6;
} else {
rotspeed = rotspeed + 6;
}
if (speed > 10) {
if (!_root.upgrades.grillGuard) {
damageCar(2);
}
trace("wall hit - health");
if (_root.soundOn) {
hitsnd = new Sound(car);
hitsnd.attachSound("hitwall");
hitsnd.setVolume(_root.soundVol);
hitsnd.start();
}
}
car._x = car._x + (-car.xspeed);
car._y = car._y - (-car.yspeed);
speed = speed * -0.1;
car.momentumSpeed = car.momentumSpeed * -0.8;
if (flagt) {
car._y++;
}
if (flagr) {
car._x--;
}
if (flagb) {
car._y--;
}
if (flagl) {
car._x++;
}
}
if (!(gamestate === "ending")) {
if (_parent.health <= 0) {
}
}
_root.debug_thing._width = getTimer() - starttime;
_root.debug_thing2._width = ((_root.debug_thing2._width + getTimer()) - lasttime) / 2;
lasttime = getTimer();
};
info = new Object();
info.type = "kill";
info.name = "Intro";
info.desc = "the first level";
Symbol 844 MovieClip [game] Frame 2
info = new Object();
info.type = "kill";
info.name = "Intro2";
info.desc = "the second level";
Symbol 844 MovieClip [game] Frame 3
info = new Object();
info.type = "kill";
Symbol 844 MovieClip [game] Frame 4
info = new Object();
info.type = "race";
info.name = "some race";
info.desc = "race lvel";
info.laps = 4;
info.laptime = 30;
Instance of Symbol 501 MovieClip "raceMarker" in Symbol 844 MovieClip [game] Frame 4
/* no clip actions */
Symbol 844 MovieClip [game] Frame 5
info = new Object();
info.type = "kill";
Instance of Symbol 514 MovieClip in Symbol 844 MovieClip [game] Frame 5
onClipEvent (load) {
_parent.registerObstacle(this);
this._alpha = 0;
}
Symbol 844 MovieClip [game] Frame 6
info = new Object();
info.type = "kill";
Symbol 844 MovieClip [game] Frame 7
info = new Object();
info.type = "kill";
Symbol 844 MovieClip [game] Frame 8
info = new Object();
info.type = "race";
info.name = "some race";
info.desc = "race lvel";
info.laps = 6;
info.laptime = 20;
Instance of Symbol 544 MovieClip in Symbol 844 MovieClip [game] Frame 8
onClipEvent (load) {
_parent.registerObstacle(this);
this._visible = false;
}
Instance of Symbol 548 MovieClip in Symbol 844 MovieClip [game] Frame 8
onClipEvent (load) {
_parent.registerObstacle(this);
this._visible = false;
}
Instance of Symbol 550 MovieClip in Symbol 844 MovieClip [game] Frame 8
onClipEvent (load) {
_parent.registerObstacle(this);
this._visible = false;
}
Instance of Symbol 501 MovieClip "raceMarker" in Symbol 844 MovieClip [game] Frame 8
/* no clip actions */
Symbol 844 MovieClip [game] Frame 9
info = new Object();
info.type = "kill";
Symbol 844 MovieClip [game] Frame 10
info = new Object();
info.type = "kill";
Instance of Symbol 563 MovieClip in Symbol 844 MovieClip [game] Frame 10
onClipEvent (load) {
_parent.registerObstacle(this);
_alpha = 0;
}
Symbol 844 MovieClip [game] Frame 11
info = new Object();
info.type = "kill";
Symbol 844 MovieClip [game] Frame 12
info = new Object();
info.type = "race";
info.name = "some race";
info.desc = "race lvel";
info.laps = 4;
info.laptime = 20;
Instance of Symbol 574 MovieClip in Symbol 844 MovieClip [game] Frame 12
onClipEvent (load) {
_parent.registerBooster(this);
}
Instance of Symbol 578 MovieClip in Symbol 844 MovieClip [game] Frame 12
onClipEvent (load) {
_parent.registerObstacle(this);
_alpha = 0;
}
Instance of Symbol 501 MovieClip "raceMarker" in Symbol 844 MovieClip [game] Frame 12
/* no clip actions */
Symbol 844 MovieClip [game] Frame 13
info = new Object();
info.type = "kill";
Symbol 844 MovieClip [game] Frame 14
info = new Object();
info.type = "kill";
Instance of Symbol 583 MovieClip in Symbol 844 MovieClip [game] Frame 14
onClipEvent (load) {
_parent.registerObstacle(this);
_alpha = 0;
}
Symbol 844 MovieClip [game] Frame 15
info = new Object();
info.type = "kill";
Instance of Symbol 588 MovieClip in Symbol 844 MovieClip [game] Frame 15
onClipEvent (load) {
_parent.registerObstacle(this);
_alpha = 0;
}
Symbol 844 MovieClip [game] Frame 16
info = new Object();
info.type = "race";
info.name = "some race";
info.desc = "race lvel";
info.laps = 4;
info.laptime = 8;
Instance of Symbol 600 MovieClip in Symbol 844 MovieClip [game] Frame 16
onClipEvent (load) {
_parent.registerObstacle(this);
_alpha = 0;
}
Instance of Symbol 501 MovieClip "raceMarker" in Symbol 844 MovieClip [game] Frame 16
/* no clip actions */
Symbol 844 MovieClip [game] Frame 17
info = new Object();
info.type = "kill";
Symbol 844 MovieClip [game] Frame 18
info = new Object();
info.type = "boss";
info.name = "Golf Buggy Boss";
info.desc = "Golf Buggy Boss";
Instance of Symbol 607 MovieClip in Symbol 844 MovieClip [game] Frame 18
onClipEvent (load) {
this.boss = true;
}
Symbol 844 MovieClip [game] Frame 19
info = new Object();
info.type = "kill";
Symbol 844 MovieClip [game] Frame 20
info = new Object();
info.type = "kill";
Symbol 844 MovieClip [game] Frame 21
info = new Object();
info.type = "kill";
Symbol 844 MovieClip [game] Frame 22
info = new Object();
info.type = "race";
info.name = "some race";
info.desc = "race lvel";
info.laps = 4;
info.laptime = 15;
Instance of Symbol 634 MovieClip in Symbol 844 MovieClip [game] Frame 22
onClipEvent (load) {
_parent.registerObstacle(this);
_alpha = 0;
}
Instance of Symbol 636 MovieClip in Symbol 844 MovieClip [game] Frame 22
onClipEvent (load) {
_parent.registerObstacle(this);
_alpha = 0;
}
Instance of Symbol 501 MovieClip "raceMarker" in Symbol 844 MovieClip [game] Frame 22
/* no clip actions */
Symbol 844 MovieClip [game] Frame 23
info = new Object();
info.type = "kill";
Symbol 844 MovieClip [game] Frame 24
info = new Object();
info.type = "kill";
Symbol 844 MovieClip [game] Frame 25
info = new Object();
info.type = "kill";
Symbol 844 MovieClip [game] Frame 26
info = new Object();
info.type = "race";
info.name = "some race";
info.desc = "race lvel";
info.laps = 4;
info.laptime = 15;
Instance of Symbol 646 MovieClip in Symbol 844 MovieClip [game] Frame 26
onClipEvent (load) {
_parent.registerObstacle(this);
_alpha = 0;
}
Instance of Symbol 501 MovieClip "raceMarker" in Symbol 844 MovieClip [game] Frame 26
/* no clip actions */
Symbol 844 MovieClip [game] Frame 27
info = new Object();
info.type = "kill";
Symbol 844 MovieClip [game] Frame 28
info = new Object();
info.type = "kill";
Symbol 844 MovieClip [game] Frame 29
info = new Object();
info.type = "kill";
Symbol 844 MovieClip [game] Frame 30
info = new Object();
info.type = "race";
info.name = "some race";
info.desc = "race lvel";
info.laps = 4;
info.laptime = 14;
Instance of Symbol 574 MovieClip in Symbol 844 MovieClip [game] Frame 30
onClipEvent (load) {
_parent.registerBooster(this);
}
Instance of Symbol 578 MovieClip in Symbol 844 MovieClip [game] Frame 30
onClipEvent (load) {
_parent.registerObstacle(this);
_alpha = 0;
}
Instance of Symbol 501 MovieClip "raceMarker" in Symbol 844 MovieClip [game] Frame 30
/* no clip actions */
Symbol 844 MovieClip [game] Frame 31
info = new Object();
info.type = "kill";
Symbol 844 MovieClip [game] Frame 32
info = new Object();
info.type = "kill";
Symbol 844 MovieClip [game] Frame 33
info = new Object();
info.type = "kill";
Symbol 844 MovieClip [game] Frame 34
info = new Object();
info.type = "race";
info.name = "some race";
info.desc = "race lvel";
info.laps = 4;
info.laptime = 10;
Instance of Symbol 663 MovieClip in Symbol 844 MovieClip [game] Frame 34
onClipEvent (load) {
_parent.registerObstacle(this);
_alpha = 0;
}
Instance of Symbol 665 MovieClip in Symbol 844 MovieClip [game] Frame 34
onClipEvent (load) {
_parent.registerObstacle(this);
_alpha = 0;
}
Instance of Symbol 667 MovieClip in Symbol 844 MovieClip [game] Frame 34
onClipEvent (load) {
_parent.registerObstacle(this);
_alpha = 0;
}
Instance of Symbol 501 MovieClip "raceMarker" in Symbol 844 MovieClip [game] Frame 34
/* no clip actions */
Symbol 844 MovieClip [game] Frame 35
info = new Object();
info.type = "kill";
Symbol 844 MovieClip [game] Frame 36
info = new Object();
info.type = "kill";
Symbol 844 MovieClip [game] Frame 37
info = new Object();
info.type = "kill";
Symbol 844 MovieClip [game] Frame 38
info = new Object();
info.type = "race";
info.name = "some race";
info.desc = "race lvel";
info.laps = 7;
info.laptime = 10;
Instance of Symbol 574 MovieClip in Symbol 844 MovieClip [game] Frame 38
onClipEvent (load) {
_parent.registerBooster(this);
}
Instance of Symbol 675 MovieClip in Symbol 844 MovieClip [game] Frame 38
onClipEvent (load) {
_parent.registerObstacle(this);
_alpha = 0;
}
Instance of Symbol 501 MovieClip "raceMarker" in Symbol 844 MovieClip [game] Frame 38
/* no clip actions */
Symbol 844 MovieClip [game] Frame 39
info = new Object();
info.type = "kill";
Symbol 844 MovieClip [game] Frame 40
info = new Object();
info.type = "boss";
info.name = "Golf Buggy Boss";
info.desc = "Golf Buggy Boss";
Instance of Symbol 687 MovieClip in Symbol 844 MovieClip [game] Frame 40
onClipEvent (load) {
this.boss = true;
}
Symbol 844 MovieClip [game] Frame 41
info = new Object();
info.type = "kill";
Symbol 844 MovieClip [game] Frame 42
info = new Object();
info.type = "race";
info.name = "some race";
info.desc = "race lvel";
info.laps = 4;
info.laptime = 18;
Instance of Symbol 574 MovieClip in Symbol 844 MovieClip [game] Frame 42
onClipEvent (load) {
_parent.registerBooster(this);
}
Instance of Symbol 574 MovieClip in Symbol 844 MovieClip [game] Frame 42
onClipEvent (load) {
_parent.registerBooster(this);
}
Instance of Symbol 501 MovieClip "raceMarker" in Symbol 844 MovieClip [game] Frame 42
/* no clip actions */
Symbol 844 MovieClip [game] Frame 43
info = new Object();
info.type = "kill";
Instance of Symbol 710 MovieClip in Symbol 844 MovieClip [game] Frame 43
onClipEvent (load) {
_parent.registerObstacle(this);
_alpha = 0;
}
Symbol 844 MovieClip [game] Frame 44
info = new Object();
info.type = "kill";
Symbol 844 MovieClip [game] Frame 45
info = new Object();
info.type = "race";
info.name = "some race";
info.desc = "race lvel";
info.laptime = 10;
Instance of Symbol 717 MovieClip in Symbol 844 MovieClip [game] Frame 45
onClipEvent (load) {
_parent.registerObstacle(this);
_alpha = 0;
}
Instance of Symbol 501 MovieClip "raceMarker" in Symbol 844 MovieClip [game] Frame 45
/* no clip actions */
Symbol 844 MovieClip [game] Frame 46
info = new Object();
info.type = "kill";
Symbol 844 MovieClip [game] Frame 47
info = new Object();
info.type = "kill";
Symbol 844 MovieClip [game] Frame 48
info = new Object();
info.type = "kill";
Symbol 844 MovieClip [game] Frame 49
info = new Object();
info.type = "race";
info.name = "some race";
info.desc = "race lvel";
info.laps = 4;
info.laptime = 18;
Instance of Symbol 574 MovieClip in Symbol 844 MovieClip [game] Frame 49
onClipEvent (load) {
_parent.registerBooster(this);
}
Instance of Symbol 574 MovieClip in Symbol 844 MovieClip [game] Frame 49
onClipEvent (load) {
_parent.registerBooster(this);
}
Instance of Symbol 574 MovieClip in Symbol 844 MovieClip [game] Frame 49
onClipEvent (load) {
_parent.registerBooster(this);
}
Instance of Symbol 574 MovieClip in Symbol 844 MovieClip [game] Frame 49
onClipEvent (load) {
_parent.registerBooster(this);
}
Instance of Symbol 574 MovieClip in Symbol 844 MovieClip [game] Frame 49
onClipEvent (load) {
_parent.registerBooster(this);
}
Instance of Symbol 574 MovieClip in Symbol 844 MovieClip [game] Frame 49
onClipEvent (load) {
_parent.registerBooster(this);
}
Instance of Symbol 501 MovieClip "raceMarker" in Symbol 844 MovieClip [game] Frame 49
/* no clip actions */
Symbol 844 MovieClip [game] Frame 50
info = new Object();
info.type = "kill";
Instance of Symbol 739 MovieClip in Symbol 844 MovieClip [game] Frame 50
onClipEvent (load) {
_parent.registerObstacle(this);
_alpha = 0;
}
Symbol 844 MovieClip [game] Frame 51
info = new Object();
info.type = "kill";
Symbol 844 MovieClip [game] Frame 52
info = new Object();
info.type = "boss";
info.name = "Golf Buggy Boss";
info.desc = "Golf Buggy Boss";
Instance of Symbol 776 MovieClip in Symbol 844 MovieClip [game] Frame 52
onClipEvent (load) {
this.boss = true;
}
Instance of Symbol 800 MovieClip in Symbol 844 MovieClip [game] Frame 52
onClipEvent (load) {
this.boss = true;
}
Symbol 844 MovieClip [game] Frame 53
info = new Object();
info.type = "kill";
Symbol 844 MovieClip [game] Frame 54
info = new Object();
info.type = "kill";
Symbol 844 MovieClip [game] Frame 55
info = new Object();
info.type = "race";
info.name = "some race";
info.desc = "race lvel";
info.laps = 4;
info.laptime = 12;
Instance of Symbol 815 MovieClip in Symbol 844 MovieClip [game] Frame 55
onClipEvent (load) {
_parent.registerObstacle(this);
_alpha = 0;
}
Instance of Symbol 501 MovieClip "raceMarker" in Symbol 844 MovieClip [game] Frame 55
/* no clip actions */
Symbol 844 MovieClip [game] Frame 56
info = new Object();
info.type = "kill";
Symbol 844 MovieClip [game] Frame 57
info = new Object();
info.type = "kill";
Instance of Symbol 819 MovieClip in Symbol 844 MovieClip [game] Frame 57
onClipEvent (load) {
_parent.registerObstacle(this);
_alpha = 0;
}
Symbol 844 MovieClip [game] Frame 58
info = new Object();
info.type = "race";
info.name = "some race";
info.desc = "race lvel";
info.laps = 2;
info.laptime = 20;
Instance of Symbol 828 MovieClip in Symbol 844 MovieClip [game] Frame 58
onClipEvent (load) {
_parent.registerObstacle(this);
_alpha = 0;
}
Instance of Symbol 830 MovieClip in Symbol 844 MovieClip [game] Frame 58
onClipEvent (load) {
_parent.registerObstacle(this);
_alpha = 0;
}
Instance of Symbol 832 MovieClip in Symbol 844 MovieClip [game] Frame 58
onClipEvent (load) {
_parent.registerObstacle(this);
_alpha = 0;
}
Instance of Symbol 501 MovieClip "raceMarker" in Symbol 844 MovieClip [game] Frame 58
/* no clip actions */
Symbol 844 MovieClip [game] Frame 59
info = new Object();
info.type = "kill";
Symbol 844 MovieClip [game] Frame 60
info = new Object();
info.type = "boss";
info.name = "NG TANK";
info.desc = "NG TANK";
Instance of Symbol 843 MovieClip in Symbol 844 MovieClip [game] Frame 60
onClipEvent (load) {
this.boss = true;
}
Symbol 849 MovieClip [minigun_ammo] Frame 1
this.cacheAsBitmap = true;
Symbol 893 MovieClip Frame 1
stop();
Symbol 895 Button
on (release) {
getURL ("http://www.jazzastudios.com", "_blank");
}
Symbol 939 MovieClip Frame 1
_root.stop();
Symbol 939 MovieClip Frame 278
_root.play();
Symbol 945 MovieClip Frame 15
_root.sceneChange();
Symbol 945 MovieClip Frame 30
stop();
Symbol 989 Button
on (release) {
getURL ("http://www.newgrounds.com/refer/jazza", "_blank");
}
Symbol 991 Button
on (release) {
getURL ("http://www.jazzastudios.com", "_blank");
}
Symbol 994 MovieClip Frame 1
stop();
Instance of Symbol 953 MovieClip in Symbol 994 MovieClip Frame 1
on (release) {
_parent.gotoAndStop(2);
}
Instance of Symbol 955 MovieClip in Symbol 994 MovieClip Frame 1
on (release) {
getURL ("http://www.newgrounds.com/refer/jazza", "_blank");
}
Instance of Symbol 957 MovieClip in Symbol 994 MovieClip Frame 1
on (release) {
_parent.gotoAndStop(5);
}
Instance of Symbol 966 MovieClip in Symbol 994 MovieClip Frame 2
on (release) {
if (_root.so.data.maxlevel > 1) {
_parent.gotoAndStop(6);
} else {
_root.initNewGame();
_root.closeGarageDoors();
_root.sceneChange = function () {
_root.gotoAndStop("tutorial");
};
}
}
Instance of Symbol 975 MovieClip in Symbol 994 MovieClip Frame 2
onClipEvent (load) {
if (_root.so.data.maxlevel > 1) {
this.onRelease = function () {
_root.closeGarageDoors();
_root.resumeGame();
_root.sceneChange = function () {
_root.gotoAndStop("garage");
};
};
} else {
this._alpha = 50;
}
}
Instance of Symbol 978 MovieClip in Symbol 994 MovieClip Frame 2
on (release) {
_parent.gotoAndStop(1);
}
Instance of Symbol 978 MovieClip in Symbol 994 MovieClip Frame 3
on (release) {
_parent.gotoAndStop(1);
}
Instance of Symbol 978 MovieClip in Symbol 994 MovieClip Frame 4
on (release) {
_parent.gotoAndStop(1);
}
onClipEvent (enterFrame) {
if (_parent.cheat == "narwhal") {
_root.playSound("upgrade");
_parent.cheat = "";
_root.resumeGame();
_root.maxlevel = 50;
_root.saveGame();
}
if (_parent.cheat == "noobify") {
_root.playSound("upgrade");
_parent.cheat = "";
_root.resumeGame();
_root.maxlevel = 2;
_root.saveGame();
}
if (_parent.cheat == "millionaire") {
_root.playSound("upgrade");
_parent.cheat = "";
_root.resumeGame();
_root.kash = 1000000 /* 0x0F4240 */;
_root.saveGame();
}
}
Instance of Symbol 978 MovieClip in Symbol 994 MovieClip Frame 5
on (release) {
_parent.gotoAndStop(1);
}
Instance of Symbol 966 MovieClip in Symbol 994 MovieClip Frame 6
on (release) {
_root.initNewGame();
_root.closeGarageDoors();
_root.sceneChange = function () {
_root.gotoAndStop("tutorial");
};
}
Symbol 999 MovieClip Frame 1
stop();
Symbol 1031 Button
on (release) {
if (_root.spendKash(buy_cost)) {
_root.upgrades[upgradeName]++;
_parent.gotoAndPlay(1);
}
}
Symbol 1041 Button
on (release) {
_root.addKash(sell_cost);
_root.upgrades[upgradeName]--;
_parent.gotoAndPlay(1);
}
Symbol 1051 MovieClip Frame 1
upgradeName = "minigunL";
gotoAndStop(_root.upgrades[upgradeName]);
buy_cost = 100;
buy_txt = "$" + buy_cost;
Symbol 1051 MovieClip Frame 2
buy_cost = 1000;
buy_txt = "$" + buy_cost;
sell_cost = 100;
sell_txt = "$" + sell_cost;
Symbol 1051 MovieClip Frame 3
buy_cost = 5000;
buy_txt = "$" + buy_cost;
sell_cost = 900;
sell_txt = "$" + sell_cost;
Symbol 1051 MovieClip Frame 4
buy_cost = 10000;
buy_txt = "$" + buy_cost;
sell_cost = 4000;
sell_txt = "$" + sell_cost;
Symbol 1051 MovieClip Frame 5
sell_cost = 9000;
sell_txt = "$" + sell_cost;
Symbol 1052 MovieClip Frame 19
stop();
Symbol 1068 MovieClip Frame 1
upgradeName = "minigunR";
gotoAndStop(_root.upgrades[upgradeName]);
buy_cost = 100;
buy_txt = "$" + buy_cost;
Symbol 1068 MovieClip Frame 2
buy_cost = 1000;
buy_txt = "$" + buy_cost;
sell_cost = 100;
sell_txt = "$" + sell_cost;
Symbol 1068 MovieClip Frame 3
buy_cost = 5000;
buy_txt = "$" + buy_cost;
sell_cost = 900;
sell_txt = "$" + sell_cost;
Symbol 1068 MovieClip Frame 4
buy_cost = 10000;
buy_txt = "$" + buy_cost;
sell_cost = 4000;
sell_txt = "$" + sell_cost;
Symbol 1068 MovieClip Frame 5
sell_cost = 9000;
sell_txt = "$" + sell_cost;
Symbol 1069 MovieClip Frame 19
stop();
Symbol 1104 MovieClip Frame 1
upgradeName = "missile";
gotoAndStop(_root.upgrades[upgradeName]);
buy_cost = 100;
buy_txt = "$" + buy_cost;
Symbol 1104 MovieClip Frame 2
buy_cost = 1000;
buy_txt = "$" + buy_cost;
sell_cost = 100;
sell_txt = "$" + sell_cost;
Symbol 1104 MovieClip Frame 3
buy_cost = 5000;
buy_txt = "$" + buy_cost;
sell_cost = 900;
sell_txt = "$" + sell_cost;
Symbol 1104 MovieClip Frame 4
buy_cost = 10000;
buy_txt = "$" + buy_cost;
sell_cost = 4000;
sell_txt = "$" + sell_cost;
Symbol 1104 MovieClip Frame 5
buy_cost = 20000;
buy_txt = "$" + buy_cost;
sell_cost = 9000;
sell_txt = "$" + sell_cost;
Symbol 1104 MovieClip Frame 6
sell_cost = 18000;
sell_txt = "$" + sell_cost;
Symbol 1105 MovieClip Frame 20
stop();
Symbol 1120 Button
on (release) {
if (_root.spendKash(5000)) {
_root.upgrades[this.upgrade] = true;
_parent._parent.gotoAndPlay(1);
}
}
Symbol 1122 Button
on (release) {
_root.addKash(4000);
_root.upgrades[this.upgrade] = false;
_parent._parent.gotoAndPlay(1);
}
Symbol 1123 MovieClip Frame 1
if (_root.upgrades[this.upgrade]) {
gotoAndStop (2);
} else {
stop();
}
Symbol 1124 MovieClip Frame 1
gotoAndStop(_root.upgrades.grill);
Instance of Symbol 1123 MovieClip in Symbol 1124 MovieClip Frame 1
onClipEvent (load) {
upgrade = "grillGuard";
}
Instance of Symbol 1123 MovieClip in Symbol 1124 MovieClip Frame 1
onClipEvent (load) {
upgrade = "grillBlades";
}
Symbol 1125 MovieClip Frame 16
stop();
Symbol 1153 MovieClip Frame 1
upgradeName = "backguns";
gotoAndStop(_root.upgrades[upgradeName]);
buy_cost = 1000;
buy_txt = "$" + buy_cost;
Symbol 1153 MovieClip Frame 2
buy_cost = 1000;
buy_txt = "$" + buy_cost;
sell_cost = 100;
sell_txt = "$" + sell_cost;
Symbol 1153 MovieClip Frame 3
buy_cost = 5000;
buy_txt = "$" + buy_cost;
sell_cost = 900;
sell_txt = "$" + sell_cost;
Symbol 1153 MovieClip Frame 4
buy_cost = 10000;
buy_txt = "$" + buy_cost;
sell_cost = 4000;
sell_txt = "$" + sell_cost;
Symbol 1154 MovieClip Frame 17
stop();
Symbol 1168 MovieClip Frame 1
upgradeName = "backgunsR";
gotoAndStop(_root.upgrades[upgradeName]);
buy_cost = 1000;
buy_txt = "$" + buy_cost;
Symbol 1168 MovieClip Frame 2
buy_cost = 1000;
buy_txt = "$" + buy_cost;
sell_cost = 100;
sell_txt = "$" + sell_cost;
Symbol 1168 MovieClip Frame 3
buy_cost = 5000;
buy_txt = "$" + buy_cost;
sell_cost = 900;
sell_txt = "$" + sell_cost;
Symbol 1168 MovieClip Frame 4
buy_cost = 10000;
buy_txt = "$" + buy_cost;
sell_cost = 4000;
sell_txt = "$" + sell_cost;
Symbol 1169 MovieClip Frame 17
stop();
Symbol 1199 MovieClip Frame 1
upgradeName = "exhaust";
gotoAndStop(_root.upgrades[upgradeName]);
buy_cost = 100;
buy_txt = "$" + buy_cost;
Symbol 1199 MovieClip Frame 2
buy_cost = 1000;
buy_txt = "$" + buy_cost;
sell_cost = 100;
sell_txt = "$" + sell_cost;
Symbol 1199 MovieClip Frame 3
buy_cost = 5000;
buy_txt = "$" + buy_cost;
sell_cost = 900;
sell_txt = "$" + sell_cost;
Symbol 1199 MovieClip Frame 4
buy_cost = 10000;
buy_txt = "$" + buy_cost;
sell_cost = 4000;
sell_txt = "$" + sell_cost;
Symbol 1199 MovieClip Frame 5
buy_cost = 20000;
buy_txt = "$" + buy_cost;
sell_cost = 9000;
sell_txt = "$" + sell_cost;
Symbol 1199 MovieClip Frame 6
sell_cost = 18000;
sell_txt = "$" + sell_cost;
Symbol 1200 MovieClip Frame 16
stop();
Symbol 1209 Button
on (release) {
if (_root.upgrades.armour < 5) {
if (_root.spendKash(armour_cost)) {
_root.upgrades.armour++;
_parent.gotoAndPlay(1);
}
}
}
Symbol 1214 MovieClip Frame 1
armour_txt = _root.upgrades.armour + " / 5";
armour_cost = 5000 * _root.upgrades.armour;
armour_cost_txt = "$" + armour_cost;
if (_root.upgrades.armour == 5) {
armour_cost_txt = "";
}
stop();
Symbol 1215 MovieClip Frame 16
stop();
Instance of Symbol 1216 MovieClip in Symbol 1217 MovieClip Frame 1
onClipEvent (load) {
function closeOtherMCS() {
for (m in mclist) {
mc = mclist[m];
mc.onRelease = function () {
_root.playSound("whir");
closeOtherMCS();
this.play();
delete this.onRelease;
delete this.onRollOver;
delete this.onRollOut;
};
mc.onRollOver = function () {
this.gotoAndStop(2);
};
mc.onRollOut = function () {
this.gotoAndStop(1);
};
mc.gotoAndStop(1);
}
}
mclist = new Array();
for (obj in this) {
mc = this[obj];
mc.stop();
mclist.push(mc);
}
closeOtherMCS();
if (_root.upgrades.missile == 1) {
missi.onRelease();
} else {
hood.onRelease();
}
}
Instance of Symbol 1224 MovieClip "type_icon" in Symbol 1230 MovieClip Frame 1
onClipEvent (load) {
stop();
}
Instance of Symbol 1229 MovieClip "nextlevel" in Symbol 1230 MovieClip Frame 1
on (release) {
_root.level = _root.maxlevel;
_root.closeGarageDoors();
_root.sceneChange = function () {
_root.startLevel();
};
caurina.transitions.Tweener.addTween(_root.centerpanel, {_y:_root.centerpanel._y - 800, time:1, delay:0, transition:"easeOutQuad"});
caurina.transitions.Tweener.addTween(_root.leftpanel, {_x:_root.leftpanel._x - 300, time:1, delay:0, transition:"easeOutQuad"});
caurina.transitions.Tweener.addTween(_root.rightpanel, {_x:_root.rightpanel._x + 300, time:1, delay:0, transition:"easeOutQuad"});
}
Instance of Symbol 117 MovieClip "levelSelect" in Symbol 1230 MovieClip Frame 1
onClipEvent (load) {
_root.rightpanel.levelDisplay._visible = false;
_root.rightpanel.type_icon.defaultframe = ((_root.levelInfo[_root.maxlevel].type == "race") ? 2 : 1);
_root.rightpanel.type_icon.gotoAndStop(_root.rightpanel.type_icon.defaultframe);
game = this.attachMovie("game", "game", 1);
numLevels = game._totalframes;
game.removeMovieClip();
perCol = 10;
i = 1;
while (i <= numLevels) {
option = this.attachMovie("level_icon", "op" + i, i);
option._y = 35 * ((i - 1) % perCol);
option._x = 35 * Math.floor((i - 1) / perCol);
option.num = i;
option.levelname = "level " + i;
info = _root.levelInfo[i];
option.info = info;
if (i > _root.maxlevel) {
option.icon.stop();
} else {
if (info.type == undefined) {
info.type = "kill";
}
if (i == _root.maxlevel) {
option.icon.gotoAndStop(info.type);
} else {
option.icon.gotoAndStop("passed_" + info.type);
}
option.onRelease = function () {
switch (this.info.type) {
case "kill" :
_root.playSound("lvlstart_kill" + random(4));
break;
case "race" :
_root.playSound("lvlstart_race" + random(4));
break;
case "boss" :
_root.playSound("lvlstart_boss");
}
_root.level = this.num;
_root.closeGarageDoors();
_root.sceneChange = function () {
_root.startLevel();
};
caurina.transitions.Tweener.addTween(_root.centerpanel, {_y:_root.centerpanel._y - 800, time:1, delay:0, transition:"easeOutQuad"});
caurina.transitions.Tweener.addTween(_root.leftpanel, {_x:_root.leftpanel._x - 300, time:1, delay:0, transition:"easeOutQuad"});
caurina.transitions.Tweener.addTween(_root.rightpanel, {_x:_root.rightpanel._x + 300, time:1, delay:0, transition:"easeOutQuad"});
};
}
option.onRollOver = function () {
_root.rightpanel.levelDisplay._visible = true;
_root.rightpanel.nextlevel._visible = false;
_root.rightpanel.levelDisplay.level = "level " + this.num;
_root.rightpanel.levelDisplay.type = this.info.type + " level";
_root.rightpanel.type_icon.gotoAndStop(((this.info.type == "race") ? 2 : 1));
};
option.onRollOut = function () {
_root.rightpanel.levelDisplay._visible = false;
_root.rightpanel.nextlevel._visible = true;
_root.rightpanel.type_icon.gotoAndStop(_root.rightpanel.type_icon.defaultframe);
};
i++;
}
}
Symbol 1236 Button
on (release) {
_root.upgrades.carColour--;
if (_root.upgrades.carColour < 1) {
_root.upgrades.carColour = 1;
}
}
Symbol 1237 Button
on (release) {
_root.upgrades.tintColour--;
if (_root.upgrades.tintColour < 1) {
_root.upgrades.tintColour = 1;
}
}
Symbol 1238 Button
on (release) {
_root.upgrades.neonColour--;
if (_root.upgrades.neonColour < 1) {
_root.upgrades.neonColour = 1;
}
}
Symbol 1239 Button
on (release) {
_root.upgrades.extra--;
if (_root.upgrades.extra < 1) {
_root.upgrades.extra = 1;
}
}
Symbol 1240 Button
on (release) {
_root.upgrades.carColour++;
max = 22 + _root.extras.paint.length;
if (_root.upgrades.carColour > max) {
_root.upgrades.carColour = max;
}
}
Symbol 1241 Button
on (release) {
_root.upgrades.tintColour++;
max = 22 + _root.extras.tints.length;
if (_root.upgrades.tintColour > max) {
_root.upgrades.tintColour = max;
}
}
Symbol 1242 Button
on (release) {
_root.upgrades.neonColour++;
max = 1 + _root.extras.neons.length;
if (_root.upgrades.neonColour > max) {
_root.upgrades.neonColour = max;
}
}
Symbol 1243 Button
on (release) {
_root.upgrades.extra++;
max = 1 + _root.extras.extras.length;
if (_root.upgrades.neonColour > max) {
_root.upgrades.neonColour = max;
}
}
Symbol 1261 MovieClip Frame 1
stop();
Symbol 1261 MovieClip Frame 2
stop();
Instance of Symbol 1261 MovieClip in Symbol 1262 MovieClip Frame 1
onClipEvent (load) {
if (_root.upgrades.lights) {
nextFrame();
}
}
on (release) {
if (this._currentframe == 1) {
_root.upgrades.lights = true;
nextFrame();
} else {
_root.upgrades.lights = false;
prevFrame();
}
}
Symbol 1269 MovieClip Frame 1
function setHealth(num) {
inner._xscale = num;
}
Symbol 1281 MovieClip Frame 1
snd = new Sound(_root[audio]);
vol = snd.getVolume();
maxWidth = this._width;
trace((audio + " is ") + vol);
slider._x = this._width * (vol / 100);
slider.onPress = function () {
active = true;
};
slider.onRelease = (slider.onReleaseOutside = function () {
active = false;
});
slider.onEnterFrame = function () {
if (active) {
this._x = this._x + this._xmouse;
if (this._x < 0) {
this._x = 0;
}
if (this._x > maxWidth) {
this._x = maxWidth;
}
snd.setVolume((100 * this._x) / maxWidth);
}
};
Symbol 1301 Button
on (release) {
_root._quality = "MEDIUM";
qual.gotoAndStop(2);
}
Symbol 1302 Button
on (release) {
_root._quality = "LOW";
qual.gotoAndStop(3);
}
Symbol 1303 Button
on (release) {
_root._quality = "HIGH";
qual.gotoAndStop(1);
}
Symbol 1304 Button
on (release) {
_root.difficulty = 3;
diff.gotoAndStop(1);
}
Symbol 1305 Button
on (release) {
_root.difficulty = 2;
diff.gotoAndStop(2);
}
Symbol 1306 Button
on (release) {
_root.difficulty = 1;
diff.gotoAndStop(3);
}
Symbol 1307 Button
on (release) {
_root.difficulty = 0;
diff.gotoAndStop(4);
}
Symbol 1314 Button
on (release) {
getURL ("http://www.myspace.com/emersonhxc", "_blank");
}
Symbol 1317 MovieClip Frame 1
stop();
Instance of Symbol 1276 MovieClip in Symbol 1317 MovieClip Frame 1
on (release) {
}
onClipEvent (load) {
this.useHandCursor = false;
}
Instance of Symbol 1281 MovieClip in Symbol 1317 MovieClip Frame 1
onClipEvent (load) {
audio = "music";
}
Instance of Symbol 1281 MovieClip in Symbol 1317 MovieClip Frame 1
onClipEvent (load) {
audio = "sound";
}
Instance of Symbol 1287 MovieClip "diff" in Symbol 1317 MovieClip Frame 1
onClipEvent (load) {
gotoAndStop(4 - _root.difficulty);
}
Instance of Symbol 1289 MovieClip "qual" in Symbol 1317 MovieClip Frame 1
onClipEvent (load) {
trace(_root._quality);
switch (_root._quality) {
case "HIGH" :
gotoAndStop (1);
break;
case "MEDIUM" :
gotoAndStop (2);
break;
case "LOW" :
gotoAndStop (3);
}
}
Instance of Symbol 1293 MovieClip in Symbol 1317 MovieClip Frame 1
on (release) {
_parent.nextFrame();
}
Instance of Symbol 1296 MovieClip in Symbol 1317 MovieClip Frame 1
on (release) {
_root.saveGame();
_root.closeGarageDoors();
_root.sceneChange = function () {
_root.gotoAndStop("main_menu");
};
}
Instance of Symbol 1299 MovieClip in Symbol 1317 MovieClip Frame 1
on (release) {
_root.closeGarageDoors();
_root.sceneChange = function () {
_root.gotoAndStop("tutorial");
};
}
Instance of Symbol 1310 MovieClip in Symbol 1317 MovieClip Frame 1
on (release) {
_parent._visible = false;
}
Instance of Symbol 978 MovieClip in Symbol 1317 MovieClip Frame 2
on (release) {
_parent.gotoAndStop(1);
}
onClipEvent (enterFrame) {
if (_parent.cheat == "narwhal") {
_root.playSound("upgrade");
_parent.cheat = "";
_root.stats.cheater = true;
_root.maxlevel = 59;
}
if (_parent.cheat == "noobify") {
_root.playSound("upgrade");
_parent.cheat = "";
_root.stats.cheater = true;
_root.maxlevel = 2;
}
if (_parent.cheat == "ding") {
_root.playSound("upgrade");
_parent.cheat = "";
_root.stats.cheater = true;
_root.maxlevel++;
}
if (_parent.cheat == "millionaire") {
_root.playSound("upgrade");
_parent.cheat = "";
_root.stats.cheater = true;
_root.kash = 1000000 /* 0x0F4240 */;
}
if (_parent.cheat == "bloodyhell") {
_root.playSound("upgrade");
_parent.cheat = "";
_root.stats.cheater = true;
_root.bloodyhell = true;
}
if (_parent.cheat == "invincible") {
_root.playSound("upgrade");
_parent.cheat = "";
_root.stats.cheater = true;
_root.invincible = true;
}
if (_parent.cheat == "nos") {
_root.playSound("upgrade");
_parent.cheat = "";
_root.stats.cheater = true;
_root.nos = true;
}
}
Instance of Symbol 1322 MovieClip in Symbol 1332 MovieClip Frame 1
onClipEvent (enterFrame) {
if (_root.game.info.type == "race") {
gotoAndStop (2);
} else {
gotoAndStop (1);
}
}
Instance of Symbol 1224 MovieClip in Symbol 1332 MovieClip Frame 1
onClipEvent (enterFrame) {
if (_root.game.info.type == "race") {
gotoAndStop (2);
} else {
gotoAndStop (1);
}
}
Symbol 1332 MovieClip Frame 2
_root.playSound("countdown_3");
Symbol 1332 MovieClip Frame 25
_root.playSound("countdown_2");
Symbol 1332 MovieClip Frame 43
_root.playSound("countdown_1");
Symbol 1332 MovieClip Frame 61
_root.playSound("countdown_0");
_root.game.gamestate = "playing";
Symbol 1332 MovieClip Frame 90
stop();
Symbol 1379 MovieClip Frame 1
stop();
Symbol 1384 Button
on (release) {
if (_root.garage_door._currentframe == _root.garage_door._totalframes) {
_root.closeGarageDoors();
_root.sceneChange = function () {
_root.gotoGarage();
};
}
}
Symbol 1387 Button
on (release) {
nextFrame();
}
Symbol 1389 MovieClip Frame 1
stop();
Symbol 1394 Button
on (release) {
_root.closeGarageDoors();
_root.sceneChange = function () {
_root.gotoGarage();
};
}
Symbol 1426 MovieClip Frame 1
stop();
Instance of Symbol 1399 MovieClip in Symbol 1426 MovieClip Frame 1
on (release) {
_parent.nextFrame();
}
Instance of Symbol 1401 MovieClip in Symbol 1426 MovieClip Frame 1
on (release) {
_parent.prevFrame();
}
Instance of Symbol 1403 MovieClip in Symbol 1426 MovieClip Frame 1
on (release) {
_parent.gotoAndStop(_parent._totalframes);
}
Instance of Symbol 996 MovieClip in Symbol 1426 MovieClip Frame 1
onClipEvent (load) {
basexs = _xscale;
baseys = _yscale;
_yscale = 200;
_xscale = 200;
_alpha = 0;
caurina.transitions.Tweener.addTween(this, {_alpha:100, _yscale:baseys, _xscale:basexs, time:0.5, delay:1, transition:"easeInQuart"});
}
Instance of Symbol 1425 MovieClip in Symbol 1426 MovieClip Frame 8
on (release) {
_root.closeGarageDoors();
_root.sceneChange = function () {
if (_root.level < 2) {
_root.startLevel();
} else {
_root.gotoGarage();
}
};
}