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);
}
function onEnterFrame() {
if (on_frame == 1) {
bytes_loaded = Math.round(_root.getBytesLoaded());
bytes_total = Math.round(_root.getBytesTotal());
getPercent = bytes_loaded / bytes_total;
inder._xscale = getPercent * 100;
if (bytes_loaded == bytes_total) {
adBox.swapDepths(4);
adBox.removeMovieClip();
_root.gotoAndStop(2);
on_frame = 2;
}
}
}
function itemHandler1(obj, item) {
getURL ("http://armorgames.com");
}
stop();
_root.kongregateServices.connect();
__com_mochibot__("d76b2522", this, 10301, true);
_root.API_Settings = {movie_id:7475, enc_key:"wiL8FI1YPtUYXiQn3fh9IvjxYKDVu4pl", debug_mode:false, movie_version:""};
_quality = "MEDIUM";
on_frame = 1;
urlStart = _url.indexOf("://") + 3;
urlEnd = _url.indexOf("/", urlStart);
domain = _url.substring(urlStart, urlEnd);
LastDot = domain.lastIndexOf(".") - 1;
domEnd = domain.lastIndexOf(".", LastDot) + 1;
domain = domain.substring(domEnd, domain.length);
trace(domain);
if ((domain == "www.kongregate.com") || (domain == "kongregate.com")) {
adBox._x = 1000;
} else {
var CPMStarContentSpotID = "0";
System.security.allowDomain("server.cpmstar.com");
adBox.loadMovie("http://server.cpmstar.com/adviewas2.swf?contentspotid=603QED1EED66");
}
mochi.MochiServices.connect("89db28dbf8b4a93c");
var myMenu = new ContextMenu();
myMenu.hideBuiltInItems();
item1 = new ContextMenuItem("Play More Games", itemHandler1);
myMenu.customItems.push(item1);
_root.menu = myMenu;
Frame 2
stop();
Frame 3
function countBadges() {
i = 0;
while (i < awardsRecieved.length) {
if (awardsRecieved[i] == 1) {
counter = counter + 1;
}
i++;
}
awardsTotal = counter;
}
function onEnterFrame() {
var _local2 = _xmouse - aim._x;
var _local1 = _ymouse - aim._y;
aim._x = aim._x + (_local2 / 2);
aim._y = aim._y + (_local1 / 2);
}
function createHover(movie, movie2) {
movie.onRollOver = function () {
movie2.gotoAndStop(2);
};
movie.onRollOut = function () {
movie2.gotoAndStop(1);
};
movie.onReleaseOutside = function () {
movie2.gotoAndStop(1);
};
}
function badgeCounter(array1) {
var _local4 = array1.length;
var _local2 = 0;
var _local3 = 0;
b = array1.length;
while (b >= 0) {
if (awardsRecieved[array1[b]] == 1) {
_local2 = _local2 + 1;
}
b--;
}
_local3 = (_local2 / _local4) * 100;
if (_local3 >= 25) {
badges = badges + 1;
}
if (_local3 >= 50) {
badges = badges + 1;
}
if (_local3 >= 75) {
badges = badges + 1;
}
if (_local3 >= 100) {
badges = badges + 1;
}
}
awards = new Array("Kill 100 Enemies", "Kill 300 Enemies", "Kill 1000 Enemies", "Kill 3000 Enemies", "Complete Campaign", "Play for 5 Minutes", "Play for 15 Minutes", "Play for 30 Minutes", "Play for 60 Minutes", "Play for 120 Minutes", "Kill 20 Enemies in Survival", "Kill 50 Enemies in Survival", "Kill 100 Enemies in Survival", "Kill 200 Enemies in Survival", "Kill 300 Enemies in Survival", "Buy Light Arrows", "Buy Heavy Arrows", "Buy Ice Arrows", "Buy Fire Arrows", "Buy Electric Arrows", "Buy a Long Bow", "Buy a Composite Bow", "Buy a Cross Bow", "Buy a Compound Bow", "Score 100 in a game", "Score 500 in a game", "Score 1000 in a game", "Score 2000 in a game", "Score 5000 in a game", "Score 10000 in a game", "Fully Upgraded Skill", "Fully Upgraded Armor", "Fully Upgraded Health", "Fully Upgraded Speed", "Fully Enchanted Short Bow", "Fully Enchanted Long Bow", "Fully Enchanted Composite Bow", "Fully Enchanted Cross Bow", "Fully Enchanted Compound Bow", "S - All bows collected", "Unlocked Cheat 1", "Unlocked Cheat 2", "Unlocked Cheat 3", "Unlocked Cheat 4", "Unlocked Cheat 5", "Unlocked Cheat 6", "Unlocked Cheat 7", "Unlocked Cheat 8", "Unlocked Cheat 9", "Play Again", "Short Bow Drop", "Long Bow Drop", "Composite Bow Drop", "Cross Bow Drop", "Compound Bow Drop", "Defeated Vandoru", "Defeated Korthag", "Defeated Shocknor", "Defeated Azgorg", "Defeated Kagoru", "Kill a Kordul", "Kill a Sathir", "Kill a Ortug", "Kill a Atugor", "Kill a Dronder", "Kill a Tungurd", "Kill a Cazgur", "Kill a Uroth", "Kill a Fazgor", "Kill a Farodun", "Broken Bow", "Dead End", "Frozen", "Suicide", "Collect Light Arrows", "Refil", "Bought 1000 Arrows", "Sell Initial Weapon", "All Money Collected", "Die", "Spend 101 Gold", "Spend 500 Gold", "Spend 1000 Gold", "Spend 2000 Gold", "Spend 5000 Gold", "Spend 10000 Gold", "Collect Heavy Arrows", "Collect Ice Arrows", "Collect Fire Arrows", "Collect Electric Arrows", "Game Complete, No Bows", "Game Complete with level 2 armor", "Score 5,000 in Survival", "Wave 1 Complete, Untouched", "Wave Complete, 100% Accuracy", "Game Complete with level 3 armor", "Game Complete with level 4 armor", "Game Complete with level 5 armor", "Game Complete with level 6 armor", "All Achievments Complete!");
stop();
on_frame = 2;
Mouse.hide();
moneyC = 0;
sObject = SharedObject.getLocal("objectName");
seconds = 0;
minutes = 0;
hours = 0;
camp.skipbtn.onPress = function () {
if (camp.skipbtn._alpha >= 50) {
gotoAndStop (4);
}
};
kills = 0;
deaths = 0;
if (sObject.data.kill > 0) {
kills = sObject.data.kill;
}
if (sObject.data.death > 0) {
deaths = sObject.data.death;
}
if (sObject.data.minute > 0) {
minutes = sObject.data.minute;
}
if (sObject.data.hour > 0) {
hours = sObject.data.hour;
}
personalHighScore = 0;
if (sObject.data.phs > 0) {
personalHighScore = sObject.data.phs;
}
armorEquip = 1;
if (sObject.data.ae > 1) {
armorEquip = sObject.data.ae;
}
awardsRecieved = new Array(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
i = 0;
while (i <= 100) {
if (sObject.data.completed_levels[i] == 1) {
awardsRecieved[i] = 1;
}
i++;
}
attachMovie("aim", "aim", 1001800);
counter = 0;
awardsTotal = 0;
countBadges();
if (awardsRecieved[5] == 1) {
_root.kongregateStats.submit("GameComplete", 1);
}
_root.kongregateStats.submit("Awards", awardsTotal);
pmg.onPress = function () {
getURL ("http://www.armorgames.com/", "_blank");
};
if (firster == undefined) {
firster = 0;
oldBadges = awardsTotal;
}
if (oldBadges == undefined) {
oldBadges = 0;
}
mg.onPress = function () {
getURL ("http://www.armorgames.com/", "_blank");
};
mg3.onPress = function () {
getURL ("http://www.armorgames.com/", "_blank");
};
bes.onPress = function () {
gotoAndStop (8);
};
lSize = 0;
startbtn.onRelease = function () {
if (opts._x <= 0) {
enemiesLeft = 500;
lSize = 1;
camp.play();
}
};
hs.onRelease = function () {
Mouse.show();
mochi.MochiScores.showLeaderboard({boardID:"89db28dbf8b4a93c", onClose:function () {
gotoAndStop (3);
Mouse.hide();
}});
};
sur.onRelease = function () {
lSize = 0;
enemiesLeft = 100000 /* 0x0186A0 */;
gotoAndStop (4);
};
ins.onRelease = function () {
gotoAndStop (6);
};
awa.onRelease = function () {
gotoAndStop (7);
};
if (insaneMode) {
options.ll1._x = options.ll1._x - 118;
}
cre.onPress = function () {
gotoAndStop (9);
};
opt.onPress = function () {
opts._x = Stage.width / 2;
};
music_frame = 2;
opts.xd.onPress = function () {
opts._x = -1000;
};
opts.li._alpha = 50;
opts.mi._alpha = 50;
opts.hi._alpha = 50;
opts.oi._alpha = 50;
opts.oni._alpha = 50;
opts.li.onPress = function () {
_quality = "LOW";
opts.mi._alpha = 50;
opts.hi._alpha = 50;
opts.li._alpha = 100;
};
opts.mi.onPress = function () {
opts.li._alpha = 50;
opts.mi._alpha = 100;
opts.hi._alpha = 50;
_quality = "MEDIUM";
};
opts.hi.onPress = function () {
opts.li._alpha = 50;
opts.mi._alpha = 50;
opts.hi._alpha = 100;
_quality = "HIGH";
};
opts.oi.onPress = function () {
opts.oi._alpha = 100;
opts.oni._alpha = 50;
music_frame = 1;
};
opts.oni.onPress = function () {
opts.oi._alpha = 50;
opts.oni._alpha = 100;
music_frame = 2;
};
a = 0;
createHover(startbtn, cam2);
createHover(opt, opt2);
createHover(sur, sur2);
createHover(awa, awa2);
createHover(bes, bes2);
createHover(pmg, pmg2);
createHover(ins, ins2);
createHover(hs, hs2);
createHover(cre, cre2);
groupArray1 = new Array(49, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69);
groupArray2 = new Array(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11);
groupArray3 = new Array(0, 36, 37, 38, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59);
groupArray4 = new Array(70, 71, 72, 73, 74, 75, 76, 77);
groupArray5 = new Array(21, 22, 23, 24, 25, 26, 27, 28, 29, 30);
groupArray6 = new Array(31, 32, 33, 34, 35, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48);
groupArray7 = new Array(12, 13, 14, 15, 16, 17, 18, 19, 20);
badges = 0;
badgeCounter(groupArray1);
badgeCounter(groupArray2);
badgeCounter(groupArray3);
badgeCounter(groupArray4);
badgeCounter(groupArray5);
badgeCounter(groupArray6);
badgeCounter(groupArray7);
if (badges > oldBadges) {
awa.newBadge._alpha = 100;
} else {
awa.newBadge._alpha = 0;
}
badges = 0;
Frame 4
function upTime() {
seconds = seconds + 1;
secondsThisGame = secondsThisGame + 1;
mDownSeconds = mDownSeconds + 1;
if ((mouseIsDown == 1) || (gamepause)) {
mDownSeconds = 0;
}
if (mDownSeconds == 20) {
giveAward(73);
}
if ((stale == 0) && (!gamepause)) {
staleSeconds = staleSeconds + 1;
if (staleSeconds == 10) {
giveAward(71);
}
} else {
staleSeconds = 0;
}
sObject.data.second = seconds;
sObject.flush();
if (seconds >= 60) {
minutes = minutes + 1;
sObject.data.minute = minutes;
sObject.flush();
seconds = 0;
if (minutes >= 5) {
giveAward(6);
}
if (minutes >= 15) {
giveAward(7);
}
if (minutes >= 30) {
giveAward(8);
}
if (minutes >= 60) {
hours = hours + 1;
sObject.data.hour = hours;
sObject.flush();
giveAward(9);
minutes = 0;
if (hours >= 2) {
giveAward(10);
}
}
}
}
function changeArmor(frame) {
armorEquip = frame;
sObject.data.ae = armorEquip;
sObject.flush();
ball1.o.q.gotoAndStop(frame);
ball1.o.w.gotoAndStop(frame);
ball1.o.e.gotoAndStop(frame);
ball1.o.r.gotoAndStop(frame);
ball1.hat.gotoAndStop(frame);
ball1.w.w.gotoAndStop(frame);
ball1.q.f.gotoAndStop(frame);
ball1.q.d.gotoAndStop(frame);
}
function giveAward(awardnum) {
if ((award._currentframe == 1) && (achievementAllowed)) {
if (awardsRecieved[awardnum - 1] != 1) {
awardsTotal = awardsTotal + 1;
_root.kongregateStats.submit("Awards", awardsTotal);
award.aname.awardName = awards[awardnum - 1];
awardsRecieved[awardnum - 1] = 1;
if (awardnum == 56) {
_root.medal_popup.unlockMedal("First Boss");
}
if (awardnum == 57) {
_root.medal_popup.unlockMedal("Second Boss");
}
if (awardnum == 58) {
_root.medal_popup.unlockMedal("Third Boss");
}
if (awardnum == 59) {
_root.medal_popup.unlockMedal("Fourth Boss");
}
if (awardnum == 60) {
_root.medal_popup.unlockMedal("Fifth Boss");
}
if (awardnum == 61) {
_root.medal_popup.unlockMedal("First Kill");
}
if (awardnum == 67) {
_root.medal_popup.unlockMedal("Tenth Kill");
}
if (awardsTotal == 75) {
_root.medal_popup.unlockMedal("75 Achievements");
}
if (awardsTotal == 100) {
_root.medal_popup.unlockMedal("100 Achievements");
}
award.gotoAndPlay(2);
sObject.data.completed_levels = awardsRecieved;
sObject.flush();
if (awardsTotal >= 10) {
giveAward(41);
}
if (awardsTotal >= 20) {
giveAward(42);
}
if (awardsTotal >= 30) {
giveAward(43);
}
if (awardsTotal >= 40) {
giveAward(44);
}
if (awardsTotal >= 50) {
giveAward(45);
}
if (awardsTotal >= 60) {
giveAward(46);
}
if (awardsTotal >= 70) {
giveAward(47);
}
if (awardsTotal >= 80) {
giveAward(48);
}
if (awardsTotal >= 90) {
giveAward(49);
}
if (awardsTotal >= 99) {
giveAward(100);
}
}
} else if (achievementAllowed) {
awardqueue.push(awardnum);
}
}
function awardWait() {
if (award._currentframe == 1) {
if (awardqueue.length != 0) {
giveAward(awardqueue[0]);
awardqueue.splice(0, 1);
}
}
}
function bowInvis() {
makebigger.b1._alpha = 0;
makebigger.b2._alpha = 0;
makebigger.b3._alpha = 0;
makebigger.b4._alpha = 0;
makebigger.b5._alpha = 0;
}
function arrowInvis() {
makebigger.a1._alpha = 0;
makebigger.a2._alpha = 0;
makebigger.a3._alpha = 0;
makebigger.a4._alpha = 0;
makebigger.a5._alpha = 0;
makebigger.a6._alpha = 0;
}
function bestBow() {
if (ownBow1 > 0) {
ball1.o.bow.gotoAndStop(1);
quiver = 1;
shotCount = 1;
bowInvis();
makebigger.b1._alpha = 10;
}
if (ownBow2 > 0) {
ball1.o.bow.gotoAndStop(2);
quiver = 2;
shotCount = 1;
bowInvis();
makebigger.b2._alpha = 10;
}
if (ownBow3 > 0) {
ball1.o.bow.gotoAndStop(3);
quiver = 3;
shotCount = 2;
bowInvis();
makebigger.b3._alpha = 10;
}
if (ownBow4 > 0) {
ball1.o.bow.gotoAndStop(4);
quiver = 4;
shotCount = 2;
bowInvis();
makebigger.b4._alpha = 10;
}
if (ownBow5 > 0) {
ball1.o.bow.gotoAndStop(5);
quiver = 5;
shotCount = 3;
bowInvis();
makebigger.b5._alpha = 10;
}
if (gunAmmo1 > 0) {
arrowInvis();
makebigger.a1._alpha = 10;
arrowUsed = 1;
}
if (gunAmmo2 > 0) {
arrowInvis();
makebigger.a2._alpha = 10;
arrowUsed = 2;
}
if (gunAmmo3 > 0) {
arrowInvis();
makebigger.a3._alpha = 10;
arrowUsed = 3;
}
if (gunAmmo4 > 0) {
arrowInvis();
makebigger.a5._alpha = 10;
arrowUsed = 4;
}
if (gunAmmo5 > 0) {
arrowInvis();
makebigger.a4._alpha = 10;
arrowUsed = 5;
}
if (gunAmmo6 > 0) {
arrowInvis();
makebigger.a6._alpha = 10;
arrowUsed = 6;
}
}
function enemyFunc() {
var _local1 = randRange(enemyAmount - 2, enemyAmount);
if (_local1 == 1) {
createEnemy1();
}
if (_local1 == 2) {
createEnemy2();
}
if (_local1 == 3) {
createEnemy3();
}
if (_local1 == 4) {
createEnemy4();
}
if (_local1 == 5) {
createEnemy5();
}
if (_local1 == 6) {
createEnemy6();
}
if (_local1 == 7) {
createEnemy7();
}
if (_local1 == 8) {
createEnemy8();
}
if (_local1 == 9) {
createEnemy9();
}
if (_local1 == 10) {
createEnemy10();
}
enemiesOnStage = enemiesOnStage + 1;
trueOnStage = trueOnStage + 1;
enemyType.push(_local1);
var _local2 = randRange(1, 2);
en._y = randRange(0, Stage.height);
if (_local2 == 1) {
en._x = (-en._width) / 2;
}
if (_local2 == 2) {
en._x = Stage.width + (en._width / 2);
en._rotation = 180;
}
enemyX.push(0);
enemyY.push(0);
enemies.push(en);
}
function skipIt(type) {
enemyType.push(type);
en._alpha = 0;
en.onEnterFrame = function () {
if (this._alpha <= 100) {
this._alpha = this._alpha + 3;
}
};
en._y = randRange(enemies[i]._y - 100, enemies[i]._y + 100);
en._x = randRange(enemies[i]._x - 100, enemies[i]._x + 100);
while (en.hitTest(ball1)) {
en._y = randRange(en._y - 100, en._y + 100);
en._x = randRange(en._x - 100, en._x + 100);
}
enemyX.push(0);
enemyY.push(0);
var _local3 = ball1._x - en._x;
var _local2 = ball1._y - en._y;
var _local4 = Math.atan2(_local2, _local3);
en._rotation = (_local4 * 180) / Math.PI;
enemies.push(en);
}
function MouseDownCounter() {
mouseDownTime = mouseDownTime - 1;
if ((mouseDownTime <= 0) && (mouseIsDown == 1)) {
if (((((ownBow1 >= 1) || (ownBow2 >= 1)) || (ownBow3 >= 1)) || (ownBow4 >= 1)) || (ownBow5 >= 1)) {
if (music_frame == 1) {
ashot.start();
}
if (shotCount == 1) {
shotHow(0);
}
if (shotCount == 2) {
shotHow(5);
shotHow(-5);
}
if (shotCount == 3) {
shotHow(10);
shotHow(1);
shotHow(-10);
}
makebigger.q1 = "x" + gunAmmo1;
makebigger.q2 = "x" + gunAmmo2;
makebigger.q3 = "x" + gunAmmo3;
makebigger.q4 = "x" + gunAmmo5;
makebigger.q5 = "x" + gunAmmo4;
makebigger.q6 = "x" + gunAmmo6;
}
}
}
function shotHow(angle) {
ball1.o.gotoAndPlay(2);
if (arrowUsed == 6) {
arrowPicked = "spike6";
ammo = gunAmmo6;
if (gunAmmo6 <= 0) {
arrowUsed = 5;
ammo = gunAmmo5;
arrowInvis();
makebigger.a4._alpha = 10;
}
}
if (arrowUsed == 5) {
arrowPicked = "spike3";
ammo = gunAmmo5;
if (gunAmmo5 <= 0) {
arrowUsed = 4;
ammo = gunAmmo3;
arrowInvis();
makebigger.a5._alpha = 10;
}
}
if (arrowUsed == 4) {
arrowPicked = "spike";
ammo = gunAmmo4;
if (gunAmmo4 <= 0) {
arrowUsed = 3;
ammo = gunAmmo4;
arrowInvis();
makebigger.a3._alpha = 10;
}
}
if (arrowUsed == 3) {
arrowPicked = "spike5";
ammo = gunAmmo3;
if (gunAmmo3 <= 0) {
arrowUsed = 2;
ammo = gunAmmo2;
arrowInvis();
makebigger.a2._alpha = 10;
}
}
if (arrowUsed == 2) {
arrowPicked = "spike4";
ammo = gunAmmo2;
if (gunAmmo2 <= 0) {
arrowUsed = 1;
ammo = gunAmmo1;
arrowInvis();
makebigger.a1._alpha = 10;
}
}
if (arrowUsed == 1) {
arrowPicked = "spike2";
ammo = 999999999 /* 0x3B9AC9FF */;
}
if (gaOn == 1) {
arrowUsed = 6;
arrowPicked = "spike7";
}
mouseDownTime = delayTime - (speeded[quiver - 1] * 2);
if (angle == 0) {
if (ammo > 0) {
ammo = ammo - 1;
sp = attachMovie(arrowPicked, "spike" + depth, depth);
}
}
if ((angle == 5) || (angle == -5)) {
if (ammo > 0) {
ammo = ammo - 1;
sp = attachMovie(arrowPicked, "spike" + depth, depth);
}
}
if (((angle == 10) || (angle == -10)) || (angle == 1)) {
if (ammo > 0) {
ammo = ammo - 1;
sp = attachMovie(arrowPicked, "spike" + depth, depth);
if (angle == 1) {
angle = 0;
}
}
}
textHolder.arrowstxt = ammo;
depth++;
sp._x = ball1._x;
sp._y = ball1._y;
sp._rotation = topRotation;
sp._rotation = sp._rotation + angle;
var _local3 = Math.cos((sp._rotation * Math.PI) / 180) * 20;
var _local2 = Math.sin((sp._rotation * Math.PI) / 180) * 20;
bullets.push(sp);
bulletX.push(_local3);
bulletY.push(_local2);
if (arrowUsed == 1) {
gunAmmo1 = ammo;
}
if (arrowUsed == 2) {
gunAmmo2 = ammo;
}
if (arrowUsed == 3) {
gunAmmo3 = ammo;
}
if (arrowUsed == 4) {
gunAmmo4 = ammo;
}
if (arrowUsed == 5) {
gunAmmo5 = ammo;
}
if (arrowUsed == 6) {
gunAmmo6 = ammo;
}
}
function enbulMovement() {
i = enBullets.length - 1;
while (i >= 0) {
enBullets[i]._x = enBullets[i]._x + enbx[i];
enBullets[i]._y = enBullets[i]._y + enby[i];
enBullets[i]._x = enBullets[i]._x - initialX;
enBullets[i]._y = enBullets[i]._y - initialY;
if (enBullets[i].hitTest(ball1.abox) && (timer2 <= 0)) {
lives = lives - (1 - (0.1 * armorq));
if (inver) {
lives = lives + (1 - (0.1 * armorq));
}
if (music_frame == 1) {
stab.start();
}
timer2 = 60;
textHolder.hFill._xscale = lives * (100 / (healthq + 10));
untouched = false;
if (lives <= 0) {
if (lSize == 0) {
realGO = 1;
}
gameover = 1;
gamepause = 1;
deaths = deaths + 1;
sObject.data.death = deaths;
sObject.flush();
}
textHolder.livestxt = lives;
attachMovie("redFlash", "redFlash", 1000824);
removeEnBul();
}
if ((((enBullets[i]._x >= Stage.width) || (enBullets[i]._x <= 0)) || (enBullets[i]._y >= Stage.height)) || (enBullets[i]._y <= 0)) {
removeEnBul();
}
i--;
}
}
function removeEnBul() {
enBullets[i].removeMovieClip();
enBullets.splice(i, 1);
enbx.splice(i, 1);
enby.splice(i, 1);
}
function bulletMovement() {
shaker();
i = bullets.length - 1;
while (i >= 0) {
bullets[i]._x = bullets[i]._x + bulletX[i];
bullets[i]._y = bullets[i]._y + bulletY[i];
if ((((bullets[i]._x > 640) || (bullets[i]._x < 0)) || (bullets[i]._y > 480)) || (bullets[i]._y < 0)) {
removeBullet();
bulletMissed = 1;
}
b = enemies.length - 1;
while (b >= 0) {
if (bullets[i].hitTest(enemies[b].inner)) {
if (music_frame == 1) {
gothit.start();
}
shake = 1;
particleEffect3(b, i);
if (gaOn == 1) {
aIn = enemies[b].temper.attachMovie("spike7", "spiked" + depth2, depth2);
} else {
if (arrowUsed == 1) {
aIn = enemies[b].temper.attachMovie("spike2", "spiked" + depth2, depth2);
}
if (arrowUsed == 2) {
aIn = enemies[b].temper.attachMovie("spike4", "spiked" + depth2, depth2);
}
if (arrowUsed == 3) {
aIn = enemies[b].temper.attachMovie("spike5", "spiked" + depth2, depth2);
}
if (arrowUsed == 4) {
aIn = enemies[b].temper.attachMovie("spike", "spiked" + depth2, depth2);
}
if (arrowUsed == 5) {
aIn = enemies[b].temper.attachMovie("spike3", "spiked" + depth2, depth2);
}
if (arrowUsed == 6) {
aIn = enemies[b].temper.attachMovie("spike6", "spiked" + depth2, depth2);
}
}
depth2++;
aIn._rotation = bullets[i]._rotation - enemies[b]._rotation;
var _local8 = enemies[b]._x - bullets[i]._x;
var _local7 = enemies[b]._y - bullets[i]._y;
var _local2 = Math.atan2(_local7, _local8);
var _local5 = bullets[i]._x - (Math.cos(_local2) * 39);
var _local6 = bullets[i]._y - (Math.sin(_local2) * 39);
var _local10 = bullets[i]._x - (Math.cos((bullets[i]._rotation * Math.PI) / 180) * 39);
var _local9 = bullets[i]._y - (Math.sin((bullets[i]._rotation * Math.PI) / 180) * 39);
var _local11 = _local10 - _local5;
var _local1 = _local9 - _local6;
enemies[b].inside.swapDepths(100000);
xMove = Math.cos((aIn._rotation * Math.PI) / 180);
yMove = Math.sin((aIn._rotation * Math.PI) / 180);
aIn._x = aIn._x - (xMove * 39);
aIn._y = aIn._y - (yMove * 39);
aIn._rotation = aIn._rotation + enemies[b]._rotation;
if (_local1 >= 15) {
_local1 = 15;
}
if (_local1 <= -15) {
_local1 = -15;
}
aIn._y = aIn._y + (_local1 * (-Math.cos((enemies[b]._rotation * Math.PI) / 180)));
aIn._rotation = aIn._rotation - enemies[b]._rotation;
if (gaOn == 0) {
removeBullet();
}
enemies[b]._x = enemies[b]._x + (Math.cos(_local2) * 15);
enemies[b]._y = enemies[b]._y + (Math.sin(_local2) * 15);
qHit = quiver;
if (qHit >= 3) {
qHit = qHit - 1;
if (qHit >= 4) {
qHit = qHit - 1;
}
}
var _local4 = 0;
var _local3 = 0;
if (arrowUsed == 5) {
arrowUsed = 4;
} else if (arrowUsed == 4) {
arrowUsed = 5;
}
_local4 = ((qHit - 1) / 3) + 1;
_local3 = ((arrowUsed - 1) / 3) + 1;
enemyHealth[b] = enemyHealth[b] - ((_local4 * _local3) + (skillq / 4));
if ((armorEquip == 4) || (armorEquip == 6)) {
enemyHealth[b] = enemyHealth[b] - 1;
}
if (arrowUsed == 5) {
arrowUsed = 4;
} else if (arrowUsed == 4) {
arrowUsed = 5;
}
if ((enemyType[b] >= 11) && (enemyHealth[b] <= 0)) {
bhealth.removeMovieClip();
}
if (enemyHealth[b] <= 0) {
enemyKillCount = enemyKillCount + 1;
if ((enemyKillCount >= 0) && (lSize == 0)) {
if (lSize == 0) {
chance = chance * 0.999;
if (enemyKillCount >= 20) {
enemyAmount = 4;
}
if (enemyKillCount >= 50) {
enemyAmount = 5;
}
if (enemyKillCount >= 80) {
enemyAmount = 6;
}
if (enemyKillCount >= 120) {
enemyAmount = 7;
}
if (enemyKillCount >= 170) {
enemyAmount = 8;
}
if (enemyKillCount >= 230) {
enemyAmount = 9;
}
if (enemyKillCount >= 300) {
enemyAmount = 10;
}
if (enemyKillCount >= 20) {
giveAward(11);
}
if (enemyKillCount >= 50) {
giveAward(12);
}
if (enemyKillCount >= 100) {
giveAward(13);
}
if (enemyKillCount >= 200) {
giveAward(14);
}
if (enemyKillCount >= 300) {
giveAward(15);
}
}
}
if (shake == 0) {
shake = 1;
}
if ((level % 5) != 0) {
percent = percent + 2.5;
if ((level >= 20) && (enemyType[b] == 4)) {
percent = percent - 2.5;
}
if ((level >= 7) && (enemyType[b] == 2)) {
percent = percent - 2.5;
}
}
if (enemyType[b] >= 11) {
percent = percent + 100;
}
kills = kills + 1;
textHolder.killstxt = enemyKillCount;
enemiesLeft = enemiesLeft - 1;
textHolder.enemiestxt = enemiesLeft;
if (kills >= 3000) {
giveAward(4);
} else if (kills >= 1000) {
giveAward(3);
} else if (kills >= 300) {
giveAward(2);
} else if (kills >= 100) {
giveAward(1);
}
removeEnemy(b);
textHolder.scoretxt = score;
if (score >= 10000) {
giveAward(30);
} else if (score >= 5000) {
giveAward(29);
} else if (score >= 2000) {
giveAward(28);
} else if (score >= 1000) {
giveAward(27);
} else if (score >= 500) {
giveAward(26);
} else if (score >= 100) {
giveAward(25);
}
}
}
b--;
}
i--;
}
}
function removeBullet() {
bullets[i].removeMovieClip();
bulletX.splice(i, 1);
bulletY.splice(i, 1);
bullets.splice(i, 1);
}
function enemyMovement() {
i = enemies.length - 1;
while (i >= 0) {
if (enemyType[i] >= 11) {
if (enemyType[i] == 11) {
bhealth.bfill._xscale = 100 * (enemyHealth[i] / 300);
}
if (enemyType[i] == 12) {
bhealth.bfill._xscale = 100 * (enemyHealth[i] / 800);
}
if (enemyType[i] == 13) {
bhealth.bfill._xscale = 100 * (enemyHealth[i] / 1300);
}
if (enemyType[i] == 14) {
bhealth.bfill._xscale = 100 * (enemyHealth[i] / 3000);
}
if (enemyType[i] == 15) {
bhealth.bfill._xscale = 100 * (enemyHealth[i] / 5000);
}
}
var _local1 = enemies[i]._rotation;
var _local3 = 0;
var _local10 = ball1._x - enemies[i]._x;
var _local9 = ball1._y - enemies[i]._y;
var _local11 = Math.atan2(_local9, _local10);
_local3 = (_local11 * 180) / Math.PI;
var _local2 = (_local1 - _local3) % 360;
if (_local2 > 180) {
_local2 = _local2 - 360;
} else if (_local2 < -180) {
_local2 = _local2 + 360;
}
if (Math.abs(_local2) < 3) {
_local1 = _local3;
} else if (_local2 < 0) {
_local1 = _local1 + 2;
if ((enemyType[i] >= 11) || (enemyType[i] == 6)) {
_local1 = _local1 + 2;
}
} else {
_local1 = _local1 - 2;
if ((enemyType[i] >= 11) || (enemyType[i] == 6)) {
_local1 = _local1 - 2;
}
}
enemies[i]._rotation = _local1;
enemyX[i] = Math.cos((_local1 * Math.PI) / 180) * 1.5;
enemyY[i] = Math.sin((_local1 * Math.PI) / 180) * 1.5;
if ((((enemyType[i] == 5) || (enemyType[i] == 9)) || (enemyType[i] == 12)) || (enemyType[i] == 13)) {
var _local8 = randRange(1, 210);
if (_local8 == 1) {
enemies[i]._alpha = enemies[i]._alpha - 10;
}
if ((enemies[i]._alpha <= 97) && (spikes[i] != 1000)) {
enemies[i]._alpha = enemies[i]._alpha - 3;
if (enemies[i]._alpha <= 0) {
spikes[i] = 1000;
enemies[i]._x = randRange(0, Stage.width);
enemies[i]._y = randRange(0, Stage.height);
while (enemies[i].hitTest(ball1)) {
enemies[i]._x = randRange(0, Stage.width);
enemies[i]._y = randRange(0, Stage.height);
}
var _local7 = ball1._x - enemies[i]._x;
var _local5 = ball1._y - enemies[i]._y;
var _local12 = Math.atan2(_local5, _local7);
enemies[i]._rotation = (_local12 * 180) / Math.PI;
}
}
if (spikes[i] == 1000) {
enemies[i]._alpha = enemies[i]._alpha + 3;
if (enemies[i]._alpha >= 100) {
spikes[i] = 10000;
}
}
}
if ((enemyType[i] >= 10) || (enemyType[i] == 6)) {
if (enemies.length <= 15) {
if (enemyType[i] == 6) {
var _local6 = randRange(1, 280);
if (_local6 == 1) {
createEnemy2();
skipIt(2);
}
}
if (enemyType[i] == 10) {
var _local6 = randRange(1, 180);
if (_local6 == 1) {
createEnemy4();
skipIt(4);
}
}
if (enemyType[i] == 11) {
var _local6 = randRange(1, 140);
if (_local6 == 1) {
createEnemy2();
skipIt(2);
}
}
if (enemyType[i] == 12) {
var _local6 = randRange(1, 140);
if (_local6 == 1) {
createEnemy4();
skipIt(4);
}
}
if (enemyType[i] == 13) {
var _local6 = randRange(1, 140);
if (_local6 == 1) {
createEnemy6();
skipIt(6);
}
}
if (enemyType[i] == 14) {
var _local6 = randRange(1, 140);
if (_local6 == 1) {
createEnemy7();
skipIt(7);
}
}
if (enemyType[i] == 15) {
var _local6 = randRange(1, 280);
if (_local6 == 1) {
createEnemy10();
skipIt(10);
}
}
}
}
if (((((enemyType[i] == 4) || (enemyType[i] == 7)) || (enemyType[i] == 9)) || (enemyType[i] == 11)) || (enemyType[i] >= 13)) {
var _local4 = randRange(1, 140);
if (enemyType[i] == 7) {
_local4 = randRange(1, 320);
}
if (_local4 == 1) {
enemies[i].inside.removeMovieClip();
enemies[i].gotoAndStop(2);
}
if (enemies[i].inder._currentframe == 10) {
if (enemyType[i] != 9) {
if (enemyType[i] >= 11) {
bul = attachMovie("enbullet", "enbullet" + depth, depth);
} else {
bul = attachMovie("enbullet2", "enbullet" + depth, depth);
}
}
depth++;
if (enemyType[i] >= 11) {
bul._xscale = (bul._yscale = 200);
}
if (enemyType[i] != 9) {
bul._x = enemies[i]._x;
bul._y = enemies[i]._y;
bul._rotation = enemies[i]._rotation;
enBullets.push(bul);
enbx.push(Math.cos((bul._rotation * Math.PI) / 180) * 6);
enby.push(Math.sin((bul._rotation * Math.PI) / 180) * 6);
if (enemyType[i] == 7) {
bul2 = attachMovie("enbullet2", "enbullet" + depth, depth);
depth++;
bul3 = attachMovie("enbullet2", "enbullet" + depth, depth);
depth++;
bul2._x = (bul3._x = enemies[i]._x);
bul2._y = (bul3._y = enemies[i]._y);
bul2._rotation = enemies[i]._rotation + 10;
bul3._rotation = enemies[i]._rotation - 10;
enBullets.push(bul2);
enbx.push(Math.cos((bul2._rotation * Math.PI) / 180) * 6);
enby.push(Math.sin((bul2._rotation * Math.PI) / 180) * 6);
enBullets.push(bul3);
enbx.push(Math.cos((bul3._rotation * Math.PI) / 180) * 6);
enby.push(Math.sin((bul3._rotation * Math.PI) / 180) * 6);
}
} else {
bul = attachMovie("enbullet2", "enbullet" + depth, depth);
depth++;
bul2 = attachMovie("enbullet2", "enbullet" + depth, depth);
depth++;
bul3 = attachMovie("enbullet2", "enbullet" + depth, depth);
depth++;
bul4 = attachMovie("enbullet2", "enbullet" + depth, depth);
depth++;
bul._x = enemies[i]._x;
bul._y = enemies[i]._y;
bul._rotation = 45;
enBullets.push(bul);
enbx.push(Math.cos((bul._rotation * Math.PI) / 180) * 6);
enby.push(Math.sin((bul._rotation * Math.PI) / 180) * 6);
bul2._x = enemies[i]._x;
bul2._y = enemies[i]._y;
bul2._rotation = 135;
enBullets.push(bul2);
enbx.push(Math.cos((bul2._rotation * Math.PI) / 180) * 6);
enby.push(Math.sin((bul2._rotation * Math.PI) / 180) * 6);
bul3._x = enemies[i]._x;
bul3._y = enemies[i]._y;
bul3._rotation = -45;
enBullets.push(bul3);
enbx.push(Math.cos((bul3._rotation * Math.PI) / 180) * 6);
enby.push(Math.sin((bul3._rotation * Math.PI) / 180) * 6);
bul4._x = enemies[i]._x;
bul4._y = enemies[i]._y;
bul4._rotation = -135;
enBullets.push(bul4);
enbx.push(Math.cos((bul4._rotation * Math.PI) / 180) * 6);
enby.push(Math.sin((bul4._rotation * Math.PI) / 180) * 6);
}
}
}
if (enemies[i].target2.hitTest(ball1.abox) && (timer2 <= 0)) {
enemies[i].inside.removeMovieClip();
enemies[i].gotoAndStop(2);
}
if ((((((enemies[i].inder._currentframe == 10) && (enemyType[i] != 4)) && (enemyType[i] != 7)) && (enemyType[i] != 9)) && (enemyType[i] != 11)) && (enemyType[i] <= 12)) {
if (timer2 <= 0) {
lives = lives - (1 - (0.1 * armorq));
if (inver) {
lives = lives + (1 - (0.1 * armorq));
}
if (music_frame == 1) {
stab.start();
}
timer2 = 60;
textHolder.hFill._xscale = lives * (100 / (healthq + 10));
untouched = false;
if (lives <= 0) {
if (lSize == 0) {
realGO = 1;
}
gameover = 1;
gamepause = 1;
deaths = deaths + 1;
sObject.data.death = deaths;
sObject.flush();
}
textHolder.livestxt = lives;
attachMovie("redFlash", "redFlash", 1000824);
}
}
enemies[i]._x = enemies[i]._x - initialX;
enemies[i]._y = enemies[i]._y - initialY;
if ((enemies[i]._currentframe == 1) || (enemies[i]._currentframe == 4)) {
enemies[i]._x = enemies[i]._x + enemyX[i];
enemies[i]._y = enemies[i]._y + enemyY[i];
if ((enemyType[i] == 8) || (enemyType[i] == 3)) {
enRot = enemies[i]._rotation;
while (enRot <= ball1._rotation) {
enRot = enRot + 360;
}
enRot = enRot - 360;
if (((enRot + 180) >= (ball1._rotation - 170)) && ((enRot + 180) <= ball1._rotation)) {
enemies[i]._x = enemies[i]._x + Math.cos(((ball1._rotation - 90) * Math.PI) / 180);
enemies[i]._y = enemies[i]._y + Math.sin(((ball1._rotation - 90) * Math.PI) / 180);
}
if (((enRot + 180) <= (ball1._rotation + 170)) && ((enRot + 180) >= ball1._rotation)) {
enemies[i]._x = enemies[i]._x + Math.cos(((ball1._rotation + 90) * Math.PI) / 180);
enemies[i]._y = enemies[i]._y + Math.sin(((ball1._rotation + 90) * Math.PI) / 180);
}
}
if (enemyType[i] == 3) {
enemies[i]._x = enemies[i]._x + (enemyX[i] / 4);
enemies[i]._y = enemies[i]._y + (enemyY[i] / 4);
}
if ((((enemyType[i] == 2) || (enemyType[i] == 5)) || (enemyType[i] == 8)) || (enemyType[i] == 10)) {
enemies[i]._x = enemies[i]._x + enemyX[i];
enemies[i]._y = enemies[i]._y + enemyY[i];
if (enemyType[i] == 8) {
enemies[i]._x = enemies[i]._x + enemyX[i];
enemies[i]._y = enemies[i]._y + enemyY[i];
}
}
if (enemyType[i] >= 11) {
enemies[i]._x = enemies[i]._x + enemyX[i];
enemies[i]._y = enemies[i]._y + enemyY[i];
if ((enemyType[i] == 11) || (enemyType[i] == 14)) {
enemies[i]._x = enemies[i]._x + enemyX[i];
enemies[i]._y = enemies[i]._y + enemyY[i];
}
}
if (((enemyType[i] == 6) && (Math.abs(ball1._x - enemies[i]._x) <= 150)) && (Math.abs(ball1._y - enemies[i]._y) <= 150)) {
enemies[i]._x = enemies[i]._x + (enemyX[i] * 1.5);
enemies[i]._y = enemies[i]._y + (enemyY[i] * 1.5);
if (enemies[i]._currentframe == 1) {
enemies[i].gotoAndStop(4);
}
} else {
enemies[i].gotoAndStop(1);
}
}
if (bg.hitp.hitTest(enemies[i]._x + (enemies[i]._width / 2), enemies[i]._y, true)) {
enemies[i]._x = enemies[i]._x - 1;
if (bg.hitp.hitTest(enemies[i]._x + (enemies[i]._width / 2), enemies[i]._y, true)) {
enemies[i]._x = enemies[i]._x - 1;
if (bg.hitp.hitTest(enemies[i]._x + (enemies[i]._width / 2), enemies[i]._y, true)) {
enemies[i]._x = enemies[i]._x - 1;
}
}
}
if (bg.hitp.hitTest(enemies[i]._x - (enemies[i]._width / 2), enemies[i]._y, true)) {
enemies[i]._x = enemies[i]._x + 1;
if (bg.hitp.hitTest(enemies[i]._x - (enemies[i]._width / 2), enemies[i]._y, true)) {
enemies[i]._x = enemies[i]._x + 1;
if (bg.hitp.hitTest(enemies[i]._x - (enemies[i]._width / 2), enemies[i]._y, true)) {
enemies[i]._x = enemies[i]._x + 1;
}
}
}
if (bg.hitp.hitTest(enemies[i]._x, enemies[i]._y + (enemies[i]._height / 2), true)) {
enemies[i]._y = enemies[i]._y - 1;
if (bg.hitp.hitTest(enemies[i]._x, enemies[i]._y + (enemies[i]._height / 2), true)) {
enemies[i]._y = enemies[i]._y - 1;
if (bg.hitp.hitTest(enemies[i]._x, enemies[i]._y + (enemies[i]._height / 2), true)) {
enemies[i]._y = enemies[i]._y - 1;
}
}
}
if (bg.hitp.hitTest(enemies[i]._x, enemies[i]._y - (enemies[i]._height / 2), true)) {
enemies[i]._y = enemies[i]._y + 1;
if (bg.hitp.hitTest(enemies[i]._x, enemies[i]._y - (enemies[i]._height / 2), true)) {
enemies[i]._y = enemies[i]._y + 1;
if (bg.hitp.hitTest(enemies[i]._x, enemies[i]._y - (enemies[i]._height / 2), true)) {
enemies[i]._y = enemies[i]._y + 1;
}
}
}
i--;
}
}
function createEnemy1() {
en = attachMovie("enemy", "enemy" + depth, depth);
en._xscale = (en._yscale = 80);
depth++;
enemyHealth.push(1);
spikes.push(10000);
}
function createEnemy2() {
enemyHealth.push(2);
spikes.push(10000);
en = attachMovie("enemy2", "enemy" + depth, depth);
en._xscale = (en._yscale = 80);
depth++;
}
function createEnemy3() {
enemyHealth.push(3);
spikes.push(10000);
en = attachMovie("enemy3", "enemy" + depth, depth);
en._xscale = (en._yscale = 80);
depth++;
}
function createEnemy4() {
enemyHealth.push(5);
spikes.push(10000);
en = attachMovie("enemy4", "enemy" + depth, depth);
en._xscale = (en._yscale = 80);
depth++;
}
function createEnemy5() {
enemyHealth.push(7);
spikes.push(10000);
en = attachMovie("enemy5", "enemy" + depth, depth);
en._xscale = (en._yscale = 80);
depth++;
}
function createEnemy6() {
enemyHealth.push(15);
spikes.push(10000);
en = attachMovie("enemy6", "enemy" + depth, depth);
en._xscale = (en._yscale = 80);
depth++;
}
function createEnemy7() {
enemyHealth.push(25);
spikes.push(10000);
en = attachMovie("enemy7", "enemy" + depth, depth);
en._xscale = (en._yscale = 80);
depth++;
}
function createEnemy8() {
enemyHealth.push(30);
spikes.push(10000);
en = attachMovie("enemy8", "enemy" + depth, depth);
en._xscale = (en._yscale = 80);
depth++;
}
function createEnemy9(vari) {
enemyHealth.push(50);
spikes.push(10000);
en = attachMovie("enemy9", "enemy" + depth, depth);
en._xscale = (en._yscale = 80);
depth++;
}
function createEnemy10() {
enemyHealth.push(80);
spikes.push(10000);
en = attachMovie("enemy10", "enemy" + depth, depth);
en._xscale = (en._yscale = 80);
depth++;
}
function createBoss1() {
enemyHealth.push(300);
spikes.push(10000);
en = attachMovie("boss2", "boss" + depth, depth);
depth++;
}
function createBoss2() {
enemyHealth.push(800);
spikes.push(10000);
en = attachMovie("boss5", "boss" + depth, depth);
depth++;
}
function createBoss3() {
enemyHealth.push(1300);
spikes.push(10000);
en = attachMovie("boss3", "boss" + depth, depth);
depth++;
}
function createBoss4() {
enemyHealth.push(3000);
spikes.push(10000);
en = attachMovie("boss4", "boss" + depth, depth);
depth++;
}
function createBoss5() {
enemyHealth.push(5000);
spikes.push(10000);
en = attachMovie("boss1", "boss" + depth, depth);
depth++;
}
function quickRemove() {
enemies[i].removeMovieClip();
enemies.splice(i, 1);
trueOnStage = trueOnStage - 1;
enemyHealth.splice(i, 1);
enemyX.splice(i, 1);
enemyType.splice(i, 1);
enemyY.splice(i, 1);
spikes.splice(i, 1);
}
function coinMove() {
i = coins.length - 1;
while (i >= 0) {
coins[i]._x = coins[i]._x - initialX;
coins[i]._y = coins[i]._y - initialY;
coinTimer[i] = coinTimer[i] - 1;
if (coinTimer[i] <= 0) {
coins[i]._alpha = coins[i]._alpha - 1;
if (coins[i]._alpha <= 0) {
removeCoin();
moneyC = 1;
}
}
if (coins[i].hitTest(ball1.abox)) {
if (music_frame == 1) {
coinCollect.start();
}
if (coinWorth[i] == -1) {
ownBow1 = ownBow1 + 1;
makebigger.w1 = "x" + ownBow1;
giveAward(51);
}
if (coinWorth[i] == -2) {
ownBow2 = ownBow2 + 1;
makebigger.w2 = "x" + ownBow2;
giveAward(52);
}
if (coinWorth[i] == -3) {
ownBow3 = ownBow3 + 1;
makebigger.w3 = "x" + ownBow3;
giveAward(53);
}
if (coinWorth[i] == -4) {
ownBow4 = ownBow4 + 1;
makebigger.w4 = "x" + ownBow4;
giveAward(54);
}
if (coinWorth[i] == -5) {
ownBow5 = ownBow5 + 1;
makebigger.w5 = "x" + ownBow5;
giveAward(55);
}
if (coinWorth[i] == -6) {
giveAward(75);
gunAmmo2 = gunAmmo2 + 50;
makebigger.q2 = "x" + gunAmmo2;
}
if (coinWorth[i] == -7) {
giveAward(87);
gunAmmo3 = gunAmmo3 + 50;
makebigger.q3 = "x" + gunAmmo3;
}
if (coinWorth[i] == -8) {
giveAward(88);
gunAmmo4 = gunAmmo4 + 50;
makebigger.q5 = "x" + gunAmmo5;
}
if (coinWorth[i] == -9) {
giveAward(89);
gunAmmo5 = gunAmmo5 + 50;
makebigger.q4 = "x" + gunAmmo4;
}
if (coinWorth[i] == -10) {
giveAward(90);
gunAmmo6 = gunAmmo6 + 50;
makebigger.q6 = "x" + gunAmmo6;
}
money = money + coinWorth[i];
if ((armorEquip == 2) || (armorEquip == 6)) {
money = money + Math.ceil(coinWorth[i] / 4);
}
particleEffect4();
removeCoin();
if (lSize != 0) {
textHolder.moneytxt = money;
}
}
i--;
}
}
function removeCoin() {
coins[i].removeMovieClip();
coins.splice(i, 1);
coinTimer.splice(i, 1);
coinWorth.splice(i, 1);
}
function removeEnemy(vari) {
if (gamepause) {
remove = 0;
}
if (remove == 0) {
if (enemyType[vari] >= 11) {
if (enemyType[vari] == 11) {
money = money + 200;
giveAward(56);
}
if (enemyType[vari] == 12) {
money = money + 500;
giveAward(57);
}
if (enemyType[vari] == 13) {
money = money + 1000;
giveAward(58);
}
if (enemyType[vari] == 14) {
money = money + 2000;
giveAward(59);
}
if (enemyType[vari] == 15) {
giveAward(60);
}
}
var _local13 = randRange(1, 2);
if (_local13 == 1) {
var _local6 = 0;
var _local5 = 0;
var _local4 = 0;
var _local2 = 0;
var _local7 = 0;
var _local3 = 0;
if (enemyType[vari] == 1) {
_local3 = randRange(2, 3);
if (lSize == 0) {
_local6 = randRange(1, 10);
}
}
if (enemyType[vari] == 2) {
_local3 = randRange(3, 5);
_local6 = randRange(1, 15);
if ((armorEquip == 5) || (armorEquip == 6)) {
_local6 = randRange(1, 7);
}
if (lSize == 0) {
_local6 = randRange(1, 5);
}
}
if (enemyType[vari] == 3) {
_local3 = randRange(5, 9);
_local6 = randRange(1, 5);
if ((armorEquip == 5) || (armorEquip == 6)) {
_local6 = randRange(1, 3);
}
if (lSize == 0) {
_local6 = 0;
_local5 = randRange(1, 10);
}
}
if (enemyType[vari] == 4) {
_local3 = randRange(10, 13);
_local5 = randRange(1, 15);
if ((armorEquip == 5) || (armorEquip == 6)) {
_local5 = randRange(1, 7);
}
if (lSize == 0) {
_local5 = randRange(1, 5);
}
}
if (enemyType[vari] == 5) {
_local3 = randRange(12, 17);
_local5 = randRange(1, 5);
if ((armorEquip == 5) || (armorEquip == 6)) {
_local5 = randRange(1, 3);
}
if (lSize == 0) {
_local5 = 0;
_local4 = randRange(1, 10);
}
}
if (enemyType[vari] == 6) {
_local3 = randRange(17, 20);
_local4 = randRange(1, 15);
if ((armorEquip == 5) || (armorEquip == 6)) {
_local4 = randRange(1, 7);
}
if (lSize == 0) {
_local4 = randRange(1, 5);
}
}
if (enemyType[vari] == 7) {
_local3 = randRange(21, 24);
_local4 = randRange(1, 5);
if ((armorEquip == 5) || (armorEquip == 6)) {
_local4 = randRange(1, 3);
}
if (lSize == 0) {
_local4 = 0;
_local2 = randRange(1, 10);
}
}
if (enemyType[vari] == 8) {
_local3 = randRange(23, 27);
_local2 = randRange(1, 15);
if ((armorEquip == 5) || (armorEquip == 6)) {
_local2 = randRange(1, 7);
}
if (lSize == 0) {
_local2 = randRange(1, 5);
}
}
if (enemyType[vari] == 9) {
_local3 = randRange(25, 30);
_local2 = randRange(1, 5);
if ((armorEquip == 5) || (armorEquip == 6)) {
_local2 = randRange(1, 3);
}
if (lSize == 0) {
_local2 = 0;
_local7 = randRange(1, 10);
}
}
if (enemyType[vari] == 10) {
_local3 = randRange(30, 40);
_local7 = randRange(1, 15);
if ((armorEquip == 5) || (armorEquip == 6)) {
_local7 = randRange(1, 7);
}
if (lSize == 0) {
_local7 = randRange(1, 5);
}
}
if (lSize != 0) {
if (enemyType[vari] <= 3) {
coin = attachMovie("coin", "coin" + depth3, depth3);
}
if ((enemyType[vari] > 3) && (enemyType[vari] < 8)) {
coin = attachMovie("coin2a", "coin" + depth3, depth3);
}
if (enemyType[vari] >= 8) {
coin = attachMovie("coin3a", "coin" + depth3, depth3);
}
coin._xscale = (coin._yscale = 75);
depth3++;
coin._x = enemies[vari]._x;
coin._y = enemies[vari]._y;
coins.push(coin);
coinTimer.push(500);
coinWorth.push(_local3);
}
if (lSize == 0) {
if (ownBow1 >= 1) {
_local6 = 0;
}
if (ownBow2 >= 1) {
_local5 = 0;
}
if (ownBow3 >= 1) {
_local4 = 0;
}
if (ownBow4 >= 1) {
_local2 = 0;
}
if (ownBow5 >= 1) {
_local7 = 0;
}
}
if (_local6 == 1) {
coin2 = attachMovie("w1", "coin" + depth3, depth3);
coin2._xscale = (coin2._yscale = 45);
depth3++;
coin2._x = enemies[vari]._x;
coin2._y = enemies[vari]._y;
coins.push(coin2);
coinTimer.push(500);
coinWorth.push(-1);
}
if (_local5 == 1) {
coin2 = attachMovie("w2", "coin" + depth3, depth3);
coin2._xscale = (coin2._yscale = 45);
depth3++;
coin2._x = enemies[vari]._x;
coin2._y = enemies[vari]._y;
coins.push(coin2);
coinTimer.push(500);
coinWorth.push(-2);
}
if (_local4 == 1) {
coin2 = attachMovie("w3", "coin" + depth3, depth3);
coin2._xscale = (coin2._yscale = 45);
depth3++;
coin2._x = enemies[vari]._x;
coin2._y = enemies[vari]._y;
coins.push(coin2);
coinTimer.push(500);
coinWorth.push(-3);
}
if (_local2 == 1) {
coin2 = attachMovie("w4", "coin" + depth3, depth3);
coin2._xscale = (coin2._yscale = 45);
depth3++;
coin2._x = enemies[vari]._x;
coin2._y = enemies[vari]._y;
coins.push(coin2);
coinTimer.push(500);
coinWorth.push(-4);
}
if (_local7 == 1) {
coin2 = attachMovie("w5", "coin" + depth3, depth3);
coin2._xscale = (coin2._yscale = 45);
depth3++;
coin2._x = enemies[vari]._x;
coin2._y = enemies[vari]._y;
coins.push(coin2);
coinTimer.push(500);
coinWorth.push(-5);
}
} else if (lSize == 0) {
var _local11 = 0;
var _local10 = 0;
var _local9 = 0;
var _local8 = 0;
var _local12 = 0;
var _local3 = 0;
if (enemyType[vari] == 2) {
_local3 = randRange(10, 25);
_local11 = randRange(1, 5);
}
if (enemyType[vari] == 3) {
_local3 = randRange(10, 25);
_local11 = randRange(1, 2);
}
if (enemyType[vari] == 4) {
_local3 = randRange(10, 25);
_local10 = randRange(1, 4);
}
if (enemyType[vari] == 5) {
_local3 = randRange(10, 25);
_local10 = randRange(1, 2);
}
if (enemyType[vari] == 6) {
_local3 = randRange(10, 25);
_local9 = randRange(1, 3);
}
if (enemyType[vari] == 7) {
_local3 = randRange(10, 25);
_local9 = randRange(1, 1);
}
if (enemyType[vari] == 8) {
_local3 = randRange(10, 25);
_local8 = randRange(1, 2);
}
if (enemyType[vari] == 9) {
_local3 = randRange(10, 25);
_local8 = randRange(1, 1);
}
if (enemyType[vari] == 10) {
_local3 = randRange(10, 25);
_local12 = randRange(1, 1);
}
if (_local11 == 1) {
coin2 = attachMovie("yy2", "coin" + depth3, depth3);
coin2._xscale = (coin2._yscale = 45);
depth3++;
coin2._x = enemies[vari]._x;
coin2._y = enemies[vari]._y;
coins.push(coin2);
coinTimer.push(500);
coinWorth.push(-6);
}
if (_local10 == 1) {
coin2 = attachMovie("yy3", "coin" + depth3, depth3);
coin2._xscale = (coin2._yscale = 45);
depth3++;
coin2._x = enemies[vari]._x;
coin2._y = enemies[vari]._y;
coins.push(coin2);
coinTimer.push(500);
coinWorth.push(-7);
}
if (_local9 == 1) {
coin2 = attachMovie("yy5", "coin" + depth3, depth3);
coin2._xscale = (coin2._yscale = 45);
depth3++;
coin2._x = enemies[vari]._x;
coin2._y = enemies[vari]._y;
coins.push(coin2);
coinTimer.push(500);
coinWorth.push(-8);
}
if (_local8 == 1) {
coin2 = attachMovie("yy4", "coin" + depth3, depth3);
coin2._xscale = (coin2._yscale = 45);
depth3++;
coin2._x = enemies[vari]._x;
coin2._y = enemies[vari]._y;
coins.push(coin2);
coinTimer.push(500);
coinWorth.push(-9);
}
if (_local12 == 1) {
coin2 = attachMovie("yy6", "coin" + depth3, depth3);
coin2._xscale = (coin2._yscale = 45);
depth3++;
coin2._x = enemies[vari]._x;
coin2._y = enemies[vari]._y;
coins.push(coin2);
coinTimer.push(500);
coinWorth.push(-10);
}
}
enemies[vari].inside.removeMovieClip();
enemies[vari].gotoAndStop(3);
if (enemyType[vari] == 1) {
giveAward(61);
if (music_frame == 1) {
banger.start();
}
score = score + 5;
sm = attachMovie("scoreMovie", "scoreMovie" + depth, depth);
depth++;
sm.inside.inside.inside = "5";
sm._x = enemies[vari]._x;
sm._y = enemies[vari]._y;
ep = ep + 1;
textHolder.eptxt = ep;
} else if (enemyType[vari] == 8) {
giveAward(68);
if (music_frame == 1) {
banger.start();
}
score = score + 10;
sm = attachMovie("scoreMovie", "scoreMovie" + depth, depth);
depth++;
sm.inside.inside.inside = "10";
sm._x = enemies[vari]._x;
sm._y = enemies[vari]._y;
ep = ep + 1;
textHolder.eptxt = ep;
} else if (enemyType[vari] == 2) {
giveAward(62);
if (music_frame == 1) {
banger.start();
}
score = score + 7;
sm = attachMovie("scoreMovie", "scoreMovie" + depth, depth);
depth++;
sm.inside.inside.inside = "7";
sm._x = enemies[vari]._x;
sm._y = enemies[vari]._y;
} else if (enemyType[vari] == 3) {
giveAward(63);
if (music_frame == 1) {
banger.start();
}
score = score + 3;
sm = attachMovie("scoreMovie", "scoreMovie" + depth, depth);
depth++;
sm.inside.inside.inside = "3";
sm._x = enemies[vari]._x;
sm._y = enemies[vari]._y;
ep = ep + 2;
textHolder.eptxt = ep;
} else if (enemyType[vari] == 4) {
giveAward(64);
if (music_frame == 1) {
banger.start();
}
score = score + 12;
sm = attachMovie("scoreMovie", "scoreMovie" + depth, depth);
depth++;
sm.inside.inside.inside = "12";
sm._x = enemies[vari]._x;
sm._y = enemies[vari]._y;
ep = ep + 5;
textHolder.eptxt = ep;
} else if (enemyType[vari] == 5) {
if (music_frame == 1) {
banger.start();
}
giveAward(65);
} else if (enemyType[vari] == 6) {
giveAward(66);
if (music_frame == 1) {
banger.start();
}
score = score + 15;
sm = attachMovie("scoreMovie", "scoreMovie" + depth, depth);
depth++;
sm.inside.inside.inside = "15";
sm._x = enemies[vari]._x;
sm._y = enemies[vari]._y;
} else if (enemyType[vari] == 7) {
giveAward(67);
if (music_frame == 1) {
banger.start();
}
score = score + 18;
sm = attachMovie("scoreMovie", "scoreMovie" + depth, depth);
depth++;
sm.inside.inside.inside = "18";
sm._x = enemies[vari]._x;
sm._y = enemies[vari]._y;
} else if (enemyType[vari] == 9) {
giveAward(69);
if (music_frame == 1) {
banger.start();
}
score = score + 21;
sm = attachMovie("scoreMovie", "scoreMovie" + depth, depth);
depth++;
sm.inside.inside.inside = "21";
sm._x = enemies[vari]._x;
sm._y = enemies[vari]._y;
} else if (enemyType[vari] == 10) {
giveAward(70);
if (music_frame == 1) {
banger.start();
}
score = score + 10;
sm = attachMovie("scoreMovie", "scoreMovie" + depth, depth);
depth++;
sm.inside.inside.inside = "10";
sm._x = enemies[vari]._x;
sm._y = enemies[vari]._y;
}
textHolder.scoretxt = score;
enemies.splice(vari, 1);
trueOnStage = trueOnStage - 1;
enemyHealth.splice(vari, 1);
enemyX.splice(vari, 1);
enemyType.splice(vari, 1);
enemyY.splice(vari, 1);
spikes.splice(vari, 1);
sm.selectable = false;
}
remove = 1;
}
function onEnterFrame() {
timere = timere + 1;
if (timere == 20) {
if ((awardsRecieved[55] == 1) && (_root.test[2].medal_unlocked == false)) {
_root.medal_popup.unlockMedal("First Boss");
trace("hi1");
}
}
if (timere == 60) {
if ((awardsRecieved[56] == 1) && (_root.test[4].medal_unlocked == false)) {
_root.medal_popup.unlockMedal("Second Boss");
}
}
if (timere == 100) {
if ((awardsRecieved[57] == 1) && (_root.test[5].medal_unlocked == false)) {
_root.medal_popup.unlockMedal("Third Boss");
}
}
if (timere == 140) {
if ((awardsRecieved[58] == 1) && (_root.test[3].medal_unlocked == false)) {
_root.medal_popup.unlockMedal("Fourth Boss");
}
}
if (timere == 180) {
if ((awardsRecieved[59] == 1) && (_root.test[7].medal_unlocked == false)) {
_root.medal_popup.unlockMedal("Fifth Boss");
}
}
if (timere == 220) {
if ((awardsRecieved[60] == 1) && (_root.test[0].medal_unlocked == false)) {
_root.medal_popup.unlockMedal("First Kill");
}
}
if (timere == 260) {
if ((awardsRecieved[66] == 1) && (_root.test[1].medal_unlocked == false)) {
_root.medal_popup.unlockMedal("Tenth Kill");
}
}
if (timere == 300) {
if ((awardsTotal >= 100) && (_root.test[8].medal_unlocked == false)) {
_root.medal_popup.unlockMedal("100 Achievements");
}
}
if (timere == 340) {
if ((awardsTotal >= 75) && (_root.test[6].medal_unlocked == false)) {
_root.medal_popup.unlockMedal("75 Achievements");
}
}
enemyStart = enemyStart - 1;
if (money > 99999) {
money = 99999 /* 0x01869F */;
if (lSize != 0) {
textHolder.moneytxt = money;
}
}
if (Key.isDown(39) && (Key.isDown(16))) {
achievementAllowed = 0;
gamepause = true;
attachMovie("cheatscreen", "cheatscreen", 401710);
if (awardsTotal >= 90) {
cheatscreen.l9._x = -1300;
} else {
cheatscreen.ga._x = -1300;
}
if (awardsTotal >= 40) {
cheatscreen.l4._x = -1300;
} else {
cheatscreen.mm._x = -1300;
}
if (awardsTotal >= 30) {
cheatscreen.l3._x = -1300;
} else {
cheatscreen.ma._x = -1300;
}
if (awardsTotal >= 20) {
cheatscreen.l2._x = -1300;
} else {
cheatscreen.ab._x = -1300;
}
if (awardsTotal >= 60) {
cheatscreen.l6._x = -1300;
} else {
cheatscreen.ms._x = -1300;
}
if (awardsTotal >= 80) {
cheatscreen.l8._x = -1300;
} else {
cheatscreen.inv._x = -1300;
}
if (awardsTotal >= 70) {
cheatscreen.l7._x = -1300;
} else {
cheatscreen.rf._x = -1300;
}
if (awardsTotal >= 50) {
cheatscreen.l5._x = -1300;
} else {
cheatscreen.ss._x = -1300;
}
if (awardsTotal >= 10) {
cheatscreen.l1._x = -1300;
} else {
cheatscreen.nm._x = -1300;
}
cheatscreen._x = Stage.width / 2;
cheatscreen._y = Stage.height / 2;
cheatscreen.done.onPress = function () {
gamepause = 0;
cheatScreen.swapDepths(5500);
cheatscreen.removeMovieClip();
};
cheatscreen.ga.onPress = function () {
if (cheatscreen.ga.g._currentframe == 1) {
cheatscreen.ga.g.gotoAndStop(2);
gaOn = 1;
} else {
cheatscreen.ga.g.gotoAndStop(1);
gaOn = 0;
}
};
cheatscreen.mm.onPress = function () {
if (cheatscreen.mm.g._currentframe == 1) {
cheatscreen.mm.g.gotoAndStop(2);
money = 99999 /* 0x01869F */;
if (lSize != 0) {
textHolder.moneytxt = money;
}
} else {
cheatscreen.mm.g.gotoAndStop(1);
}
};
cheatscreen.ma.onPress = function () {
if (cheatscreen.ma.g._currentframe == 1) {
cheatscreen.ma.g.gotoAndStop(2);
gunAmmo1 = 99999 /* 0x01869F */;
gunAmmo2 = 99999 /* 0x01869F */;
gunAmmo3 = 99999 /* 0x01869F */;
gunAmmo4 = 99999 /* 0x01869F */;
gunAmmo5 = 99999 /* 0x01869F */;
gunAmmo6 = 99999 /* 0x01869F */;
makebigger.q1 = "x" + gunAmmo1;
makebigger.q2 = "x" + gunAmmo2;
makebigger.q3 = "x" + gunAmmo3;
makebigger.q4 = "x" + gunAmmo5;
makebigger.q5 = "x" + gunAmmo4;
makebigger.q6 = "x" + gunAmmo6;
} else {
cheatscreen.ma.g.gotoAndStop(1);
}
};
cheatscreen.ab.onPress = function () {
if (cheatscreen.ab.g._currentframe == 1) {
cheatscreen.ab.g.gotoAndStop(2);
ownBow1 = 99;
ownBow2 = 99;
ownBow3 = 99;
ownBow4 = 99;
ownBow5 = 99;
makebigger.w1 = "x" + ownBow1;
makebigger.w2 = "x" + ownBow2;
makebigger.w3 = "x" + ownBow3;
makebigger.w4 = "x" + ownBow4;
makebigger.w5 = "x" + ownBow5;
} else {
cheatscreen.ab.g.gotoAndStop(1);
}
};
cheatscreen.ms.onPress = function () {
if (cheatscreen.ms.g._currentframe == 1) {
cheatscreen.ms.g.gotoAndStop(2);
skillq = 4;
if (speedq < 4) {
speedq = 4;
}
armorq = 4;
healthq = 4;
speeded[0] = 5;
speeded[1] = 5;
speeded[2] = 5;
speeded[3] = 5;
speeded[4] = 5;
} else {
cheatscreen.ms.g.gotoAndStop(1);
}
};
cheatscreen.inv.onPress = function () {
if (cheatscreen.inv.g._currentframe == 1) {
cheatscreen.inv.g.gotoAndStop(2);
inver = 1;
} else {
cheatscreen.inv.g.gotoAndStop(1);
inver = 0;
}
};
cheatscreen.rf.onPress = function () {
if (cheatscreen.rf.g._currentframe == 1) {
cheatscreen.rf.g.gotoAndStop(2);
rapid = 1;
delayTime = 0;
} else {
cheatscreen.rf.g.gotoAndStop(1);
rapid = 0;
delayTime = 15;
}
};
cheatscreen.ss.onPress = function () {
if (cheatscreen.ss.g._currentframe == 1) {
cheatscreen.ss.g.gotoAndStop(2);
speedq = 5;
} else {
cheatscreen.ss.g.gotoAndStop(1);
speedq = 0;
}
};
cheatscreen.nm.onPress = function () {
if (cheatscreen.nm.g._currentframe == 1) {
cheatscreen.nm.g.gotoAndStop(2);
attachMovie("nightmode", "nightmode", 3);
} else {
cheatscreen.nm.g.gotoAndStop(1);
nightmode.removeMovieClip();
}
};
}
if (gamepause) {
_root._x = 0;
_root._y = 0;
}
ball1._rotation = topRotation;
if (enemiesLeft >= 90000) {
enemiesLeft = 100000 /* 0x0186A0 */;
textHolder.el._alpha = 0;
textHolder.el2._alpha = 0;
}
awardWait();
var _local8 = _xmouse - aim._x;
var _local7 = _ymouse - aim._y;
aim._x = aim._x + (_local8 / 2);
aim._y = aim._y + (_local7 / 2);
if ((gameover && (realGO == 0)) && (lSize != 0)) {
if (continues <= 0) {
realGO = 1;
} else {
realGO = 0.5;
attachMovie("continue2", "continue2", 406215);
gamepause = 1;
continue2.ye._alpha = 50;
continue2.ye.onRollOver = function () {
continue2.ye._alpha = 100;
};
continue2.ye.onRollOut = function () {
continue2.ye._alpha = 50;
};
continue2.no._alpha = 50;
continue2.no.onRollOver = function () {
continue2.no._alpha = 100;
};
continue2.no.onRollOut = function () {
continue2.no._alpha = 50;
};
continue2.ye.onPress = function () {
continue2.removeMovieClip();
continues = continues - 1;
gamepause = 0;
gameover = 0;
realGO = 0;
lives = 10 + healthq;
textHolder.hFill._xscale = 100;
};
continue2.no.onPress = function () {
continue2.removeMovieClip();
realGO = 1;
};
continue2.cl = "Continues Left: " + continues;
}
}
if (realGO == 1) {
i = coins.length - 1;
while (i >= 0) {
removeCoin();
i--;
}
bhealth.removeMovieClip();
award.removeMovieClip();
i = enemies.length;
while (i >= 0) {
enemies[i]._alpha = enemies[i]._alpha - 10;
if (enemies[i]._alpha <= 0) {
enemies[i].removeMovieClip();
enemies.splice(vari, 1);
trueOnStage = trueOnStage - 1;
enemyHealth.splice(vari, 1);
enemyX.splice(vari, 1);
enemyType.splice(vari, 1);
enemyY.splice(vari, 1);
spikes.splice(vari, 1);
}
i--;
}
i = bullets.length;
while (i >= 0) {
bullets[i]._alpha = bullets[i]._alpha - 10;
if (bullets[i]._alpha <= 0) {
bullets[i].removeMovieClip();
bulletX.splice(i, 1);
bulletY.splice(i, 1);
bullets.splice(i, 1);
}
i--;
}
i = enBullets.length;
while (i >= 0) {
removeEnBul();
i--;
}
ball1._alpha = ball1._alpha - 1;
ball2._alpha = ball2._alpha - 1;
ball3._alpha = ball3._alpha - 1;
ball4._alpha = ball4._alpha - 1;
ball5._alpha = ball5._alpha - 1;
nightmode.removeMovieClip();
i = explosions.length;
while (i >= 0) {
explosions[i].removeMovieClip();
explosions.splice(i, 1);
exX.splice(i, 1);
exY.splice(i, 1);
i--;
}
i = explosions2.length;
while (i >= 0) {
explosions2[i].removeMovieClip();
explosions2.splice(i, 1);
exX2.splice(i, 1);
exY2.splice(i, 1);
howFast.splice(i, 1);
i--;
}
makebigger.removeMovieClip();
if (ball1._alpha <= 0) {
shield.removeMovieClip();
ball1.removeMovieClip();
ball2.removeMovieClip();
ball3.removeMovieClip();
ball4.removeMovieClip();
ball5.removeMovieClip();
gotoAndStop (5);
}
}
if (menu._x == (Stage.width / 2)) {
if (menu._alpha < 100) {
menu._alpha = menu._alpha + 2;
}
}
if (!gamepause) {
if ((armorEquip == 3) || (armorEquip == 6)) {
lives = lives + 0.0002;
textHolder.hFill._xscale = lives * (100 / (healthq + 10));
if (textHolder.hFill._xscale > 100) {
textHolder.hFill._xscale = 100;
lives = 10;
}
}
particleMovement();
particleMovement2();
stale = 0;
var _local2 = 0;
if (Key.isDown(39) || (Key.isDown(68))) {
_local2 = 1;
velocityX = velocityX + (acceleration + (0.2 * speedq));
stale = 1;
}
if (Key.isDown(37) || (Key.isDown(65))) {
_local2 = 1;
velocityX = velocityX - (acceleration + (0.2 * speedq));
stale = 1;
}
if (Key.isDown(40) || (Key.isDown(83))) {
_local2 = 1;
velocityY = velocityY + (acceleration + (0.2 * speedq));
stale = 1;
}
if (Key.isDown(38) || (Key.isDown(87))) {
_local2 = 1;
velocityY = velocityY - (acceleration + (0.2 * speedq));
stale = 1;
}
if (_local2 == 1) {
ball1.w.play();
ball1.q.play();
}
if (_local2 == 0) {
ball1.w.stop();
ball1.q.stop();
}
velocityX = velocityX * friction;
velocityY = velocityY * friction;
ball1._x = ball1._x + velocityX;
ball1._y = ball1._y + velocityY;
if ((ball1._x + (ball1.abox._width / 2)) > Stage.width) {
ball1._x = Stage.width - (ball1.abox._width / 2);
velocityX = 0;
giveAward(72);
}
if (bg.hitp.hitTest(ball1._x + (ball1.abox._width / 2), ball1._y, true)) {
ball1._x = ball1._x - 1;
if (bg.hitp.hitTest(ball1._x + (ball1.abox._width / 2), ball1._y, true)) {
ball1._x = ball1._x - 1;
if (bg.hitp.hitTest(ball1._x + (ball1.abox._width / 2), ball1._y, true)) {
ball1._x = ball1._x - 1;
if (bg.hitp.hitTest(ball1._x + (ball1.abox._width / 2), ball1._y, true)) {
ball1._x = ball1._x - 1;
if (bg.hitp.hitTest(ball1._x + (ball1.abox._width / 2), ball1._y, true)) {
ball1._x = ball1._x - 1;
}
}
}
}
}
if (bg.hitp.hitTest(ball1._x - (ball1.abox._width / 2), ball1._y, true)) {
ball1._x = ball1._x + 1;
if (bg.hitp.hitTest(ball1._x - (ball1.abox._width / 2), ball1._y, true)) {
ball1._x = ball1._x + 1;
if (bg.hitp.hitTest(ball1._x - (ball1.abox._width / 2), ball1._y, true)) {
ball1._x = ball1._x + 1;
if (bg.hitp.hitTest(ball1._x - (ball1.abox._width / 2), ball1._y, true)) {
ball1._x = ball1._x + 1;
if (bg.hitp.hitTest(ball1._x - (ball1.abox._width / 2), ball1._y, true)) {
ball1._x = ball1._x + 1;
}
}
}
}
}
if (bg.hitp.hitTest(ball1._x, ball1._y + (ball1.abox._height / 2), true)) {
ball1._y = ball1._y - 1;
if (bg.hitp.hitTest(ball1._x, ball1._y + (ball1.abox._height / 2), true)) {
ball1._y = ball1._y - 1;
if (bg.hitp.hitTest(ball1._x, ball1._y + (ball1.abox._height / 2), true)) {
ball1._y = ball1._y - 1;
if (bg.hitp.hitTest(ball1._x, ball1._y + (ball1.abox._height / 2), true)) {
ball1._y = ball1._y - 1;
if (bg.hitp.hitTest(ball1._x, ball1._y + (ball1.abox._height / 2), true)) {
ball1._y = ball1._y - 1;
}
}
}
}
}
if (bg.hitp.hitTest(ball1._x, ball1._y - (ball1.abox._height / 2), true)) {
ball1._y = ball1._y + 1;
if (bg.hitp.hitTest(ball1._x, ball1._y - (ball1.abox._height / 2), true)) {
ball1._y = ball1._y + 1;
if (bg.hitp.hitTest(ball1._x, ball1._y - (ball1.abox._height / 2), true)) {
ball1._y = ball1._y + 1;
if (bg.hitp.hitTest(ball1._x, ball1._y - (ball1.abox._height / 2), true)) {
ball1._y = ball1._y + 1;
if (bg.hitp.hitTest(ball1._x, ball1._y - (ball1.abox._height / 2), true)) {
ball1._y = ball1._y + 1;
}
}
}
}
}
if ((ball1._x - (ball1.abox._width / 2)) < 0) {
ball1._x = ball1.abox._width / 2;
velocityX = 0;
giveAward(72);
}
if ((ball1._y + (ball1.abox._height / 2)) > Stage.height) {
ball1._y = Stage.height - (ball1.abox._height / 2);
velocityY = 0;
giveAward(72);
}
if ((ball1._y - (ball1.abox._height / 2)) < 0) {
ball1._y = ball1.abox._height / 2;
velocityY = 0;
giveAward(72);
}
aimer._x = ball1._x;
aimer._y = ball1._y;
aimer._rotation = topRotation;
remove = 0;
toNextLevel._xscale = percent;
if (toNextLevel._xscale < 0) {
toNextLevel._xscale = 0;
}
if (percent >= 100) {
leFin = leFin - 1;
}
if (((percent >= 100) && (leFin <= 0)) && (lSize != 0)) {
leFin = 105;
enchantPoints = enchantPoints + 2;
if (level >= 6) {
upgradePoints = upgradePoints + 1;
}
if (level >= 12) {
upgradePoints = upgradePoints + 1;
}
if (level >= 18) {
upgradePoints = upgradePoints + 1;
}
upgradePoints = upgradePoints + 1;
percent = 0;
level = level + 1;
if (bulletMissed == 0) {
giveAward(95);
}
if (untouched) {
giveAward(94);
}
bulletMissed = 0;
untouched = true;
enemiesOnStage = 0;
if (level >= 26) {
continues = 0;
gameover = 1;
gameWon = 1;
gamepause = 1;
} else {
menuCreate();
ball1.q.stop();
ball1.w.stop();
i = enemies.length - 1;
while (i >= 0) {
quickRemove();
i--;
}
menuExist = true;
textHolder.wavetxt = level + "/25";
chance = chance * 0.95;
}
}
var _local4 = _xmouse - ball1._x;
var _local3 = _ymouse - ball1._y;
if ((_local4 != 0) || (_local3 != 0)) {
var _local9 = Math.atan2(_local3, _local4);
topRotation = (_local9 * 180) / Math.PI;
}
initialX = bg._x;
initialY = bg._y;
bg._x = -ball1._x;
bg._y = -ball1._y;
initialX = initialX - bg._x;
initialY = initialY - bg._y;
ball2._x = ball2._x + ((ball1._x - ball2._x) / 3);
ball2._y = ball2._y + ((ball1._y - ball2._y) / 3);
ball3._x = ball3._x + ((ball2._x - ball3._x) / 3);
ball3._y = ball3._y + ((ball2._y - ball3._y) / 3);
ball4._x = ball4._x + ((ball3._x - ball4._x) / 3);
ball4._y = ball4._y + ((ball3._y - ball4._y) / 3);
ball5._x = ball5._x + ((ball4._x - ball5._x) / 3);
ball5._y = ball5._y + ((ball4._y - ball5._y) / 3);
var _local5 = randRange(1, chance);
if (((((_local5 == 1) && (enemies.length <= 15)) && (((enemiesOnStage - enemiesToKill) - 1) < 0)) && (enemyStart <= 0)) && (lSize != 0)) {
var _local6 = 1;
if (enemies.length >= 7) {
_local6 = randRange(1, 2);
}
if (_local6 == 1) {
enemyFunc();
}
} else if (((((enemies.length < enCome) && (enemies.length <= 10)) && (((enemiesOnStage - enemiesToKill) - 1) < 0)) && (enemyStart <= 0)) && (lSize != 0)) {
enemyFunc();
}
if (((lSize == 0) && (_local5 == 1)) && (enemies.length <= 10)) {
enemyFunc();
} else if ((enemies.length < 3) && (lSize == 0)) {
enemyFunc();
}
if (timer2 > 0) {
timer2 = timer2 - 1;
ball1._alpha = 30;
ball2._alpha = 30;
ball3._alpha = 30;
ball4._alpha = 30;
ball5._alpha = 30;
} else {
ball1._alpha = 100;
ball2._alpha = 100;
ball3._alpha = 100;
ball4._alpha = 100;
ball5._alpha = 100;
}
MouseDownCounter();
bulletMovement();
enemyMovement();
enbulMovement();
if (((((ownBow1 >= 1) && (ownBow2 >= 1)) && (ownBow3 >= 1)) && (ownBow4 >= 1)) && (ownBow5 >= 1)) {
giveAward(40);
}
coinMove();
bow._x = ball1._x;
bow._y = ball1._y;
bow._rotation = topRotation;
tAchs = (awardsTotal + "/") + "100";
if (shield != undefined) {
shield._x = ball1._x;
shield._y = ball1._y;
shield._xscale = (shield._yscale = ball1._xscale);
}
}
}
function randRange(smallNum, bigNum) {
return(Math.floor(Math.random() * ((bigNum - smallNum) + 1)) + smallNum);
}
function invisable() {
menu.shop.inventory2 = "";
menu.shop.ch._alpha = 0;
menu.shop.hp._alpha = 0;
menu.shop.h1._alpha = 0;
menu.shop.h2._alpha = 0;
menu.shop.h3._alpha = 0;
menu.shop.h4._alpha = 0;
menu.shop.h5._alpha = 0;
menu.shop.a1._alpha = 0;
menu.shop.a2._alpha = 0;
menu.shop.a3._alpha = 0;
menu.shop.a4._alpha = 0;
menu.shop.a5._alpha = 0;
menu.shop.a6._alpha = 0;
menu.shop.p1._alpha = 0;
menu.shop.t1._alpha = 0;
menu.shop.t2._alpha = 0;
menu.shop.t3._alpha = 0;
menu.shop.t4._alpha = 0;
menu.shop.t5._alpha = 0;
menu.shop.s1._alpha = 0;
menu.shop.s2._alpha = 0;
menu.shop.s3._alpha = 0;
menu.shop.s4._alpha = 0;
menu.shop.s5._alpha = 0;
}
function mPress() {
menu.shop.co = "$" + (level * 10);
menu.shop.sl = skillq;
menu.shop.warn._alpha = 0;
menu.shop.inventory = "";
menu.shop.itemname = "";
menu.shop.description = "Select an item.";
menu.shop.moneytext = money;
if (ownBow1 >= 1) {
menu.shop.bt1._alpha = 100;
}
if (ownBow2 >= 1) {
menu.shop.bt2._alpha = 100;
}
if (ownBow3 >= 1) {
menu.shop.bt3._alpha = 100;
}
if (ownBow4 >= 1) {
menu.shop.bt4._alpha = 100;
}
if (ownBow5 >= 1) {
menu.shop.bt5._alpha = 100;
}
menu.shop.e1.onPress = function () {
onView = 2;
menu.shop.gotoAndStop(2);
menu.shop.r1.gotoAndStop(skillq + 1);
menu.shop.r2.gotoAndStop(speedq + 1);
menu.shop.r3.gotoAndStop(armorq + 1);
menu.shop.r4.gotoAndStop(healthq + 1);
menu.shop.eno = enchantPoints;
menu.shop.upo = upgradePoints;
menu.shop.namer = "Skills";
menu.shop.desc = ((((((" Does 1/4 more damage Cost:" + Math.pow(2, menu.shop.r1._currentframe - 1)) + " \n Makes your character run faster. Cost:") + Math.pow(2, menu.shop.r2._currentframe - 1)) + " \n Enemies inflict less damage. Cost:") + Math.pow(2, menu.shop.r3._currentframe - 1)) + " \n Gives your character a higher maximum health. Cost:") + Math.pow(2, menu.shop.r4._currentframe - 1);
menu.shop.s1.onPress = function () {
invisable();
otherSelector = 1;
menu.shop.s1._alpha = 10;
menu.shop.namer = "Skill";
menu.shop.desc = " Does 1/4 more damage \n Cost:" + Math.pow(2, menu.shop.r1._currentframe - 1);
};
menu.shop.s2.onPress = function () {
invisable();
otherSelector = 2;
menu.shop.s2._alpha = 10;
menu.shop.namer = "Speed";
menu.shop.desc = " Makes your character faster. \n Cost:" + Math.pow(2, menu.shop.r2._currentframe - 1);
};
menu.shop.s3.onPress = function () {
invisable();
otherSelector = 3;
menu.shop.s3._alpha = 10;
nmenu.shop.namer = "Armor";
menu.shop.desc = " Enemies inflict less damage. \n Cost:" + Math.pow(2, menu.shop.r3._currentframe - 1);
};
menu.shop.s4.onPress = function () {
invisable();
otherSelector = 4;
menu.shop.s4._alpha = 10;
menu.shop.namer = "Health";
menu.shop.desc = " Gives your character a higher maximum health. \n Cost:" + Math.pow(2, menu.shop.r4._currentframe - 1);
};
menu.shop.s5.onPress = function () {
invisable();
otherSelector = 5;
menu.shop.namer = "Enchant";
menu.shop.desc = " Choose a bow you wish to enchant.";
};
menu.shop.t1.onPress = function () {
invisable();
otherSelector = 6;
menu.shop.r5.gotoAndStop(speeded[0] + 1);
menu.shop.bowbg.gotoAndStop(1);
menu.shop.t1._alpha = 10;
menu.shop.namer = "Shortbow";
menu.shop.desc = " Increases the bow's speed. \n Cost:" + Math.pow(2, menu.shop.r5._currentframe - 1);
};
menu.shop.t2.onPress = function () {
invisable();
otherSelector = 7;
menu.shop.r5.gotoAndStop(speeded[1] + 1);
menu.shop.bowbg.gotoAndStop(2);
menu.shop.t2._alpha = 10;
menu.shop.namer = "Longbow";
menu.shop.desc = " Increases the bow's speed. \n Cost:" + Math.pow(2, menu.shop.r5._currentframe - 1);
};
menu.shop.t3.onPress = function () {
invisable();
otherSelector = 8;
menu.shop.r5.gotoAndStop(speeded[2] + 1);
menu.shop.bowbg.gotoAndStop(3);
menu.shop.t3._alpha = 10;
menu.shop.namer = "Compositebow";
menu.shop.desc = " Increases the bow's speed. \n Cost:" + Math.pow(2, menu.shop.r5._currentframe - 1);
};
menu.shop.t4.onPress = function () {
invisable();
otherSelector = 9;
menu.shop.t4._alpha = 10;
menu.shop.r5.gotoAndStop(speeded[3] + 1);
menu.shop.bowbg.gotoAndStop(4);
menu.shop.namer = "Crossbow";
menu.shop.desc = " Increases the bow's speed. \n Cost:" + Math.pow(2, menu.shop.r5._currentframe - 1);
};
menu.shop.t5.onPress = function () {
invisable();
otherSelector = 10;
menu.shop.r5.gotoAndStop(speeded[4] + 1);
menu.shop.bowbg.gotoAndStop(5);
menu.shop.t5._alpha = 10;
menu.shop.namer = "Compoundbow";
menu.shop.desc = " Increases the bow's speed. \n Cost:" + Math.pow(2, menu.shop.r5._currentframe - 1);
};
menu.shop.y1.onRollOver = function () {
menu.shop.y1._alpha = 10;
};
menu.shop.y1.onRollOut = function () {
menu.shop.y1._alpha = 0;
};
menu.shop.y1.onReleaseOutside = function () {
menu.shop.y1._alpha = 0;
};
menu.shop.y2.onRollOver = function () {
menu.shop.y2._alpha = 10;
};
menu.shop.y2.onRollOut = function () {
menu.shop.y2._alpha = 0;
};
menu.shop.y2.onReleaseOutside = function () {
menu.shop.y2._alpha = 0;
};
menu.shop.y3.onRollOver = function () {
menu.shop.y3._alpha = 10;
};
menu.shop.y3.onRollOut = function () {
menu.shop.y3._alpha = 0;
};
menu.shop.y3.onReleaseOutside = function () {
menu.shop.y3._alpha = 0;
};
menu.shop.y4.onRollOver = function () {
menu.shop.y4._alpha = 10;
};
menu.shop.y4.onRollOut = function () {
menu.shop.y4._alpha = 0;
};
menu.shop.y4.onReleaseOutside = function () {
menu.shop.y4._alpha = 0;
};
menu.shop.y5.onRollOver = function () {
menu.shop.y5._alpha = 10;
};
menu.shop.y5.onRollOut = function () {
menu.shop.y5._alpha = 0;
};
menu.shop.y5.onReleaseOutside = function () {
menu.shop.y5._alpha = 0;
};
menu.shop.y1.onPress = function () {
if ((upgradePoints >= Math.pow(2, menu.shop.r1._currentframe - 1)) && (menu.shop.r1._currentframe != 5)) {
upgradePoints = upgradePoints - Math.pow(2, menu.shop.r1._currentframe - 1);
menu.shop.r1.gotoAndStop(menu.shop.r1._currentframe + 1);
menu.shop.upo = upgradePoints;
skillq = skillq + 1;
if (skillq == 4) {
giveAward(31);
}
menu.shop.desc = ((((((" Does 1/4 more damage Cost:" + Math.pow(2, menu.shop.r1._currentframe - 1)) + " \n Makes your character run faster. Cost:") + Math.pow(2, menu.shop.r2._currentframe - 1)) + " \n Enemies inflict less damage. Cost:") + Math.pow(2, menu.shop.r3._currentframe - 1)) + " \n Gives your character a higher maximum health. Cost:") + Math.pow(2, menu.shop.r4._currentframe - 1);
}
};
menu.shop.y2.onPress = function () {
if ((upgradePoints >= Math.pow(2, menu.shop.r2._currentframe - 1)) && (menu.shop.r2._currentframe != 5)) {
upgradePoints = upgradePoints - Math.pow(2, menu.shop.r2._currentframe - 1);
menu.shop.r2.gotoAndStop(menu.shop.r2._currentframe + 1);
menu.shop.upo = upgradePoints;
speedq = speedq + 1;
if (speedq == 4) {
giveAward(32);
}
menu.shop.desc = ((((((" Does 1/4 more damage Cost:" + Math.pow(2, menu.shop.r1._currentframe - 1)) + " \n Makes your character run faster. Cost:") + Math.pow(2, menu.shop.r2._currentframe - 1)) + " \n Enemies inflict less damage. Cost:") + Math.pow(2, menu.shop.r3._currentframe - 1)) + " \n Gives your character a higher maximum health. Cost:") + Math.pow(2, menu.shop.r4._currentframe - 1);
}
};
menu.shop.y3.onPress = function () {
if ((upgradePoints >= Math.pow(2, menu.shop.r3._currentframe - 1)) && (menu.shop.r3._currentframe != 5)) {
upgradePoints = upgradePoints - Math.pow(2, menu.shop.r3._currentframe - 1);
menu.shop.r3.gotoAndStop(menu.shop.r3._currentframe + 1);
menu.shop.upo = upgradePoints;
armorq = armorq + 1;
if (armorq == 4) {
giveAward(33);
}
menu.shop.desc = ((((((" Does 1/4 more damage Cost:" + Math.pow(2, menu.shop.r1._currentframe - 1)) + " \n Makes your character run faster. Cost:") + Math.pow(2, menu.shop.r2._currentframe - 1)) + " \n Enemies inflict less damage. Cost:") + Math.pow(2, menu.shop.r3._currentframe - 1)) + " \n Gives your character a higher maximum health. Cost:") + Math.pow(2, menu.shop.r4._currentframe - 1);
}
};
menu.shop.y4.onPress = function () {
if ((upgradePoints >= Math.pow(2, menu.shop.r4._currentframe - 1)) && (menu.shop.r4._currentframe != 5)) {
upgradePoints = upgradePoints - Math.pow(2, menu.shop.r4._currentframe - 1);
menu.shop.r4.gotoAndStop(menu.shop.r4._currentframe + 1);
menu.shop.upo = upgradePoints;
healthq = healthq + 2;
if (healthq == 4) {
giveAward(34);
}
lives = lives + 2;
textHolder.hFill._xscale = lives * (100 / (healthq + 10));
if (textHolder.hFill._xscale > 100) {
textHolder.hFill._xscale = 100;
lives = healthq + lives;
}
menu.shop.desc = ((((((" Does 1/4 more damage Cost:" + Math.pow(2, menu.shop.r1._currentframe - 1)) + " \n Makes your character run faster. Cost:") + Math.pow(2, menu.shop.r2._currentframe - 1)) + " \n Enemies inflict less damage. Cost:") + Math.pow(2, menu.shop.r3._currentframe - 1)) + " \n Gives your character a higher maximum health. Cost:") + Math.pow(2, menu.shop.r4._currentframe - 1);
}
};
menu.shop.y5.onPress = function () {
if ((enchantPoints >= Math.pow(2, menu.shop.r5._currentframe - 1)) && (menu.shop.r5._currentframe != 6)) {
enchantPoints = enchantPoints - Math.pow(2, menu.shop.r5._currentframe - 1);
if (otherSelector == 6) {
speeded[0] = speeded[0] + 1;
if (speeded[0] >= 5) {
giveAward(35);
}
}
if (otherSelector == 7) {
speeded[1] = speeded[1] + 1;
if (speeded[1] >= 5) {
giveAward(36);
}
}
if (otherSelector == 8) {
speeded[2] = speeded[2] + 1;
if (speeded[2] >= 5) {
giveAward(37);
}
}
if (otherSelector == 9) {
speeded[3] = speeded[3] + 1;
if (speeded[3] >= 5) {
giveAward(38);
}
}
if (otherSelector == 10) {
speeded[4] = speeded[4] + 1;
if (speeded[4] >= 5) {
giveAward(39);
}
}
menu.shop.r5.gotoAndStop(menu.shop.r5._currentframe + 1);
menu.shop.desc = " Increases the bow's speed. \n Cost:" + Math.pow(2, menu.shop.r5._currentframe - 1);
}
menu.shop.eno = enchantPoints;
menu.shop.upo = upgradePoints;
};
menu.shop.b1.onRollOver = function () {
menu.shop.b1._alpha = 30;
};
menu.shop.b1.onRollOut = function () {
menu.shop.b1._alpha = 10;
};
menu.shop.b1.onPress = function () {
menu.shop.gotoAndStop(1);
mPress();
onView = 1;
};
menu.shop.finished2.onRollOver = function () {
menu.shop.finished2._alpha = 20;
};
menu.shop.finished2.onRollOut = function () {
menu.shop.finished2._alpha = 0;
};
menu.shop.finished2.onPress = function () {
if (moneyC == 0) {
giveAward(79);
}
moneyC = 0;
if ((((gunAmmo2 + gunAmmo3) + gunAmmo4) + gunAmmo5) >= 1000) {
giveAward(77);
}
bestBow();
if (level == 2) {
cliped = attachMovie("newEnemies3", "newEnemies", 1001820);
cliped.gotoAndStop(10);
depth++;
enemyAmount = 4;
} else if (level == 4) {
cliped = attachMovie("newEnemies3", "newEnemies", 1001820);
cliped.gotoAndStop(9);
depth++;
enemyAmount = 5;
} else if (level == 7) {
cliped = attachMovie("newEnemies3", "newEnemies", 1001820);
cliped.gotoAndStop(8);
depth++;
enemyAmount = 6;
} else if (level == 11) {
cliped = attachMovie("newEnemies3", "newEnemies", 1001820);
cliped.gotoAndStop(7);
depth++;
enemyAmount = 7;
} else if (level == 14) {
cliped = attachMovie("newEnemies3", "newEnemies", 1001820);
cliped.gotoAndStop(5);
depth++;
enemyAmount = 8;
} else if (level == 17) {
cliped = attachMovie("newEnemies3", "newEnemies", 1001820);
cliped.gotoAndStop(6);
depth++;
enemyAmount = 9;
} else if (level == 22) {
cliped = attachMovie("newEnemies3", "newEnemies", 1001820);
cliped.gotoAndStop(4);
depth++;
enemyAmount = 10;
} else {
levelUp.gotoAndPlay(1);
}
var timeToGo = 150;
cliped._x = 100;
cliped._y = 70;
cliped._xscale = (cliped._yscale = 50);
cliped.onEnterFrame = function () {
timeToGo = timeToGo - 1;
if (timeToGo <= 0) {
this._alpha = this._alpha - 3;
if (this._alpha <= 0) {
this.removeMovieClip();
}
}
};
if (gunAmmo1 >= 99999) {
gunAmmo1 = 99999 /* 0x01869F */;
}
if (gunAmmo2 >= 99999) {
gunAmmo2 = 99999 /* 0x01869F */;
}
if (gunAmmo3 >= 99999) {
gunAmmo3 = 99999 /* 0x01869F */;
}
if (gunAmmo4 >= 99999) {
gunAmmo4 = 99999 /* 0x01869F */;
}
if (gunAmmo5 >= 99999) {
gunAmmo5 = 99999 /* 0x01869F */;
}
if (gunAmmo6 >= 99999) {
gunAmmo6 = 99999 /* 0x01869F */;
}
if (ownBow1 >= 99999) {
ownBow1 = 99999 /* 0x01869F */;
}
if (ownBow2 >= 99999) {
ownBow2 = 99999 /* 0x01869F */;
}
if (ownBow3 >= 99999) {
ownBow3 = 99999 /* 0x01869F */;
}
if (ownBow4 >= 99999) {
ownBow4 = 99999 /* 0x01869F */;
}
if (ownBow5 >= 99999) {
ownBow5 = 99999 /* 0x01869F */;
}
menuExist = false;
menu.removeMovieClip();
makebigger.w1 = "x" + ownBow1;
makebigger.w2 = "x" + ownBow2;
makebigger.w3 = "x" + ownBow3;
makebigger.w4 = "x" + ownBow4;
makebigger.w5 = "x" + ownBow5;
makebigger.q1 = "x" + gunAmmo1;
makebigger.q2 = "x" + gunAmmo2;
makebigger.q3 = "x" + gunAmmo3;
makebigger.q4 = "x" + gunAmmo5;
makebigger.q5 = "x" + gunAmmo4;
makebigger.q6 = "x" + gunAmmo6;
gamepause = false;
if (((((level == 5) || (level == 10)) || (level == 15)) || (level == 20)) || (level == 25)) {
attachMovie("bhealth", "bhealth", 1001360);
bhealth._x = (Stage.width / 2) - 120;
bhealth._y = 400;
enemiesToKill = 0;
if (level == 5) {
createBoss1();
enemyType.push(11);
}
if (level == 10) {
createBoss2();
enemyType.push(12);
}
if (level == 15) {
createBoss3();
enemyType.push(13);
}
if (level == 20) {
createBoss4();
enemyType.push(14);
}
if (level == 25) {
createBoss5();
enemyType.push(15);
}
enemies.push(en);
enemyX.push(0);
enemyY.push(0);
} else {
enemiesToKill = 40;
}
};
};
menu.shop.ch._alpha = 0;
menu.shop.inventory2 = "";
menu.shop.e1.onRollOver = function () {
menu.shop.e1._alpha = 30;
};
menu.shop.e1.onRollOut = function () {
menu.shop.e1._alpha = 10;
};
menu.shop.hp.onPress = function () {
selector = 15;
menu.shop.itemname = "Health Refil";
invisable();
menu.shop.inventory = 0;
menu.shop.inventory2 = Math.floor(lives * (100 / (10 + healthq)));
menu.shop.description = "Refils some of your health.";
menu.shop.hp._alpha = 10;
menu.shop.ch._alpha = 100;
};
menu.shop.h1.onPress = function () {
selector = 1;
menu.shop.itemname = "Short Bow";
menu.shop.inventory = ownBow1;
menu.shop.description = " Cost: 20 \n Damage Bonuses: None \n Usable Arrows: Regular \n Multishot: 1 Arrow \n Sell Value: 13";
invisable();
menu.shop.h1._alpha = 10;
};
menu.shop.h2.onPress = function () {
selector = 2;
menu.shop.itemname = "Long Bow";
menu.shop.inventory = ownBow2;
menu.shop.description = " Cost: 100 \n Damage Bonuses: Double \n Usable Arrows: Light & Previous \n Multishot: 1 Arrow \n Sell Value: 50";
invisable();
menu.shop.h2._alpha = 10;
};
menu.shop.h3.onPress = function () {
selector = 3;
menu.shop.itemname = "Composite Bow";
menu.shop.inventory = ownBow3;
menu.shop.description = " Cost: 500 \n Damage Bonuses: Double \n Usable Arrows: Heavy & Previous \n Multishot: 2 Arrows \n Sell Value: 250";
invisable();
menu.shop.h3._alpha = 10;
};
menu.shop.h4.onPress = function () {
selector = 4;
menu.shop.itemname = "Cross Bow";
menu.shop.inventory = ownBow4;
menu.shop.description = " Cost: 2000 \n Damage Bonuses: Triple \n Usable Arrows: Fire & Previous \n Multishot: 2 Arrows \n Sell Value: 1000";
invisable();
menu.shop.h4._alpha = 10;
};
menu.shop.h5.onPress = function () {
selector = 5;
menu.shop.itemname = "Compound Bow";
menu.shop.inventory = ownBow5;
menu.shop.description = " Cost: 10000 \n Damage Bonuses: Triple \n Usable Arrows: ALL \n Multishot: 3 Arrows \n Sell Value: 5000";
invisable();
menu.shop.h5._alpha = 10;
};
menu.shop.a1.onPress = function () {
selector = 6;
menu.shop.itemname = "Regular Arrows";
menu.shop.inventory = "\u221E";
menu.shop.description = " Cost: 0 \n Damage Bonuses: None \n Effect: None \n Bow Needed: Shortbow \n Sell Value: 0";
invisable();
menu.shop.a1._alpha = 10;
};
menu.shop.a2.onPress = function () {
selector = 7;
menu.shop.inventory = gunAmmo2;
menu.shop.itemname = "Light Arrows";
menu.shop.description = " Cost: 10 \n Damage Bonuses: Double \n Bow Needed: Longbow \n Sell Value: 5";
invisable();
menu.shop.a2._alpha = 10;
};
menu.shop.a3.onPress = function () {
selector = 8;
menu.shop.inventory = gunAmmo3;
menu.shop.itemname = "Heavy Arrows";
menu.shop.description = " Cost: 20 \n Damage Bonuses: Triple \n Bow Needed: Compositebow \n Sell Value: 10";
invisable();
menu.shop.a3._alpha = 10;
};
menu.shop.a4.onPress = function () {
selector = 9;
menu.shop.inventory = gunAmmo4;
menu.shop.itemname = "Ice Arrows";
menu.shop.description = " Cost: 50 \n Damage Bonuses: Quadruple \n Bow Needed: Crossbow \n Sell Value: 25";
invisable();
menu.shop.a4._alpha = 10;
};
menu.shop.a5.onPress = function () {
selector = 10;
menu.shop.inventory = gunAmmo5;
menu.shop.itemname = "Fire Arrows";
menu.shop.description = " Cost: 100 \n Damage Bonuses: Quadruple \n Bow Needed: Crossbow \n Sell Value: 50";
invisable();
menu.shop.a5._alpha = 10;
};
menu.shop.a6.onPress = function () {
selector = 11;
menu.shop.inventory = gunAmmo6;
menu.shop.itemname = "Electric Arrows";
menu.shop.description = " Cost: 200 \n Damage Bonuses: Quintuple \n Bow Needed: Compoundbow \n Sell Value: 100";
invisable();
menu.shop.a6._alpha = 10;
};
menu.shop.p1.onRollOver = function () {
menu.shop.p1._alpha = 20;
};
menu.shop.p1.onRollOut = function () {
menu.shop.p1._alpha = 0;
};
menu.shop.d1.onRollOver = function () {
menu.shop.d1._alpha = 20;
};
menu.shop.d1.onRollOut = function () {
menu.shop.d1._alpha = 0;
};
menu.shop.p1.onPress = function () {
if (selector == 1) {
if (money >= 25) {
money = money - 25;
spent = spent + 25;
ownBow1 = ownBow1 + 1;
menu.shop.bt1._alpha = 100;
menu.shop.inventory = ownBow1;
}
}
if (selector == 2) {
if (money >= 100) {
bBig = 0;
money = money - 100;
spent = spent + 100;
ownBow2 = ownBow2 + 1;
giveAward(21);
menu.shop.bt2._alpha = 100;
menu.shop.inventory = ownBow2;
} else {
menu.shop.warn._alpha = 100;
menu.shop.warn.gotoAndStop(2);
}
}
if (selector == 3) {
if (money >= 500) {
bBig = 0;
money = money - 500;
spent = spent + 500;
ownBow3 = ownBow3 + 1;
giveAward(22);
menu.shop.bt3._alpha = 100;
menu.shop.inventory = ownBow3;
} else {
menu.shop.warn._alpha = 100;
menu.shop.warn.gotoAndStop(2);
}
}
if (selector == 4) {
if (money >= 2000) {
bBig = 0;
money = money - 2000;
spent = spent + 2000;
giveAward(23);
ownBow4 = ownBow4 + 1;
menu.shop.bt4._alpha = 100;
menu.shop.inventory = ownBow4;
} else {
menu.shop.warn._alpha = 100;
menu.shop.warn.gotoAndStop(2);
}
}
if (selector == 5) {
if (money >= 10000) {
bBig = 0;
money = money - 10000;
spent = spent + 10000;
giveAward(24);
ownBow5 = ownBow5 + 1;
menu.shop.bt5._alpha = 100;
menu.shop.inventory = ownBow5;
} else {
menu.shop.warn._alpha = 100;
menu.shop.warn.gotoAndStop(2);
}
}
if (selector == 7) {
if (money >= 10) {
if ((((ownBow2 >= 1) || (ownBow3 >= 1)) || (ownBow4 >= 1)) || (ownBow5 >= 1)) {
giveAward(16);
money = money - 10;
spent = spent + 10;
gunAmmo2 = gunAmmo2 + 100;
menu.shop.inventory = gunAmmo2;
} else {
menu.shop.warn._alpha = 100;
}
} else {
menu.shop.warn._alpha = 100;
menu.shop.warn.gotoAndStop(2);
}
}
if (selector == 8) {
if (money >= 20) {
if (((ownBow3 >= 1) || (ownBow4 >= 1)) || (ownBow5 >= 1)) {
giveAward(17);
money = money - 20;
spent = spent + 20;
gunAmmo3 = gunAmmo3 + 100;
menu.shop.inventory = gunAmmo3;
} else {
menu.shop.warn._alpha = 100;
}
} else {
menu.shop.warn._alpha = 100;
menu.shop.warn.gotoAndStop(2);
}
}
if (selector == 9) {
if (money >= 50) {
if ((ownBow4 >= 1) || (ownBow5 >= 1)) {
giveAward(18);
money = money - 50;
spent = spent + 50;
gunAmmo4 = gunAmmo4 + 100;
menu.shop.inventory = gunAmmo4;
} else {
menu.shop.warn._alpha = 100;
}
} else {
menu.shop.warn._alpha = 100;
menu.shop.warn.gotoAndStop(2);
}
}
if (selector == 10) {
if (money >= 100) {
if ((ownBow4 >= 1) || (ownBow5 >= 1)) {
giveAward(19);
money = money - 100;
spent = spent + 100;
gunAmmo5 = gunAmmo5 + 100;
menu.shop.inventory = gunAmmo5;
} else {
menu.shop.warn._alpha = 100;
}
} else {
menu.shop.warn._alpha = 100;
menu.shop.warn.gotoAndStop(2);
}
}
if (selector == 11) {
if (money >= 200) {
if (ownBow5 >= 1) {
giveAward(20);
money = money - 200;
spent = spent + 200;
gunAmmo6 = gunAmmo6 + 100;
menu.shop.inventory = gunAmmo6;
} else {
menu.shop.warn._alpha = 100;
}
} else {
menu.shop.warn._alpha = 100;
menu.shop.warn.gotoAndStop(2);
}
}
if (selector == 15) {
if ((money >= (level * 10)) && (lives < (10 + healthq))) {
giveAward(76);
money = money - (level * 10);
spent = spent + (level * 10);
lives = lives + 1;
textHolder.hFill._xscale = lives * (100 / (healthq + 10));
if (textHolder.hFill._xscale > 100) {
textHolder.hFill._xscale = 100;
lives = healthq + 10;
}
menu.shop.inventory2 = Math.floor(lives * (100 / (healthq + 10)));
} else {
menu.shop.warn._alpha = 100;
menu.shop.warn.gotoAndStop(2);
}
}
if (spent >= 101) {
giveAward(81);
}
if (spent >= 500) {
giveAward(82);
}
if (spent >= 1000) {
giveAward(83);
}
if (spent >= 2000) {
giveAward(84);
}
if (spent >= 5000) {
giveAward(85);
}
if (spent >= 10000) {
giveAward(86);
}
menu.shop.moneytext = money;
};
menu.shop.d1.onPress = function () {
if (selector == 1) {
if (ownBow1 >= 1) {
if (((((ownBow1 >= 2) || (ownBow2 >= 1)) || (ownBow3 >= 1)) || (ownBow4 >= 1)) || (ownBow5 >= 1)) {
giveAward(78);
money = money + 13;
ownBow1 = ownBow1 - 1;
if (ownBow1 <= 0) {
menu.shop.bt1._alpha = 0;
}
menu.shop.inventory = ownBow1;
} else {
menu.shop.warn._alpha = 100;
menu.shop.warn.gotoAndStop(2);
}
} else {
menu.shop.warn._alpha = 100;
menu.shop.warn.gotoAndStop(2);
}
}
if (selector == 2) {
if (ownBow2 >= 1) {
if (((((ownBow1 >= 1) || (ownBow2 >= 2)) || (ownBow3 >= 1)) || (ownBow4 >= 1)) || (ownBow5 >= 1)) {
money = money + 50;
ownBow2 = ownBow2 - 1;
if (ownBow2 <= 0) {
menu.shop.bt2._alpha = 0;
}
menu.shop.inventory = ownBow2;
} else {
menu.shop.warn._alpha = 100;
menu.shop.warn.gotoAndStop(2);
}
} else {
menu.shop.warn._alpha = 100;
menu.shop.warn.gotoAndStop(2);
}
}
if (selector == 3) {
if (ownBow3 >= 1) {
if (((((ownBow1 >= 1) || (ownBow2 >= 1)) || (ownBow3 >= 2)) || (ownBow4 >= 1)) || (ownBow5 >= 1)) {
money = money + 250;
ownBow3 = ownBow3 - 1;
if (ownBow3 <= 0) {
menu.shop.bt3._alpha = 0;
}
menu.shop.inventory = ownBow3;
} else {
menu.shop.warn._alpha = 100;
menu.shop.warn.gotoAndStop(2);
}
} else {
menu.shop.warn._alpha = 100;
menu.shop.warn.gotoAndStop(2);
}
}
if (selector == 4) {
if (ownBow4 >= 1) {
if (((((ownBow1 >= 1) || (ownBow2 >= 1)) || (ownBow3 >= 1)) || (ownBow4 >= 2)) || (ownBow5 >= 1)) {
money = money + 1000;
ownBow4 = ownBow4 - 1;
if (ownBow4 <= 0) {
menu.shop.bt4._alpha = 0;
}
menu.shop.inventory = ownBow4;
} else {
menu.shop.warn._alpha = 100;
menu.shop.warn.gotoAndStop(2);
}
} else {
menu.shop.warn._alpha = 100;
menu.shop.warn.gotoAndStop(2);
}
}
if (selector == 5) {
if (ownBow5 >= 1) {
if (((((ownBow1 >= 1) || (ownBow2 >= 1)) || (ownBow3 >= 1)) || (ownBow4 >= 1)) || (ownBow5 >= 2)) {
money = money + 5000;
ownBow5 = ownBow5 - 1;
if (ownBow5 <= 0) {
menu.shop.bt5._alpha = 0;
}
menu.shop.inventory = ownBow5;
} else {
menu.shop.warn._alpha = 100;
menu.shop.warn.gotoAndStop(2);
}
} else {
menu.shop.warn._alpha = 100;
menu.shop.warn.gotoAndStop(2);
}
}
if (selector == 7) {
if (gunAmmo2 >= 100) {
money = money + 5;
gunAmmo2 = gunAmmo2 - 100;
menu.shop.inventory = gunAmmo2;
} else {
menu.shop.warn._alpha = 100;
menu.shop.warn.gotoAndStop(2);
}
}
if (selector == 8) {
if (gunAmmo3 >= 100) {
money = money + 10;
gunAmmo3 = gunAmmo3 - 100;
menu.shop.inventory = gunAmmo3;
} else {
menu.shop.warn._alpha = 100;
menu.shop.warn.gotoAndStop(2);
}
}
if (selector == 9) {
if (gunAmmo4 >= 100) {
money = money + 25;
gunAmmo4 = gunAmmo4 - 100;
menu.shop.inventory = gunAmmo4;
} else {
menu.shop.warn._alpha = 100;
menu.shop.warn.gotoAndStop(2);
}
}
if (selector == 10) {
if (gunAmmo5 >= 100) {
money = money + 50;
gunAmmo5 = gunAmmo5 - 100;
menu.shop.inventory = gunAmmo5;
} else {
menu.shop.warn._alpha = 100;
menu.shop.warn.gotoAndStop(2);
}
}
if (selector == 11) {
if (gunAmmo6 >= 100) {
money = money + 100;
gunAmmo6 = gunAmmo6 - 100;
menu.shop.inventory = gunAmmo6;
} else {
menu.shop.warn._alpha = 100;
menu.shop.warn.gotoAndStop(2);
}
}
menu.shop.moneytext = money;
};
}
function menuCreate() {
menu = attachMovie("menu", "menu", 1001380);
menu.shop.warn._alpha = 0;
gamepause = true;
menu._alpha = 0;
menu._x = Stage.width / 2;
menu._y = Stage.height / 2;
onView = 1;
menu.p3.onPress = function () {
menu.shop.gotoAndStop(3);
menu.shop.bs1.onPress = function () {
};
menu.shop.bs2.onPress = function () {
};
menu.shop.bs3.onPress = function () {
};
menu.shop.bs4.onPress = function () {
};
menu.shop.bs5.onPress = function () {
};
};
mPress();
}
function particleEffect2(vari) {
q = 25;
while (q > 0) {
exp = attachMovie("explosion", "explosion" + depth, depth);
exp._xscale = (exp._yscale = randRange(10, 100));
exp._x = ball1._x + ((Math.random() * 600) - 300);
exp._y = ball1._y + ((Math.random() * 600) - 300);
depth++;
var _local3 = exp._x - ball1._x;
var _local2 = exp._y - ball1._y;
var _local4 = Math.atan2(_local2, _local3);
var _local1 = (_local4 * 180) / Math.PI;
exp._alpha = 0;
xDir = Math.cos(_local1);
yDir = Math.sin(_local1);
explosions2.push(exp);
exX2.push(xDir);
exY2.push(yDir);
howFast.push(1);
blah = new Color(exp);
q--;
}
}
function particleMovement2() {
i = explosions2.length;
while (i >= 0) {
var _local3 = explosions2[i]._x - ball1._x;
var _local2 = explosions2[i]._y - ball1._y;
var _local1 = Math.atan2(_local2, _local3);
exX2[i] = Math.cos(_local1) * 5;
exY2[i] = Math.sin(_local1) * 5;
howFast[i] = howFast[i] + 0.05;
exX2[i] = exX2[i] * howFast[i];
exY2[i] = exY2[i] * howFast[i];
explosions2[i]._x = explosions2[i]._x - exX2[i];
explosions2[i]._y = explosions2[i]._y - exY2[i];
explosions2[i]._alpha = explosions2[i]._alpha + 2;
if ((explosions2[i]._alpha <= 0) || (explosions2[i].hitTest(ball1))) {
explosions2[i].removeMovieClip();
explosions2.splice(i, 1);
exX2.splice(i, 1);
exY2.splice(i, 1);
howFast.splice(i, 1);
}
i--;
}
}
function particleEffect3(vari, vari2) {
q = 15;
while (q > 0) {
exp = attachMovie("explosion", "explosion" + depth, depth);
exp._xscale = (exp._yscale = randRange(10, 30));
exp._x = enemies[vari]._x;
exp._y = enemies[vari]._y;
exp._rotation = enemies[vari]._rotation;
depth++;
xDir = Math.cos(((bullets[vari2]._rotation * Math.PI) / 180) + ((Math.random() / 2) - 0.5)) * randRange(3, 20);
yDir = Math.sin(((bullets[vari2]._rotation * Math.PI) / 180) + ((Math.random() / 2) - 0.5)) * randRange(3, 20);
explosions.push(exp);
exX.push(xDir);
exY.push(yDir);
q--;
}
}
function particleEffect4() {
q = 10;
while (q > 0) {
exp = attachMovie("explosion2", "explosion" + depth, depth);
depth++;
exp._xscale = (exp._yscale = randRange(20, 70));
exp._x = ball1._x;
exp._y = ball1._y;
xDir = (Math.random() * 10) - 5;
yDir = (Math.random() * 10) - 5;
explosions.push(exp);
exX.push(xDir);
exY.push(yDir);
q--;
}
}
function particleEffect(vari) {
q = 7;
while (q > 0) {
exp = this.createEmptyMovieClip("exp" + depth, depth);
drawCircle(exp, 100, 10092288, 100);
exp._xscale = (exp._yscale = randRange(1, 10));
exp._x = enemies[vari]._x;
exp._y = enemies[vari]._y;
depth++;
xDir = (Math.random() * 20) - 10;
yDir = (Math.random() * 20) - 10;
explosions.push(exp);
exX.push(xDir);
exY.push(yDir);
blah = new Color(exp);
if (enemyType[vari] == 1) {
if (enemies[vari]._currentframe == 2) {
blah.setRGB(65280);
}
if (enemies[vari]._currentframe == 3) {
blah.setRGB(255);
}
if (enemies[vari]._currentframe == 1) {
blah.setRGB(16711680);
}
} else if ((enemyType[vari] == 2) || (enemyType[vari] == 3)) {
blah.setRGB(10027161);
} else if ((enemyType[vari] == 4) || (enemyType[vari] == 5)) {
blah.setRGB(0);
} else if (enemyType[vari] == 6) {
blah.setRGB(12085813);
} else if (enemyType[vari] == 7) {
blah.setRGB(13484544);
} else if (enemyType[vari] == 8) {
if (enemies[vari]._currentframe == 2) {
blah.setRGB(65280);
}
if (enemies[vari]._currentframe == 3) {
blah.setRGB(255);
}
if (enemies[vari]._currentframe == 1) {
blah.setRGB(10027008);
}
} else if ((enemyType[vari] == 9) || (enemyType[vari] == 10)) {
blah.setRGB(16776960);
} else if (enemyType[vari] == 11) {
blah.setRGB(0);
}
q--;
}
}
function particleMovement() {
i = explosions.length;
while (i >= 0) {
explosions[i]._x = explosions[i]._x + exX[i];
explosions[i]._y = explosions[i]._y + exY[i];
exX[i] = exX[i] * 0.95;
exY[i] = exY[i] * 0.95;
explosions[i]._alpha = explosions[i]._alpha - 5;
if (explosions[i]._alpha <= 0) {
explosions[i].removeMovieClip();
explosions.splice(i, 1);
exX.splice(i, 1);
exY.splice(i, 1);
}
i--;
}
}
function shaker() {
if (shake == 0) {
_root._x = 0;
_root._y = 0;
} else if (shake == 1) {
shake = shake + 1;
_root._x = _root._x + 3;
_root._y = _root._y + 3;
} else if (shake == 2) {
shake = shake + 1;
_root._y = _root._y - 5;
_root._x = _root._x - 5;
} else if (shake == 3) {
shake = 0;
_root._x = _root._x + 2;
_root._y = _root._y + 2;
}
}
function drawCircle(target_mc, radius, fillColor, fillAlpha) {
var x = radius;
var y = radius;
with (target_mc) {
beginFill(fillColor, fillAlpha);
moveTo(x + radius, y);
curveTo(radius + x, (0.414213562373095 * radius) + y, (0.707106781186547 * radius) + x, (0.707106781186547 * radius) + y);
curveTo((0.414213562373095 * radius) + x, radius + y, x, radius + y);
curveTo((-0.414213562373095 * radius) + x, radius + y, (-0.707106781186547 * radius) + x, (0.707106781186547 * radius) + y);
curveTo((-radius) + x, (0.414213562373095 * radius) + y, (-radius) + x, y);
curveTo((-radius) + x, (-0.414213562373095 * radius) + y, (-0.707106781186547 * radius) + x, (-0.707106781186547 * radius) + y);
curveTo((-0.414213562373095 * radius) + x, (-radius) + y, x, (-radius) + y);
curveTo((0.414213562373095 * radius) + x, (-radius) + y, (0.707106781186547 * radius) + x, (-0.707106781186547 * radius) + y);
curveTo(radius + x, (-0.414213562373095 * radius) + y, radius + x, y);
endFill();
}
}
moneyC = 0;
achievementAllowed = 1;
if (lSize == 0) {
toNextLevel._alpha = 0;
nw._alpha = 0;
textHolder.wavetxt = "";
textHolder.waves._alpha = 0;
textHolder.monies._alpha = 0;
textHolder.moneytxt = "";
bas._alpha = 0;
}
var my_sound = new Sound();
my_sound.attachSound("153668_Rose_At_Nightfall");
my_sound.start(0, 100);
var banger = new Sound();
banger.attachSound("bang");
var ashot = new Sound();
ashot.attachSound("Arrow_sh-kayden_r-8961_hifi");
var gothit = new Sound();
gothit.attachSound("Knife_SL-Derka_De-8768_hifi");
var stab = new Sound();
stab.attachSound("Sword_Sl-Doogens-8722_hifi");
var coinCollect = new Sound();
coinCollect.attachSound("power_of-kayden_r-8978_hifi");
tt1._alpha = 0;
o1._alpha = 0;
v1._alpha = 0;
tt2._alpha = 0;
o2._alpha = 0;
v2._alpha = 0;
tt1.selectable = false;
tt2.selectable = false;
quiver = 1;
arrowUsed = 1;
makebigger.b1._alpha = 10;
makebigger.a1._alpha = 10;
speeded = new Array(0, 0, 0, 0, 0);
if (lSize == 0) {
speeded[0] = 3;
speeded[1] = 3;
speeded[2] = 3;
speeded[3] = 3;
speeded[4] = 3;
}
ownBow1 = 1;
ownBow2 = 0;
ownBow3 = 0;
ownBow4 = 0;
ownBow5 = 0;
gunAmmo1 = 9999999 /* 0x98967F */;
gunAmmo2 = 0;
gunAmmo3 = 0;
gunAmmo4 = 0;
gunAmmo5 = 0;
gunAmmo6 = 0;
skillLevel = 0;
speedLevel = 0;
healthLevel = 0;
armorLevel = 0;
bowEnchant1 = 0;
bowEnchant2 = 0;
bowEnchant3 = 0;
bowEnchant4 = 0;
bowEnchant5 = 0;
makebigger.w1 = "x" + ownBow1;
makebigger.w2 = "x" + ownBow2;
makebigger.w3 = "x" + ownBow3;
makebigger.w4 = "x" + ownBow4;
makebigger.w5 = "x" + ownBow5;
stale = 0;
shake = 0;
var dx = 0;
var dy = 0;
var dist = 0;
depth = 50000;
depth2 = 20000;
depth3 = 100;
initialX = 0;
initialY = 0;
score = 0;
ep = 1;
spent = 0;
gameWon = 0;
enemyEvolution = 0;
levelUp.gotoAndStop(50);
spike = new Array();
sdir = new Array();
topRotation = 0;
leFin = 105;
remove = 0;
shotCount = 1;
chance = 75;
Mouse.hide();
percent = 0;
enemiesOnStage = 0;
enemiesToKill = 40;
enchantPoints = 0;
upgradePoints = 0;
continues = 2;
enCome = 3;
money = 0;
level = 1;
lives = 10;
skillq = 0;
speedq = 0;
armorq = 0;
healthq = 0;
if (lSize != 0) {
textHolder.moneytxt = money;
}
ball1.swapDepths(400015);
headbar.swapDepths(400021);
textHolder.swapDepths(400022);
makebigger.swapDepths(401310);
award.swapDepths(402980);
Mouse.hide();
enemies = new Array();
enemyX = new Array();
enemyY = new Array();
enemyType = new Array();
spikes = new Array();
enemyHealth = new Array();
bullets = new Array();
bulletX = new Array();
bulletY = new Array();
enBullets = new Array();
enbx = new Array();
enby = new Array();
enemyAmount = 3;
enemyKillCount = 0;
gamepause = false;
gameover = false;
if (sObject.data.second > 0) {
seconds = sObject.data.second;
giveAward(50);
}
timer = setInterval(upTime, 1000);
mDownSeconds = 0;
staleSeconds = 0;
secondsThisGame = 0;
seconds2 = 0;
minutes2 = 0;
hours2 = 0;
enemyStart = 200;
changeArmor(armorEquip);
award.aname.awardName = awards[0];
award.gotoAndStop(1);
awardqueue = new Array();
untouched = true;
if (awardsTotal >= 10) {
giveAward(41);
}
if (awardsTotal >= 20) {
giveAward(42);
}
if (awardsTotal >= 30) {
giveAward(43);
}
if (awardsTotal >= 40) {
giveAward(44);
}
if (awardsTotal >= 50) {
giveAward(45);
}
if (awardsTotal >= 60) {
giveAward(46);
}
if (awardsTotal >= 70) {
giveAward(47);
}
if (awardsTotal >= 80) {
giveAward(48);
}
if (awardsTotal >= 90) {
giveAward(49);
}
if (awardsTotal >= 99) {
giveAward(100);
}
if (kills >= 3000) {
giveAward(4);
}
if (kills >= 1000) {
giveAward(3);
}
if (kills >= 300) {
giveAward(2);
}
if (kills >= 100) {
giveAward(1);
}
if ((!_root.test) or (_root.test.length < 1)) {
_root.test = new Array();
tmp = com.Newgrounds.NewgroundsAPI.getMedals();
for (i in tmp) {
_root.test[i] = tmp[i];
}
}
qbtn.onPress = function () {
if (_quality == "HIGH") {
_quality = "MEDIUM";
} else if (_quality == "LOW") {
_quality = "HIGH";
} else if (_quality == "MEDIUM") {
_quality = "LOW";
}
};
makebigger.a1.onPress = function () {
if (gunAmmo1 > 0) {
arrowInvis();
makebigger.a1._alpha = 10;
arrowUsed = 1;
}
};
makebigger.a2.onPress = function () {
if (gunAmmo2 > 0) {
arrowInvis();
makebigger.a2._alpha = 10;
arrowUsed = 2;
}
};
makebigger.a3.onPress = function () {
if (gunAmmo3 > 0) {
arrowInvis();
makebigger.a3._alpha = 10;
arrowUsed = 3;
}
};
makebigger.a4.onPress = function () {
if (gunAmmo5 > 0) {
arrowInvis();
makebigger.a4._alpha = 10;
arrowUsed = 5;
}
};
makebigger.a5.onPress = function () {
if (gunAmmo4 > 0) {
arrowInvis();
makebigger.a5._alpha = 10;
arrowUsed = 4;
}
};
makebigger.a6.onPress = function () {
if (gunAmmo6 > 0) {
arrowInvis();
makebigger.a6._alpha = 10;
arrowUsed = 6;
}
};
makebigger.b1.onPress = function () {
if (ownBow1 > 0) {
ball1.o.bow.gotoAndStop(1);
quiver = 1;
shotCount = 1;
bowInvis();
makebigger.b1._alpha = 10;
}
};
makebigger.b2.onPress = function () {
if (ownBow2 > 0) {
ball1.o.bow.gotoAndStop(2);
quiver = 2;
shotCount = 1;
bowInvis();
makebigger.b2._alpha = 10;
}
};
makebigger.b3.onPress = function () {
if (ownBow3 > 0) {
ball1.o.bow.gotoAndStop(3);
quiver = 3;
shotCount = 2;
bowInvis();
makebigger.b3._alpha = 10;
}
};
makebigger.b4.onPress = function () {
if (ownBow4 > 0) {
ball1.o.bow.gotoAndStop(4);
quiver = 4;
shotCount = 2;
bowInvis();
makebigger.b4._alpha = 10;
}
};
makebigger.b5.onPress = function () {
if (ownBow5 > 0) {
ball1.o.bow.gotoAndStop(5);
quiver = 5;
shotCount = 3;
bowInvis();
makebigger.b5._alpha = 10;
}
};
keyListener = new Object();
keyListener.onKeyDown = function () {
num = Key.getAscii();
if (num == 49) {
if (ownBow1 > 0) {
ball1.o.bow.gotoAndStop(1);
quiver = 1;
shotCount = 1;
bowInvis();
makebigger.b1._alpha = 10;
}
}
if (num == 50) {
if (ownBow2 > 0) {
ball1.o.bow.gotoAndStop(2);
quiver = 2;
shotCount = 1;
bowInvis();
makebigger.b2._alpha = 10;
}
}
if (num == 51) {
if (ownBow3 > 0) {
ball1.o.bow.gotoAndStop(3);
quiver = 3;
shotCount = 2;
bowInvis();
makebigger.b3._alpha = 10;
}
}
if (num == 52) {
if (ownBow4 > 0) {
ball1.o.bow.gotoAndStop(4);
quiver = 4;
shotCount = 2;
bowInvis();
makebigger.b4._alpha = 10;
}
}
if (num == 53) {
if (ownBow5 > 0) {
ball1.o.bow.gotoAndStop(5);
quiver = 5;
shotCount = 3;
bowInvis();
makebigger.b5._alpha = 10;
}
}
if (((num == 112) && (!gamepause)) && (!gameover)) {
gamepause = true;
attachMovie("paused2", "paused2", 1000122);
paused2.btm.onPress = function () {
gameover = true;
paused2.removeMovieClip();
continues = 0;
realGO = 1;
};
paused2.btm.onRollOver = function () {
paused2.btm.gotoAndStop(2);
};
paused2.btm.onRollOut = function () {
paused2.btm.gotoAndStop(1);
};
paused2.rg.onRollOver = function () {
paused2.rg.gotoAndStop(2);
};
paused2.rg.onRollOut = function () {
paused2.rg.gotoAndStop(1);
};
paused2.rg.onPress = function () {
gamepause = false;
paused2.removeMovieClip();
};
paused2._x = Stage.width / 2;
paused2._y = (Stage.height / 2) - 20;
} else if ((((num == 112) && (gamepause)) && (!gameover)) && (!menuExist)) {
gamepause = false;
paused2.removeMovieClip();
}
if (((num == 32) && (!gamepause)) && (!gameover)) {
gamepause = true;
attachMovie("paused2", "paused2", 1000122);
paused2.btm.onPress = function () {
gameover = true;
paused2.removeMovieClip();
continues = 0;
realGO = 1;
};
paused2.btm.onRollOver = function () {
paused2.btm.gotoAndStop(2);
};
paused2.btm.onRollOut = function () {
paused2.btm.gotoAndStop(1);
};
paused2.rg.onRollOver = function () {
paused2.rg.gotoAndStop(2);
};
paused2.rg.onRollOut = function () {
paused2.rg.gotoAndStop(1);
};
paused2.rg.onPress = function () {
gamepause = false;
paused2.removeMovieClip();
};
paused2._x = Stage.width / 2;
paused2._y = (Stage.height / 2) - 20;
} else if ((((num == 32) && (gamepause)) && (!gameover)) && (!menuExist)) {
gamepause = false;
paused2.removeMovieClip();
}
if (num == 109) {
if (music_frame == 1) {
music.gotoAndStop(2);
music_frame = 2;
my_sound.stop();
} else if (music_frame == 2) {
music.gotoAndStop(1);
music_frame = 1;
my_sound.start(0, 9999);
}
}
};
if (music_frame == 1) {
music.gotoAndStop(2);
music_frame = 2;
my_sound.stop();
} else if (music_frame == 2) {
music.gotoAndStop(1);
music_frame = 1;
my_sound.start(0, 9999);
}
music.onPress = function () {
if (music_frame == 1) {
music.gotoAndStop(2);
music_frame = 2;
} else if (music_frame == 2) {
music.gotoAndStop(1);
music_frame = 1;
}
if (music_frame == 1) {
my_sound.start(0, 9999);
}
if (music_frame == 2) {
my_sound.stop();
}
};
Key.addListener(keyListener);
damage = 1;
doit = false;
trueOnStage = 0;
mouseDownTime = 0;
mouseIsDown = 0;
onMouseDown = function () {
if (_ymouse < (Stage.height - 30)) {
Mouse.hide();
mouseIsDown = 1;
}
};
onMouseUp = function () {
mouseIsDown = 0;
};
delayTime = 15;
makebigger.q1 = "x" + gunAmmo1;
makebigger.q2 = "x" + gunAmmo2;
makebigger.q3 = "x" + gunAmmo3;
makebigger.q4 = "x" + gunAmmo5;
makebigger.q5 = "x" + gunAmmo4;
makebigger.q6 = "x" + gunAmmo6;
arrowPicked = "";
ammo = 0;
textHolder.arrowstxt = ammo;
textHolder.killstxt = enemyKillCount;
tKiller = 0;
bulletMissed = 0;
dtn = 0;
stn = 0;
coins = new Array();
coinTimer = new Array();
coinWorth = new Array();
startShrink = 0;
textHolder.enemiestxt = enemiesLeft;
textHolder.scoretxt = score;
textHolder.livestxt = lives;
textHolder.eptxt = ep;
if (lSize != 0) {
textHolder.wavetxt = level + "/25";
}
attachMovie("aimer", "aimer", 1000949);
aimer._alpha = 0;
velocityX = 0;
velocityY = 0;
acceleration = 1.7;
friction = 0.55;
menuExist = false;
gaOn = 0;
inver = 0;
rapid = 0;
realGO = 0;
if (lSize == 0) {
continues = 0;
}
timere = 0;
selector = 0;
otherSelector = 0;
bBig = 1;
onView = 0;
explosions = new Array();
exX = new Array();
exY = new Array();
explosions2 = new Array();
exX2 = new Array();
exY2 = new Array();
howFast = new Array();
Frame 5
function newHover(movie) {
movie.onRollOver = function () {
movie._alpha = 10;
};
movie.onReleaseOutside = function () {
movie._alpha = 0;
};
movie.onRollOut = function () {
movie._alpha = 0;
};
}
function __rankz_send__(par1, par2, par3, par4) {
par227 = new LoadVars();
par228 = new LoadVars();
par227.flashkey = par2;
par227.SU0249 = par1;
par227.bmFtZTE = Armor_Bot_30_En_AS1.Encode(par3);
par227.c2NvcmUx = Armor_Bot_30_En_AS1.Encode(par4 + "j%e%a%n%s");
par227.flashkey = par227.flashkey.split("=").join("");
par227.SU0249 = par227.SU0249.split("=").join("");
par228.onLoad = function (success) {
if (success) {
trace(par228.msg);
} else {
trace(par228.loaded);
}
};
par227.sendAndLoad("http://rankz.armorbot.com/submit/", par228, "POST");
}
function onEnterFrame() {
var _local2 = _xmouse - aim._x;
var _local1 = _ymouse - aim._y;
aim._x = aim._x + (_local2 / 2);
aim._y = aim._y + (_local1 / 2);
awardWait();
}
scoreMovie.scoretext = score;
_root.kongregateScores.submit(score);
_root.kongregateStats.submit("Kills", kills);
if ((lSize == 0) && (achievementAllowed == 1)) {
if (score >= 5000) {
giveAward(93);
}
}
headbar.removeMovieClip();
textHolder.removeMovieClip();
award.gotoAndStop(1);
clearInterval(timer);
clearInterval(timers);
scoreMovie._x = Stage.width / 2;
my_sound.stop();
newHover(mg);
newHover(ss);
newHover(re);
newHover(me);
if ((score > personalHighScore) && (achievementAllowed == 1)) {
personalHighScore = score;
sObject.data.phs = personalHighScore;
sObject.flush();
} else {
npb._alpha = 0;
}
if ((level == 1) && (achievementAllowed == 1)) {
giveAward(74);
}
namer = "No Name";
Selection.setFocus("namer");
ss.onRelease = function () {
bXlnYW1lX25hbWVfdmFyaWFibGU = namer;
bXlnYW1lX3Njb3JlX3ZhcmlhYmxl = score;
if (achievementAllowed == 1) {
__rankz_send__("MzUxNGolZSVhJW4lcw==", "SXpWRFRiR3o=", bXlnYW1lX25hbWVfdmFyaWFibGU, bXlnYW1lX3Njb3JlX3ZhcmlhYmxl);
getURL ("http://rankz.armorbot.com/Medieval_Rampage/", "_blank");
bXlnYW1lX3Njb3JlX3ZhcmlhYmxl = 0;
}
};
me.onRelease = function () {
if (awardqueue.length == 0) {
gotoAndStop (3);
}
};
re.onRelease = function () {
Mouse.hide();
if (awardqueue.length == 0) {
gotoAndStop (4);
}
};
mg.onRelease = function () {
getURL ("http://www.armorgames.com/", "_blank");
};
Key.removeListener(keyListener);
gameover = false;
gamepause = false;
if (gameWon) {
didwin.gotoAndStop(2);
_root.kongregateStats.submit("GameComplete", 1);
gc.gotoAndStop(2);
if (achievementAllowed == 1) {
if (armorEquip == 2) {
giveAward(92);
}
if (armorEquip == 3) {
giveAward(96);
}
if (armorEquip == 4) {
giveAward(97);
}
if (armorEquip == 5) {
giveAward(98);
}
if (armorEquip == 6) {
giveAward(99);
}
if (bBig == 1) {
giveAward(91);
}
giveAward(5);
if (untouched) {
}
}
} else {
if (achievementAllowed == 1) {
giveAward(80);
}
gc.gotoAndStop(1);
}
badges = 0;
badgeCounter(groupArray1);
badgeCounter(groupArray2);
badgeCounter(groupArray3);
badgeCounter(groupArray4);
badgeCounter(groupArray5);
badgeCounter(groupArray6);
badgeCounter(groupArray7);
badges = 0;
sObject.data.kill = kills;
sObject.flush();
sObject.data.second = seconds;
sObject.flush();
sObject.data.minute = minutes;
sObject.flush();
sObject.data.hour = hours;
sObject.flush();
_root.gamename = "Cell Warfare";
Frame 6
createHover(btm);
btm.onRelease = function () {
gotoAndStop (3);
};
sg.onPress = function () {
getURL ("http://armorgames.com/guide/Medieval-Rampage-Guide", "_blank");
};
sg.onRollOver = function () {
sg.gotoAndStop(2);
};
sg.onRollOut = function () {
sg.gotoAndStop(1);
};
nex.onRollOver = function () {
nex._alpha = 10;
};
nex.onRollOut = function () {
nex._alpha = 0;
};
bac.onRollOver = function () {
bac._alpha = 10;
};
bac.onRollOut = function () {
bac._alpha = 0;
};
nex.onPress = function () {
zx.gotoAndStop(2);
};
bac.onPress = function () {
zx.gotoAndStop(1);
};
mbtn.onRollOut = function () {
mbtn._alpha = 0;
};
mbtn.onReleaseOutside = function () {
mbtn._alpha = 0;
};
mbtn.onRollOver = function () {
mbtn._alpha = 10;
};
mbtn.onRelease = function () {
gotoAndStop (3);
};
Frame 7
function hoved(mc, num) {
mc.onRollOver = function () {
if (overOn == 0) {
desc = descros[startNum + num];
}
if (mc._alpha <= 15) {
mc._alpha = 10;
}
};
mc.onRollOut = function () {
if (mc._alpha <= 15) {
mc._alpha = 0;
}
};
mc.onReleaseOutside = function () {
if (mc._alpha <= 15) {
mc._alpha = 0;
}
};
mc.onPress = function () {
if (mc._alpha >= 15) {
mc._alpha = 10;
overOn = 0;
} else {
notOver();
overOn = 1;
mc._alpha = 20;
desc = descros[startNum + num];
}
};
}
function populate() {
p1 = awards[startNum];
c1._alpha = 0;
if (awardsRecieved[startNum] == 1) {
c1._alpha = 100;
}
p2 = awards[startNum + 1];
c2._alpha = 0;
if (awardsRecieved[startNum + 1] == 1) {
c2._alpha = 100;
}
p3 = awards[startNum + 2];
c3._alpha = 0;
if (awardsRecieved[startNum + 2] == 1) {
c3._alpha = 100;
}
p4 = awards[startNum + 3];
c4._alpha = 0;
if (awardsRecieved[startNum + 3] == 1) {
c4._alpha = 100;
}
p5 = awards[startNum + 4];
c5._alpha = 0;
if (awardsRecieved[startNum + 4] == 1) {
c5._alpha = 100;
}
p6 = awards[startNum + 5];
c6._alpha = 0;
if (awardsRecieved[startNum + 5] == 1) {
c6._alpha = 100;
}
p7 = awards[startNum + 6];
c7._alpha = 0;
if (awardsRecieved[startNum + 6] == 1) {
c7._alpha = 100;
}
p8 = awards[startNum + 7];
c8._alpha = 0;
if (awardsRecieved[startNum + 7] == 1) {
c8._alpha = 100;
}
p9 = awards[startNum + 8];
c9._alpha = 0;
if (awardsRecieved[startNum + 8] == 1) {
c9._alpha = 100;
}
p10 = awards[startNum + 9];
c10._alpha = 0;
if (awardsRecieved[startNum + 9] == 1) {
c10._alpha = 100;
}
}
function badgeAlphas(array1, array2) {
var _local5 = array1.length;
var _local2 = 0;
var _local4 = 0;
b = array1.length;
while (b >= 0) {
if (awardsRecieved[array1[b]] == 1) {
_local2 = _local2 + 1;
}
b--;
}
_local4 = (_local2 / _local5) * 100;
if (_local4 >= 25) {
array2[0]._alpha = 100;
oldBadges = oldBadges + 1;
} else {
blah = new Color(array2[0]);
blah.setRGB(0);
}
if (_local4 >= 50) {
array2[1]._alpha = 100;
oldBadges = oldBadges + 1;
} else {
blah = new Color(array2[1]);
blah.setRGB(0);
}
if (_local4 >= 75) {
array2[2]._alpha = 100;
oldBadges = oldBadges + 1;
} else {
blah = new Color(array2[2]);
blah.setRGB(0);
}
if (_local4 >= 100) {
array2[3]._alpha = 100;
oldBadges = oldBadges + 1;
} else {
blah = new Color(array2[3]);
blah.setRGB(0);
}
}
function bMake(item, frame) {
item.onRollOver = function () {
item._alpha = 30;
};
item.onRollOut = function () {
item._alpha = 10;
};
item.onReleaseOutside = function () {
item._alpha = 10;
};
item.onRelease = function () {
gotoAndStop(frame);
};
}
function bMakeArmor(movie) {
movie.onRollOver = function () {
if (movie._alpha <= 7) {
movie._alpha = 5;
}
};
movie.onPress = function () {
trace(awardsTotal);
if (movie._alpha >= 7) {
movie._alpha = 5;
armorEquip = 1;
sObject.data.ae = armorEquip;
sObject.flush();
} else {
trace(a1._alpha);
trace(a2._alpha);
trace(a3._alpha);
if (((a1._alpha >= 3) && (awardsTotal >= 20)) && (a1._alpha <= 7)) {
desc = "This armor will give you 25% more gold for every pile you pick up.";
armorEquip = 2;
sObject.data.ae = armorEquip;
sObject.flush();
a1._alpha = 0;
a2._alpha = 0;
a3._alpha = 0;
a4._alpha = 0;
a5._alpha = 0;
movie._alpha = 10;
}
if (((a2._alpha >= 3) && (awardsTotal >= 40)) && (a2._alpha <= 7)) {
desc = "This armor gives you slow health regeneration.";
armorEquip = 3;
sObject.data.ae = armorEquip;
sObject.flush();
a1._alpha = 0;
a2._alpha = 0;
a3._alpha = 0;
a4._alpha = 0;
a5._alpha = 0;
movie._alpha = 10;
}
if (((a3._alpha >= 3) && (awardsTotal >= 60)) && (a3._alpha <= 7)) {
desc = "This armor will make your arrows deal more damage than normal.";
armorEquip = 4;
sObject.data.ae = armorEquip;
sObject.flush();
a1._alpha = 0;
a2._alpha = 0;
a3._alpha = 0;
a4._alpha = 0;
a5._alpha = 0;
movie._alpha = 10;
}
if (((a4._alpha >= 3) && (awardsTotal >= 80)) && (a4._alpha <= 7)) {
desc = "This armor makes bow drops twice as common.";
armorEquip = 5;
sObject.data.ae = armorEquip;
sObject.flush();
a1._alpha = 0;
a2._alpha = 0;
a3._alpha = 0;
a4._alpha = 0;
a5._alpha = 0;
movie._alpha = 10;
}
if (((a5._alpha >= 3) && (awardsTotal >= 90)) && (a5._alpha <= 7)) {
desc = "This armor has all of the previous armor effects combined into one.";
armorEquip = 6;
sObject.data.ae = armorEquip;
sObject.flush();
a1._alpha = 0;
a2._alpha = 0;
a3._alpha = 0;
a4._alpha = 0;
a5._alpha = 0;
movie._alpha = 10;
}
}
};
movie.onRollOut = function () {
if (movie._alpha <= 7) {
movie._alpha = 0;
}
};
}
descros = new Array("Kill 100 Enemies", "Kill 300 Enemies", "Kill 1000 Enemies", "Kill 3000 Enemies", "Complete Campaign", "Play for 5 Minutes", "Play for 15 Minutes", "Play for 30 Minutes", "Play for 60 Minutes", "Play for 120 Minutes", "Kill 20 Enemies in Survival", "Kill 50 Enemies in Survival", "Kill 100 Enemies in Survival", "Kill 200 Enemies in Survival", "Kill 300 Enemies in Survival", "Buy Light Arrows", "Buy Heavy Arrows", "Buy Fire Arrows", "Buy Ice Arrows", "Buy Electric Arrows", "Buy a Long Bow", "Buy a Composite Bow", "Buy a Cross Bow", "Buy a Compound Bow", "Score 100 in a game", "Score 500 in a game", "Score 1000 in a game", "Score 2000 in a game", "Score 5000 in a game", "Score 10000 in a game", "Fully Upgraded Skill Level During a Game", "Fully Upgraded Armor Level During a Game", "Fully Upgraded Health Level During a Game", "Fully Upgraded Speed Level During a Game", "Fully Enchanted Short Bow", "Fully Enchanted Long Bow", "Fully Enchanted Composite Bow", "Fully Enchanted Cross Bow", "Fully Enchanted Compound Bow", "In Survival Mode - All bows Collected", "Unlocked Cheat 1 - Obtain 10 Achievements", "Unlocked Cheat 2 - Obtain 20 Achievements", "Unlocked Cheat 3 - Obtain 30 Achievements", "Unlocked Cheat 4 - Obtain 40 Achievements", "Unlocked Cheat 5 - Obtain 50 Achievements", "Unlocked Cheat 6 - Obtain 60 Achievements", "Unlocked Cheat 7 - Obtain 70 Achievements", "Unlocked Cheat 8 - Obtain 80 Achievements", "Unlocked Cheat 9 - Obtain 90 Achievements", "Load the game twice", "Short Bow Drop From an Enemy", "Long Bow Drop From an Enemy", "Composite Bow Drop From an Enemy", "Cross Bow Drop From an Enemy", "Compound Bow Drop From an Enemy", "Defeat Vandoru", "Defeat Korthag", "Defeat Shocknor", "Defeat Azgorg", "Defeat Kagoru", "Kill a Kordul", "Kill a Sathir", "Kill a Ortug", "Kill a Atugor", "Kill a Dronder", "Kill a Tungurd", "Kill a Cazgur", "Kill a Uroth", "Kill a Fazgor", "Kill a Farodun", "Don't shoot for 20 seconds", "Touch the outside of the stage.", "Don't move for 10 seconds", "Kill yourself on the first wave", "Collect Light Arrows in Survival Mode", "Buy a health upgrade in the shop", "Purchase 1000 Arrows", "Sell Your Initial Weapon - Shortbow", "All Money Collected - In a single wave", "Die", "Spend 101 Gold", "Spend 500 Gold", "Spend 1000 Gold", "Spend 2000 Gold", "Spend 5000 Gold", "Spend 10000 Gold", "Collect Heavy Arrows in Survival Mode", "Collect Ice Arrows in Survival Mode", "Collect Fire Arrows in Survival Mode", "Collect Electric Arrows in Survival Mode", "Game Completed and don't buy any bows", "Game Complete with level 2 armor", "Score 5,000 in Survival Mode", "Wave 1 Complete while being untouched", "Wave Completed with 100% bow accuracy", "Game Complete with level 3 armor", "Game Complete with level 4 armor", "Game Complete with level 5 armor", "Game Complete with level 6 armor", "Get every other achievement!");
createHover(btm);
desc = "Select an achievement";
startNum = 0;
movieClips = new Array(p1, p2, p3, p4, p5, p6, p7, p8, p9, p10);
populate();
hoved(z1, 0);
hoved(z2, 1);
hoved(z3, 2);
hoved(z4, 3);
hoved(z5, 4);
hoved(z6, 5);
hoved(z7, 6);
hoved(z8, 7);
hoved(z9, 8);
hoved(z10, 9);
overOn = 0;
notOver = function () {
z1._alpha = 0;
z2._alpha = 0;
z3._alpha = 0;
z4._alpha = 0;
z5._alpha = 0;
z6._alpha = 0;
z7._alpha = 0;
z8._alpha = 0;
z9._alpha = 0;
z10._alpha = 0;
};
nexta.onPress = function () {
startNum = startNum + 10;
if (startNum >= 100) {
startNum = startNum - 100;
}
overOn = 0;
notOver();
populate();
};
back.onPress = function () {
startNum = startNum - 10;
if (startNum < 0) {
startNum = startNum + 100;
}
overOn = 0;
notOver();
populate();
};
btm.onRelease = function () {
gotoAndStop (3);
};
mbtn.onRollOut = function () {
mbtn._alpha = 0;
};
mbtn.onReleaseOutside = function () {
mbtn._alpha = 0;
};
mbtn.onRollOver = function () {
mbtn._alpha = 10;
};
mbtn.onRelease = function () {
gotoAndStop (3);
};
nexta.onRollOver = function () {
nexta._alpha = 20;
};
nexta.onRollOut = function () {
nexta._alpha = 0;
};
nexta.onReleaseOutside = function () {
nexta._alpha = 0;
};
back.onRollOver = function () {
back._alpha = 20;
};
back.onRollOut = function () {
back._alpha = 0;
};
back.onReleaseOutside = function () {
back._alpha = 0;
};
oldBadges = 0;
bMake(g1, 8);
bMake(g2, 9);
bMake(g3, 10);
bMake(g4, 11);
bMake(g5, 12);
bMake(g6, 13);
bMake(g7, 14);
hText = hours;
mText = minutes;
sText = seconds;
killos = kills;
if (armorEquip == 2) {
a1._alpha = 10;
}
if (armorEquip == 3) {
a2._alpha = 10;
}
if (armorEquip == 4) {
a3._alpha = 10;
}
if (armorEquip == 5) {
a4._alpha = 10;
}
if (armorEquip == 6) {
a5._alpha = 10;
}
bMakeArmor(a1);
bMakeArmor(a2);
bMakeArmor(a3);
bMakeArmor(a4);
bMakeArmor(a5);
Frame 8
function hoverEffect(movie, number) {
number = number + 1;
movie.onRollOut = function () {
if (isSelect != number) {
movie._alpha = 0;
}
};
movie.onReleaseOutside = function () {
movie._alpha = 0;
};
movie.onRollOver = function () {
if (isSelect != number) {
movie._alpha = 10;
}
if (isSelect == 0) {
choice.gotoAndStop(number);
desc = descriptions[number - 1];
nm = names[number - 1];
}
};
movie.onPress = function () {
if (isSelect == number) {
isSelect = 0;
} else {
vanish();
isSelect = number;
movie._alpha = 20;
choice.gotoAndStop(number);
desc = descriptions[number - 1];
nm = names[number - 1];
}
};
}
function vanish() {
b1._alpha = 0;
b2._alpha = 0;
b3._alpha = 0;
b4._alpha = 0;
b5._alpha = 0;
b6._alpha = 0;
b7._alpha = 0;
b8._alpha = 0;
b9._alpha = 0;
b10._alpha = 0;
b11._alpha = 0;
b12._alpha = 0;
b13._alpha = 0;
b14._alpha = 0;
b15._alpha = 0;
}
desc1 = "In the dark netherworld that is Shocknor's lair Kordul emerged as one of the strongest creatures in this hell he masterfully wields double axes and terrorizes intruders to Shocknor's realm his power is unrivaled and his tenacity unmatched those who dare challenge him never live to challenge another foe again";
desc2 = "The realms swiftest runner, Sathir\u2019s combination of speed and strength is lethal. His spear strikes with flawless precision, yet some think he is cowardly and runs like a chicken, but little do they know, as chickens have sharp talons, this deadly fighter has a fatal spear thrust.";
desc3 = "A skilled swordfight, Ortug is peerless in physical combat. He relentlessly slashes his sword , cutting through his enemies as if they were butter, while effortlessly blocking their attacks with his impenetrable shield, forged in the very fires of Hell. One who sees Ortug would do best to flee, though by that time, it is already too late.";
desc4 = "Endowed with health regeneration, and air controlling abilities, Atugor terrorizes his enemies from afar, while infuriating his enemies by healing any wounds that may be inflicted upon him. At first glance, Atugor appears weaponless, causing them to lower their guard, but after they have made this mortal error, he rips hits the air in front of him with a frightening punch, causing his enemies to be ripped to pieces from the vicious whirlwind that results. None are safe from his terror. None can hide from his wrath for he is Atugor.";
desc5 = "Now you see him. Now you don\u2019t. Where did he go? Wsshh. You\u2019re dead. Enemies of Dronder cannot even say the words, \u201COh no! It\u2019s Dronder!\u201D before they are mercilessly sliced in half by his bloodthirsty blade. Those few heroes who attempt to survive his initial assault rarely do any better than their fallen companions, for Dronder has perfected his armor to the point that none but the strongest can harm him. How is he so powerful? Because he is Dronder. Wsshh. You\u2019re dead.";
desc6 = "No but one of the strongest lords, Korthag, can claim to rule Tungurd, for he is the fiercest fighter to walk the realm of The Forsaken Pass. You\u2019ll think he\u2019s strong from a distance, just wait till you get up close and personal, then WHAM, Tungurd\u2019s most devastating attack, an all out charge that makes even the most brave heroes cry mommy, will leave you in pieces on the floor. His battle cry is terrifying, his mace, even worse.";
desc7 = "He wields a two handed claymore that leaves no one wanting more. He\u2019ll cleave you in two up close, or from a distance, it doesn\u2019t matter how you die, but it is a certainty that you will when facing this master of disaster, this king of mean. His sword seems too large for anyone to wield, yet Cazgur is not anyone. He is\u2026CAZGUR . Granted the ability to wield air as a weapon by Azgorg, Cazgur is as fiercome as they come, and more. Trust me, don\u2019t mess with Cazgur you\u2019ll live to regret it. Actually you won\u2019t live to regret it. On third thought, you just won\u2019t live. Period.";
desc8 = "He may appear to be a pushover at first, with light armor(granted it does have a lotof spikes), only a mace for a weapon, and red spikes on his head that make him look like a chicken, Uroth might not seem like the most frightening enemy but as they say, don\u2019t judge a Uroth by its cover. To the dismay of many would be heroes, Uroth foils knights and warriors\u2019 attempts to gain fame by dodging their attacks with ease, then striking back like a venomous snake. Uroth has no master, for his skill is without equal, and his fury cannot be contained.";
desc9 = "An agent of destruction, Fazgor wields two swords that leave his enemies in a world of pain, but that only leave him laughing. He has no conscience, for an ultimate warrior cannot cry over the constant deaths of battle, but can only think of one thing: victory. As a result of this singleminded focus that Fazgor possesses, he was long ago able to perfect his fighting technique to the highest level, enabling him to move with only a thought, or as some would say, teleport. His swords wiz through the air in an unstoppable and neverending onslaught that is seemingly impossible to face. None can take his might, the might of Fazgor, a.k.a. an unstoppable force that you hope you will never face.";
desc10 = "One of the most powerful enemies in The Forsaken Pass, Farodun wields a spear in one hand and a shield in the other, yet his power transcends physical weapons. As a minion of a minion, this servant of Vandoru can himself summon crony\u2019s to aid him in battle, the brutal Atugors. With this ability, Farodun has been able to slay warriors at will, never knowing defeat. With such power at his disposal, what is next for Farodun? Stay tuned to find out\u2026mwahahahahahaha!";
desc11 = "Shocknor-Ruler of speed, master of the ranged attack, Shocknor is first among the five fiercest beasts in The Forsaken Pass. He controls the air more masterfully and skillfully than any before him. His sheer power amazes his foes. His masterful speed is unparalleled. Those who dare challenge him are torn to pieces amid the unmatched power of his whirlwinds.";
desc12 = "Kagoru-Perhaps the most formidable foe ever to be faced, Kagoru is the second of the five beasts that terrorize The Forsaken Pass. His hammer is twice the size of an average hero and rocks the very earth when he strikes the ground. Those who challenge him are ground to dust in the face of his overwhelming strength. Any attempt to harm is in vain, for his life energy has grown with each battle and none can equal it. The mighty Atugor serves him, yet can never hope to compare with Kagoru\u2019s power. His life is eternal, his supremacy unequaled.";
desc13 = "Korthag-He wields no weapon, for his is himself, the ultimate agent of death. His hands are the sharpest blades in all the land and cut through any obstacle with ease. Korthag is the third of the five inimitable beasts of The Forsaken Pass. As sharp as his hands, are the winds of his cyclones that shred those who stand against him. As perhaps the strongest beast to ever exist, Korthag does not abide by the laws of physics, but rather, only follows his own laws, teleporting around his enemies, waiting for the perfect moment to end their misery. Tungurd serves him with the utmost loyalty, as the rest of the world is bound to do once they have witnessed his power. Stand before him and wonder in awe at his superiority, for he is better than you.";
desc14 = "Azgorg-His power is unrivaled, his speed, legendary; Azgorg, fourth of the five mythical beasts of The Forsaken Pass. Served by Cazgur, the daunting Azgorg terrorizes those who dare face him. He frustrates his enemies with his unmatched speed, while cleaving them in two with his razor-sharp swords. Those who flee are soon dead at the hands of his pitiless twisters. The arsenal of attacks at his disposal is terrifying, even more so when faced in the heat of battle, with no hope of escape.";
desc15 = "Vandoru-He destroys those in his way with his deadly scimitar. He vanishes amid the attacks of his foes, only to reappear behind them as they fall dead to the ground. Vandoru, last of the five all-powerful beasts of The Forsaken Pass, no warrior has ever matched his power. His servant, Farodun does well to serve him, for none can face withstand his might. Feel his colossal wrath, and run in terror!";
descriptions = new Array(desc3, desc2, desc1, desc10, desc8, desc9, desc7, desc6, desc5, desc4, desc15, desc13, desc11, desc14, desc12);
names = new Array("Ortug", "Sathir", "Kordul", "Farodun", "Uroth", "Fazgor", "Cazgur", "Tungurd", "Dronder", "Atugor", "Vandoru", "Korthag", "Shocknor", "Azgorg", "Kagoru");
desc = "Click on an enemy or a boss";
nm = "Name";
mbtn.onRollOut = function () {
mbtn._alpha = 0;
};
mbtn.onReleaseOutside = function () {
mbtn._alpha = 0;
};
mbtn.onRollOver = function () {
mbtn._alpha = 10;
};
mbtn.onRelease = function () {
gotoAndStop (3);
};
isSelect = 0;
buttoners = new Array(b1, b2, b3, b4, b5, b6, b7, b8, b9, b10, b11, b12, b13, b14, b15);
i = buttoners.length - 1;
while (i >= 0) {
hoverEffect(buttoners[i], i);
i--;
}
Frame 9
ap.onPress = function () {
getURL ("http://www.trevor80.deviantart.com/", "_blank");
};
arm.onPress = function () {
getURL ("http://www.armorgames.com/", "_blank");
};
nt.onPress = function () {
getURL ("http://nemesistheory.newgrounds.com/", "_blank");
};
mbtna.onRollOut = function () {
mbtna._alpha = 0;
};
mbtna.onReleaseOutside = function () {
mbtna._alpha = 0;
};
mbtna.onRollOver = function () {
mbtna._alpha = 10;
};
mbtna.onRelease = function () {
gotoAndStop (3);
};
Symbol 27 MovieClip Frame 1
stop();
Symbol 40 MovieClip Frame 1
stop();
Symbol 61 MovieClip [spike2] Frame 1
stop();
Symbol 74 MovieClip Frame 1
stop();
Symbol 79 MovieClip [archer] Frame 1
stop();
Symbol 122 MovieClip [aim] Frame 1
stop();
Symbol 126 MovieClip [newEnemies] Frame 100
stop();
Symbol 131 MovieClip [newEnemies2] Frame 200
stop();
Symbol 141 MovieClip [redFlash] Frame 10
this.removeMovieClip();
Symbol 145 MovieClip Frame 1
stop();
Symbol 145 MovieClip Frame 10
_parent.removeMovieClip();
Symbol 148 MovieClip [orangedes] Frame 4
stop();
Symbol 152 MovieClip Frame 20
_parent.removeMovieClip();
Symbol 165 MovieClip [up1] Frame 100
stop();
Symbol 168 MovieClip [up2] Frame 100
stop();
Symbol 171 MovieClip [up3] Frame 100
stop();
Symbol 174 MovieClip [up4] Frame 100
stop();
Symbol 181 MovieClip [moreGames] Frame 35
stop();
Symbol 192 MovieClip [up5] Frame 100
stop();
Symbol 198 MovieClip [up6] Frame 100
stop();
Symbol 202 MovieClip [np1] Frame 100
stop();
Symbol 205 MovieClip [np2] Frame 100
stop();
Symbol 209 MovieClip [np3] Frame 100
stop();
Symbol 212 MovieClip [np4] Frame 100
stop();
Symbol 289 MovieClip [enemy7attack] Frame 37
_parent.gotoAndStop(1);
Symbol 299 MovieClip [music] Frame 1
stop();
Symbol 325 MovieClip Frame 1
stop();
Symbol 377 MovieClip [hat] Frame 1
stop();
Symbol 390 MovieClip Frame 1
stop();
Symbol 393 MovieClip Frame 1
stop();
Symbol 413 MovieClip Frame 1
stop();
Symbol 413 MovieClip Frame 10
_parent.removeMovieClip();
Symbol 416 MovieClip Frame 1
stop();
Symbol 416 MovieClip Frame 10
_parent.removeMovieClip();
Symbol 420 MovieClip Frame 1
stop();
Symbol 420 MovieClip Frame 10
_parent.removeMovieClip();
Symbol 421 MovieClip [enemy0] Frame 1
stop();
Symbol 442 Button
on (release) {
this._visible = false;
}
Symbol 451 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 2790 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 2791 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 2792 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 2793 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 2794 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 2795 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 2796 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 2797 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 464 Button
on (press) {
getURL ("http://www.armorgames.com", "_blank");
}
Symbol 467 MovieClip Frame 1
_root.stop();
gotoAndPlay (2);
Symbol 467 MovieClip Frame 218
_root.nextFrame();
Symbol 471 MovieClip Frame 1
stop();
Symbol 475 MovieClip Frame 1
stop();
Symbol 479 MovieClip Frame 1
stop();
Symbol 483 MovieClip Frame 1
stop();
Symbol 487 MovieClip Frame 1
stop();
Symbol 491 MovieClip Frame 1
stop();
Symbol 497 MovieClip Frame 1
stop();
Symbol 502 MovieClip Frame 1
stop();
Symbol 522 MovieClip Frame 1
stop();
Symbol 522 MovieClip Frame 1000
_root.gotoAndStop(4);
Symbol 546 MovieClip Frame 1
stop();
Symbol 631 MovieClip Frame 25
_parent.gotoAndStop(1);
Symbol 670 MovieClip Frame 20
_parent.removeMovieClip();
Symbol 671 MovieClip [boss2] Frame 1
stop();
Symbol 751 MovieClip Frame 26
_parent.gotoAndStop(1);
Symbol 790 MovieClip Frame 20
_parent.removeMovieClip();
Symbol 791 MovieClip [boss3] Frame 1
stop();
Symbol 809 MovieClip Frame 1
stop();
Symbol 821 MovieClip Frame 1
stop();
Symbol 833 MovieClip Frame 1
stop();
Symbol 839 MovieClip Frame 1
stop();
Symbol 844 MovieClip Frame 1
stop();
Symbol 846 MovieClip Frame 1
stop();
Symbol 886 MovieClip [newEnemies3] Frame 1
stop();
Symbol 924 MovieClip Frame 1
stop();
Symbol 952 MovieClip Frame 1
stop();
Symbol 954 MovieClip Frame 1
stop();
Symbol 980 MovieClip Frame 1
stop();
Symbol 990 MovieClip Frame 1
stop();
Symbol 1078 MovieClip Frame 25
_parent.gotoAndStop(1);
Symbol 1097 MovieClip Frame 17
_parent.removeMovieClip();
Symbol 1098 MovieClip [enemy8] Frame 1
stop();
Symbol 1110 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);
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 1110 MovieClip Frame 10
var myBitmapData = flash.display.BitmapData.loadBitmap(medal_name + ".gif");
medal_icon.attachBitmap(myBitmapData, 111);
stop();
Symbol 1136 MovieClip Frame 50
stop();
Symbol 1152 MovieClip Frame 151
gotoAndStop (1);
Symbol 1176 MovieClip Frame 350
stop();
Symbol 1277 MovieClip Frame 24
_parent.gotoAndStop(1);
Symbol 1296 MovieClip Frame 17
_parent.removeMovieClip();
Symbol 1298 MovieClip [enemy6] Frame 1
stop();
Symbol 1298 MovieClip [enemy6] Frame 4
stop();
Symbol 1382 MovieClip Frame 25
_parent.gotoAndStop(1);
Symbol 1401 MovieClip Frame 17
_parent.removeMovieClip();
Symbol 1402 MovieClip [enemy] Frame 1
stop();
Symbol 1489 MovieClip Frame 25
_parent.gotoAndStop(1);
Symbol 1528 MovieClip Frame 20
_parent.removeMovieClip();
Symbol 1529 MovieClip [enemy2] Frame 1
stop();
Symbol 1613 MovieClip Frame 25
_parent.gotoAndStop(1);
Symbol 1632 MovieClip Frame 17
_parent.removeMovieClip();
Symbol 1633 MovieClip [enemy3] Frame 1
stop();
Symbol 1717 MovieClip Frame 25
_parent.gotoAndStop(1);
Symbol 1736 MovieClip Frame 17
_parent.removeMovieClip();
Symbol 1737 MovieClip [enemy4] Frame 1
stop();
Symbol 1822 MovieClip Frame 24
_parent.gotoAndStop(1);
Symbol 1861 MovieClip Frame 20
_parent.removeMovieClip();
Symbol 1862 MovieClip [enemy5] Frame 1
stop();
Symbol 1932 MovieClip Frame 18
_parent.removeMovieClip();
Symbol 1933 MovieClip [enemy7] Frame 1
stop();
Symbol 2015 MovieClip Frame 25
_parent.gotoAndStop(1);
Symbol 2050 MovieClip Frame 18
_parent.removeMovieClip();
Symbol 2051 MovieClip [enemy9] Frame 1
stop();
Symbol 2167 MovieClip Frame 25
_parent.gotoAndStop(1);
Symbol 2206 MovieClip Frame 20
_parent.removeMovieClip();
Symbol 2207 MovieClip [enemy10] Frame 1
stop();
stop();
Symbol 2291 MovieClip Frame 28
_parent.gotoAndStop(1);
Symbol 2330 MovieClip Frame 20
_parent.removeMovieClip();
Symbol 2331 MovieClip [boss1] Frame 1
stop();
Symbol 2413 MovieClip Frame 27
_parent.gotoAndStop(1);
Symbol 2452 MovieClip Frame 20
_parent.removeMovieClip();
Symbol 2453 MovieClip [boss4] Frame 1
stop();
Symbol 2573 MovieClip Frame 46
_parent.gotoAndStop(1);
Symbol 2612 MovieClip Frame 20
_parent.removeMovieClip();
Symbol 2613 MovieClip [boss5] Frame 1
stop();
Symbol 2623 MovieClip Frame 1
stop();
Symbol 2659 MovieClip Frame 1
stop();
Symbol 2665 MovieClip Frame 1
stop();
Symbol 2729 MovieClip Frame 1
stop();