Frame 1
_root.bang_head_link = "http://www.banghead.de";
_root.main_link = "http://www.2DPlay.com/index.php?gameid=1256";
_root.scores_link = "http://www.2Dplay.com/highscores.php?gameid=1256&hiscore=";
_root.download_link = "http://www.2DPlay.com/downloadgame.php?gameid=1256";
_root.viewscores_link = "http://www.2dplay.com/showscores.php?gameid=1256";
_root.space_pressed = false;
stop();
Frame 5
function hex_md5(s) {
return(binl2hex(core_md5(str2binl(s), s.length * chrsz)));
}
function b64_md5(s) {
return(binl2b64(core_md5(str2binl(s), s.length * chrsz)));
}
function str_md5(s) {
return(binl2str(core_md5(str2binl(s), s.length * chrsz)));
}
function hex_hmac_md5(key, data) {
return(binl2hex(core_hmac_md5(key, data)));
}
function b64_hmac_md5(key, data) {
return(binl2b64(core_hmac_md5(key, data)));
}
function str_hmac_md5(key, data) {
return(binl2str(core_hmac_md5(key, data)));
}
function md5_vm_test() {
return(hex_md5("abc") == "900150983cd24fb0d6963f7d28e17f72");
}
function core_md5(x, len) {
x[len >> 5] = x[len >> 5] | (128 << (len % 32));
x[(((len + 64) >>> 9) << 4) + 14] = len;
var a = 1732584193;
var _local3 = -271733879;
var _local2 = -1732584194;
var _local1 = 271733878 /* 0x10325476 */;
var i = 0;
while (i < x.length) {
var olda = a;
var oldb = _local3;
var oldc = _local2;
var oldd = _local1;
a = md5_ff(a, _local3, _local2, _local1, x[i + 0], 7, -680876936);
_local1 = md5_ff(_local1, a, _local3, _local2, x[i + 1], 12, -389564586);
_local2 = md5_ff(_local2, _local1, a, _local3, x[i + 2], 17, 606105819);
_local3 = md5_ff(_local3, _local2, _local1, a, x[i + 3], 22, -1044525330);
a = md5_ff(a, _local3, _local2, _local1, x[i + 4], 7, -176418897);
_local1 = md5_ff(_local1, a, _local3, _local2, x[i + 5], 12, 1200080426);
_local2 = md5_ff(_local2, _local1, a, _local3, x[i + 6], 17, -1473231341);
_local3 = md5_ff(_local3, _local2, _local1, a, x[i + 7], 22, -45705983);
a = md5_ff(a, _local3, _local2, _local1, x[i + 8], 7, 1770035416);
_local1 = md5_ff(_local1, a, _local3, _local2, x[i + 9], 12, -1958414417);
_local2 = md5_ff(_local2, _local1, a, _local3, x[i + 10], 17, -42063);
_local3 = md5_ff(_local3, _local2, _local1, a, x[i + 11], 22, -1990404162);
a = md5_ff(a, _local3, _local2, _local1, x[i + 12], 7, 1804603682);
_local1 = md5_ff(_local1, a, _local3, _local2, x[i + 13], 12, -40341101);
_local2 = md5_ff(_local2, _local1, a, _local3, x[i + 14], 17, -1502002290);
_local3 = md5_ff(_local3, _local2, _local1, a, x[i + 15], 22, 1236535329);
a = md5_gg(a, _local3, _local2, _local1, x[i + 1], 5, -165796510);
_local1 = md5_gg(_local1, a, _local3, _local2, x[i + 6], 9, -1069501632);
_local2 = md5_gg(_local2, _local1, a, _local3, x[i + 11], 14, 643717713);
_local3 = md5_gg(_local3, _local2, _local1, a, x[i + 0], 20, -373897302);
a = md5_gg(a, _local3, _local2, _local1, x[i + 5], 5, -701558691);
_local1 = md5_gg(_local1, a, _local3, _local2, x[i + 10], 9, 38016083);
_local2 = md5_gg(_local2, _local1, a, _local3, x[i + 15], 14, -660478335);
_local3 = md5_gg(_local3, _local2, _local1, a, x[i + 4], 20, -405537848);
a = md5_gg(a, _local3, _local2, _local1, x[i + 9], 5, 568446438);
_local1 = md5_gg(_local1, a, _local3, _local2, x[i + 14], 9, -1019803690);
_local2 = md5_gg(_local2, _local1, a, _local3, x[i + 3], 14, -187363961);
_local3 = md5_gg(_local3, _local2, _local1, a, x[i + 8], 20, 1163531501);
a = md5_gg(a, _local3, _local2, _local1, x[i + 13], 5, -1444681467);
_local1 = md5_gg(_local1, a, _local3, _local2, x[i + 2], 9, -51403784);
_local2 = md5_gg(_local2, _local1, a, _local3, x[i + 7], 14, 1735328473);
_local3 = md5_gg(_local3, _local2, _local1, a, x[i + 12], 20, -1926607734);
a = md5_hh(a, _local3, _local2, _local1, x[i + 5], 4, -378558);
_local1 = md5_hh(_local1, a, _local3, _local2, x[i + 8], 11, -2022574463);
_local2 = md5_hh(_local2, _local1, a, _local3, x[i + 11], 16, 1839030562);
_local3 = md5_hh(_local3, _local2, _local1, a, x[i + 14], 23, -35309556);
a = md5_hh(a, _local3, _local2, _local1, x[i + 1], 4, -1530992060);
_local1 = md5_hh(_local1, a, _local3, _local2, x[i + 4], 11, 1272893353);
_local2 = md5_hh(_local2, _local1, a, _local3, x[i + 7], 16, -155497632);
_local3 = md5_hh(_local3, _local2, _local1, a, x[i + 10], 23, -1094730640);
a = md5_hh(a, _local3, _local2, _local1, x[i + 13], 4, 681279174);
_local1 = md5_hh(_local1, a, _local3, _local2, x[i + 0], 11, -358537222);
_local2 = md5_hh(_local2, _local1, a, _local3, x[i + 3], 16, -722521979);
_local3 = md5_hh(_local3, _local2, _local1, a, x[i + 6], 23, 76029189);
a = md5_hh(a, _local3, _local2, _local1, x[i + 9], 4, -640364487);
_local1 = md5_hh(_local1, a, _local3, _local2, x[i + 12], 11, -421815835);
_local2 = md5_hh(_local2, _local1, a, _local3, x[i + 15], 16, 530742520);
_local3 = md5_hh(_local3, _local2, _local1, a, x[i + 2], 23, -995338651);
a = md5_ii(a, _local3, _local2, _local1, x[i + 0], 6, -198630844);
_local1 = md5_ii(_local1, a, _local3, _local2, x[i + 7], 10, 1126891415);
_local2 = md5_ii(_local2, _local1, a, _local3, x[i + 14], 15, -1416354905);
_local3 = md5_ii(_local3, _local2, _local1, a, x[i + 5], 21, -57434055);
a = md5_ii(a, _local3, _local2, _local1, x[i + 12], 6, 1700485571);
_local1 = md5_ii(_local1, a, _local3, _local2, x[i + 3], 10, -1894986606);
_local2 = md5_ii(_local2, _local1, a, _local3, x[i + 10], 15, -1051523);
_local3 = md5_ii(_local3, _local2, _local1, a, x[i + 1], 21, -2054922799);
a = md5_ii(a, _local3, _local2, _local1, x[i + 8], 6, 1873313359);
_local1 = md5_ii(_local1, a, _local3, _local2, x[i + 15], 10, -30611744);
_local2 = md5_ii(_local2, _local1, a, _local3, x[i + 6], 15, -1560198380);
_local3 = md5_ii(_local3, _local2, _local1, a, x[i + 13], 21, 1309151649);
a = md5_ii(a, _local3, _local2, _local1, x[i + 4], 6, -145523070);
_local1 = md5_ii(_local1, a, _local3, _local2, x[i + 11], 10, -1120210379);
_local2 = md5_ii(_local2, _local1, a, _local3, x[i + 2], 15, 718787259);
_local3 = md5_ii(_local3, _local2, _local1, a, x[i + 9], 21, -343485551);
a = safe_add(a, olda);
_local3 = safe_add(_local3, oldb);
_local2 = safe_add(_local2, oldc);
_local1 = safe_add(_local1, oldd);
i = i + 16;
}
return(Array(a, _local3, _local2, _local1));
}
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));
}
function md5_ff(a, b, c, d, x, s, t) {
var _local1 = b;
return(md5_cmn((_local1 & c) | ((~_local1) & d), a, _local1, x, s, t));
}
function md5_gg(a, b, c, d, x, s, t) {
return(md5_cmn((b & d) | (c & (~d)), a, b, x, s, t));
}
function md5_hh(a, b, c, d, x, s, t) {
return(md5_cmn((b ^ c) ^ d, a, b, x, s, t));
}
function md5_ii(a, b, c, d, x, s, t) {
return(md5_cmn(c ^ (b | (~d)), a, b, x, s, t));
}
function core_hmac_md5(key, data) {
var _local2 = str2binl(key);
if (_local2.length > 16) {
_local2 = core_md5(_local2, key.length * chrsz);
}
var _local3 = Array(16);
var opad = Array(16);
var _local1 = 0;
while (_local1 < 16) {
_local3[_local1] = _local2[_local1] ^ 909522486;
opad[_local1] = _local2[_local1] ^ 1549556828;
_local1++;
}
var hash = core_md5(_local3.concat(str2binl(data)), 512 + (data.length * chrsz));
return(core_md5(opad.concat(hash), 640));
}
function safe_add(x, y) {
var _local1 = (x & 65535) + (y & 65535);
var _local2 = ((x >> 16) + (y >> 16)) + (_local1 >> 16);
return((_local2 << 16) | (_local1 & 65535));
}
function bit_rol(num, cnt) {
return((num << cnt) | (num >>> (32 - cnt)));
}
function str2binl(str) {
var _local2 = str;
var _local3 = Array();
var mask = ((1 << chrsz) - 1);
var _local1 = 0;
while (_local1 < (_local2.length * chrsz)) {
_local3[_local1 >> 5] = _local3[_local1 >> 5] | ((_local2.charCodeAt(_local1 / chrsz) & mask) << (_local1 % 32));
_local1 = _local1 + chrsz;
}
return(_local3);
}
function binl2str(bin) {
var _local2 = bin;
var _local3 = "";
var mask = ((1 << chrsz) - 1);
var _local1 = 0;
while (_local1 < (_local2.length * 32)) {
_local3 = _local3 + String.fromCharCode((_local2[_local1 >> 5] >>> (_local1 % 32)) & mask);
_local1 = _local1 + chrsz;
}
return(_local3);
}
function binl2hex(binarray) {
var _local2 = binarray;
var _local3 = (hexcase ? "0123456789ABCDEF" : "0123456789abcdef");
var str = "";
var _local1 = 0;
while (_local1 < (_local2.length * 4)) {
str = str + (_local3.charAt((_local2[_local1 >> 2] >> (((_local1 % 4) * 8) + 4)) & 15) + _local3.charAt((_local2[_local1 >> 2] >> ((_local1 % 4) * 8)) & 15));
_local1++;
}
return(str);
}
function binl2b64(binarray) {
var _local3 = binarray;
var tab = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
var str = "";
var _local2 = 0;
while (_local2 < (_local3.length * 4)) {
var triplet = (((((_local3[_local2 >> 2] >> (8 * (_local2 % 4))) & 255) << 16) | (((_local3[(_local2 + 1) >> 2] >> (8 * ((_local2 + 1) % 4))) & 255) << 8)) | ((_local3[(_local2 + 2) >> 2] >> (8 * ((_local2 + 2) % 4))) & 255));
var _local1 = 0;
while (_local1 < 4) {
if (((_local2 * 8) + (_local1 * 6)) > (_local3.length * 32)) {
str = str + b64pad;
} else {
str = str + tab.charAt((triplet >> (6 * (3 - _local1))) & 63);
}
_local1++;
}
_local2 = _local2 + 3;
}
return(str);
}
var hexcase = 0;
var b64pad = "";
var chrsz = 8;
Frame 53
_global.MainMgr = function (tl) {
var _local1 = this;
_local1.timeline = tl;
_local1.lastDepth = 0;
_local1.lastBurstDepth = 0;
_local1.initStuff();
};
MainMgr.prototype.attachMC = function (libName, x, y, z) {
var _local1 = this;
_local1.lastDepth++;
_local1.tempStr = libName + _local1.lastDepth;
_local1.container.attachMovie(libName, _local1.tempStr, _local1.lastDepth);
_local1.tempMC = _local1.container[_local1.tempStr];
_local1.tempMC._x = x;
_local1.tempMC._y = y;
_local1.tempMC._xscale = z;
_local1.tempMC._yscale = z;
return(_local1.tempMC);
};
MainMgr.prototype.createFireBurst = function (x, y, z) {
var _local1 = this;
_local1.lastBurstDepth++;
_local1.tempStr = "fire_burst_" + _local1.lastBurstDepth;
_local1.fireBurstsMC.attachMovie("antitreffer", _local1.tempStr, _local1.lastBurstDepth);
_local1.tempMC = _local1.fireBurstsMC[_local1.tempStr];
_local1.tempMC._x = x;
_local1.tempMC._y = y;
_local1.tempMC._xscale = z;
_local1.tempMC._yscale = z;
};
MainMgr.prototype.drawRect = function (x1, y1, x2, y2) {
var _local1 = this;
var _local2 = y1;
var _local3 = x1;
_local1.canvas.beginFill(0, 100);
_local1.canvas.moveTo(_local3, _local2);
_local1.canvas.lineTo(x2, _local2);
_local1.canvas.lineTo(x2, y2);
_local1.canvas.lineTo(_local3, y2);
_local1.canvas.lineTo(_local3, _local2);
_local1.canvas.endFill();
};
MainMgr.prototype.initStuff = function () {
var _local1 = this;
AsBroadcaster.initialize(MovieClip);
_local1.timeline.onEnterFrame = function () {
MovieClip.broadcastMessage("onEnterFrame");
};
_local1.timeline.createEmptyMovieClip("fireBursts", 1);
_local1.fireBurstsMC = _local1.timeline.fireBursts;
_local1.fireBurstsMC._x = 0;
_local1.fireBurstsMC._y = 0;
_local1.timeline.createEmptyMovieClip("container", 0);
_local1.container = _local1.timeline.container;
_local1.container._x = 0;
_local1.container._y = 0;
_local1.timeline.createEmptyMovieClip("canvas", 2);
_local1.canvas = _local1.timeline.canvas;
_local1.canvas._x = 0;
_local1.canvas._y = 0;
};
_global.ItemMgr = function () {
this.groups = new Object();
this.lastItem = null;
};
ItemMgr.prototype.register = function (item, group) {
var _local1 = group;
var _local2 = this;
if (_local1 == undefined) {
_local1 = "pool";
}
if (_local2.groups[_local1] == undefined) {
_local2.groups[_local1] = new Array();
}
_local2.groups[_local1].push(item);
};
ItemMgr.prototype.unregister = function (item, group) {
var _local2 = group;
var _local3 = this;
if (_local2 == null) {
_local2 = "pool";
}
if (_local3.groups[_local2] == null) {
return(false);
}
var l = _local3.groups[_local2].length;
var _local1 = 0;
while (_local1 < l) {
if (_local3.groups[_local2][_local1] == item) {
_local3.groups[_local2].splice(_local1, 1);
return(true);
}
_local1++;
}
return(false);
};
ItemMgr.prototype.actOnAll = function (func, arg) {
var _local3 = this;
var _local2 = "";
var l;
var _local1;
for (_local2 in _local3.groups) {
l = _local3.groups[_local2].length;
_local1 = 0;
while (_local1 < l) {
_local3.groups[_local2][_local1][func].apply(_local3.groups[_local2][_local1], arg);
_local1++;
}
}
};
ItemMgr.prototype.actOnGroup = function (group, func, arg) {
var _local3 = this;
if (_local3.groups[group] == undefined) {
return(false);
}
var _local2 = new Array();
_local2 = _local3.groups[group];
var l = _local2.length;
var _local1 = 0;
while (_local1 < l) {
if (_local2[_local1][func].apply(_local2[_local1], arg)) {
_local3.lastItem = _local2[_local1];
return(true);
}
_local1++;
}
_local3.lastItem = null;
return(false);
};
ItemMgr.prototype.actOnRandomGroupItem = function (group, func, arg) {
var _local3 = group;
var _local2 = this.groups[_local3].length;
var _local1 = Math.round(Math.random() * _local2);
if (_local1 == _local2) {
_local1 = 0;
}
while ((_local2--) && (!this.groups[_local3][_local1][func].apply(this.groups[_local3][_local1], arg))) {
((_local1 < (_local2 - 1)) ? (_local1++) : (_local1 = 0));
}
};
ItemMgr.prototype.kill = function () {
var _local1 = this;
_local1.groups = null;
_local1 = null;
};
_global.Sounds = function (tl) {
var _local1 = this;
_local1.timeline = tl;
_local1.sIDs = new Array();
_local1.sRefs = new Object();
_local1.setSounds();
_local1.loadSounds();
};
Sounds.prototype.setSounds = function () {
var _local1 = this;
_local1.sIDs.push("pistol");
_local1.sIDs.push("heavyMachineGun");
_local1.sIDs.push("querschlaeger01");
_local1.sIDs.push("querschlaeger02");
_local1.sIDs.push("querschlaeger03");
_local1.sIDs.push("reload");
_local1.sIDs.push("hero_hit01");
_local1.sIDs.push("hero_hit02");
_local1.sIDs.push("points");
};
Sounds.prototype.loadSounds = function () {
var _local2 = this;
var l = _local2.sIDs.length;
var _local3 = 0;
var _local1 = "";
while (_local3 < l) {
_local1 = _local2.sIDs[_local3];
_local2.sRefs[_local1] = new Sound(_local2.timeline);
_local2.sRefs[_local1].attachSound(_local1);
_local3++;
}
};
Sounds.prototype.play = function (sID) {
this.sRefs[sID].start();
};
Sounds.prototype.playRandom = function (sID, num) {
var _local1 = Math.round(Math.random() * (num - 1)) + 1;
this.sRefs[sID + _local1].start();
};
_global.HUD = function (hMC) {
var _local1 = this;
_local1.hudMC = hMC;
_local1.cPoints = 0;
_local1.fPoints = 0;
_local1.pointCounter = false;
_local1.lastShellDepth = 0;
_local1.bloodPlane = false;
_local1.setMGmode(false);
MovieClip.addListener(_local1);
};
HUD.prototype.setLife = function (l) {
this.hudMc.life.gotoAndStop(101 - l);
};
HUD.prototype.setAmmo = function (ammo) {
this.hudMC.munition.text = ammo;
};
HUD.prototype.setMagAmmo = function (ammo) {
this.shells.gotoAndStop(ammo + 1);
};
HUD.prototype.setMGmode = function (bool) {
var _local1 = this;
_local1.shells._visible = false;
if (bool) {
_local1.hudMC.icon.gotoAndPlay("machine");
_local1.shells = null;
_local1.shells._visible = true;
} else {
_local1.hudMC.icon.gotoAndPlay("pistol");
_local1.shells = _local1.hudMC.shells;
_local1.shells._visible = true;
}
};
HUD.prototype.setPoints = function (points) {
this.fPoints = points;
this.pointCounter = true;
};
HUD.prototype.setMul = function (p) {
this.hudMC.mul_points.text = p;
};
HUD.prototype.setLevel = function (level) {
this.hudMC.level.gotoAndStop(level);
};
HUD.prototype.setLetters = function (str) {
this.hudMC.schrift.gotoAndPlay(str);
};
HUD.prototype.setCrossHair = function (cross, cSmooth) {
var _local1 = this;
Mouse.hide();
_local1.hudMC.attachMovie("cross_" + cross, "crosshair", 0);
_local1.crossMC = _local1.hudMC.crosshair;
_local1.crossSmooth = cSmooth;
};
HUD.prototype.unsetCross = function () {
Mouse.show();
this.crossMC.removeMovieClip();
};
HUD.prototype.syncCrossHair = function () {
this.crossMC._x = _xmouse;
this.crossMC._y = _ymouse;
};
HUD.prototype.smoothSyncCrossHair = function () {
var _local1 = this;
_local1.crossMC._x = _local1.crossMC._x + ((_xmouse - _local1.crossMC._x) * _local1.crossSmooth);
_local1.crossMC._y = _local1.crossMC._y + ((_ymouse - _local1.crossMC._y) * _local1.crossSmooth);
};
HUD.prototype.shellFly = function () {
var _local1 = this;
_local1.hudMC.shell_container.attachMovie("huelse", "h" + _local1.lastShellDepth, _local1.lastShellDepth);
_local1.lastShellDepth++;
};
HUD.prototype.flashBlood = function () {
this.hudMC.blood_plane._alpha = 60;
this.bloodPlane = true;
};
HUD.prototype.onEnterFrame = function () {
var _local1 = this;
_local1.smoothSyncCrossHair();
if (_local1.bloodPlane) {
_local1.hudMC.blood_plane._alpha = 0;
_local1.bloodPlane = false;
}
if (_local1.pointCounter) {
if ((_local1.cPoints + 20) < _local1.fPoints) {
_local1.cPoints = _local1.cPoints + Math.round((_local1.fPoints - _local1.cPoints) / 2);
} else {
_local1.cPoints = _local1.fPoints;
_local1.pointCounter = false;
}
_local1.hudMC.points.text = _local1.cPoints;
}
};
_global.Terrain = function (d) {
this.levels = new Array();
this.levelNum = 0;
};
Terrain.prototype.register = function (depth, colPlanes) {
var _local2 = this;
var _local3 = new Object();
_local3.depth = depth;
if (colPlanes.length > 1) {
_local3.subCol = true;
_local3.plane = colPlanes;
} else {
_local3.subCol = false;
_local3.plane = colPlanes[0];
}
var inserted = false;
if (_local2.levelNum == 0) {
_local2.levels.push(_local3);
} else {
var _local1 = 0;
while (_local1 < _local2.levelNum) {
if (_local2.levels[_local1].depth <= _local3.depth) {
_local2.levels.splice(_local1, 1, _local3);
inserted = true;
break;
}
_local1++;
}
if (!inserted) {
_local2.levels.push(_local3);
}
}
_local2.levelNum++;
};
Terrain.prototype.testHit = function (x, y) {
var _local3 = this;
var _local1 = new Object();
var _local2 = 0;
while (_local2 < _local3.levelNum) {
if (_local3.levels[_local2].subCol) {
var l = _local3.levels[_local2].plane.length;
var j = 0;
while (j < l) {
_local1 = _local3.levels[_local2].plane[j].getBounds(_root);
if (x < _local1.xMin) {
} else if (y < _local1.yMin) {
} else if (x > _local1.xMax) {
} else if (y > _local1.yMax) {
} else {
return(_local3.levels[_local2].depth);
}
j++;
}
} else {
_local1 = _local3.levels[_local2].plane.getBounds(_root);
if (x < _local1.xMin) {
} else if (y < _local1.yMin) {
} else if (x > _local1.xMax) {
} else if (y > _local1.yMax) {
} else {
return(_local3.levels[_local2].depth);
}
}
_local2++;
}
return(100);
};
_global.Collector = function () {
var _local1 = this;
var _local2 = _global;
_local1.cPoints = 0;
_local1.level = 0;
_local2.level = 0;
_local2.maxProjectiles = _local2.levelData[_local1.level].projectile_max;
_local2.curProjectiles = 0;
_local1.levelKills = 0;
_local1.levelBarrier = _local2.levelData[0].killsToMaster;
_local1.killsInARow = 0;
_local1.killCombo = true;
_local1.levelShotsHit = 0;
_local1.levelShotsMissed = 0;
_local1.maxLevels = _local2.levelData.length;
_local1.levelArray = new Array();
_local2.hud.setLevel(_local1.level + 1);
_local2.hud.setLetters("level" + (_local1.level + 1));
_local2.hud.setMul("", "");
};
Collector.prototype.targetHit = function () {
this.levelShotsHit++;
};
Collector.prototype.targetKilled = function (targetType) {
var _local1 = this;
var _local2 = _global;
_local1.levelShotsHit++;
switch (targetType) {
case "dwarf" :
_local1.levelKills++;
_local1.killsInARow++;
_local1.killCombo = true;
_local1.cPoints = _local1.cPoints + 25;
break;
case "crazycat" :
_local1.levelKills++;
_local1.killsInARow++;
_local1.killCombo = true;
_local1.cPoints = _local1.cPoints + 50;
break;
case "rundwarf" :
_local1.levelKills++;
_local1.killsInARow++;
_local1.killCombo = true;
_local1.cPoints = _local1.cPoints + 25;
_local2.player.addAmmo(36);
break;
case "ballon" :
_local2.player.addLife(25);
_local1.cPoints = _local1.cPoints + 50;
break;
case "ufo" :
_local2.player.mgMode(true);
_local1.cPoints = _local1.cPoints + 100;
break;
case "messer" :
_local1.cPoints = _local1.cPoints + 10;
}
if (_local1.killCombo) {
_local1.killCombo = false;
switch (_local1.killsInARow) {
case 5 :
_local2.hud.setLetters("floh");
_local1.cPoints = _local1.cPoints + 500;
break;
case 10 :
_local2.hud.setLetters("spiel");
_local1.cPoints = _local1.cPoints + 1000;
break;
case 20 :
_local2.hud.setLetters("biene");
_local1.cPoints = _local1.cPoints + 2000;
break;
case 30 :
_local2.hud.setLetters("killer");
_local1.cPoints = _local1.cPoints + 5000;
break;
case 40 :
_local2.hud.setLetters("master");
_local1.cPoints = _local1.cPoints + 10000;
break;
case 50 :
_local2.hud.setLetters("god");
_local1.cPoints = _local1.cPoints + 20000;
}
}
if (_local1.levelKills == _local1.levelBarrier) {
_local1.levelUp();
}
_local2.player.addPoints(_local1.cPoints);
_local1.cPoints = 0;
};
Collector.prototype.targetMissed = function () {
this.levelShotsMissed++;
this.killsInARow = 0;
};
Collector.prototype.levelUp = function () {
var _local1 = this;
var _local2 = _global;
_local1.level++;
if (_local1.level > _local2.levels) {
_local2.gameInit.endGame(true);
} else {
_local1.levelArray.push({kills:_local1.levelKills, shotsHit:_local1.levelShotsHit, shotsMissed:_local1.levelShotsMissed});
_local1.levelKills = 0;
_local1.levelShotsHit = 0;
_local1.levelShotsMissed = 0;
_local1.levelBarrier = _local2.levelData[_local1.level].killsToMaster;
_local2.level = _local1.level;
_local2.maxProjectiles = _local2.levelData[_local1.level].projectile_max;
_local2.hud.setLevel(_local1.level + 1);
_local2.hud.setLetters("level" + (_local1.level + 1));
_local2.spawner.setLevel(_local1.level);
_local2.itemMgr.actOnGroup("dwarfs", "setLevel", [_local1.level]);
}
};
Collector.prototype.calcStatistic = function () {
};
_global.Spawner = function () {
var _local1 = this;
MovieClip.addListener(_local1);
_local1.dwarf = new Object();
_local1.dwarf.idI = 0;
_local1.special = new Object();
_local1.special.idI = 0;
_local1.activeDwarfs = 0;
};
Spawner.prototype.go = function () {
var _local1 = this;
_local1.dwarf.idI = setInterval(_local1, "spawnDwarf", _local1.dwarf.occI);
_local1.special.idI = setInterval(_local1, "spawnSpecial", _local1.special.occI);
};
Spawner.prototype.halt = function () {
clearInterval(this.dwarf.idI);
clearInterval(this.special.idI);
};
Spawner.prototype.setLevel = function (level) {
var _local1 = this;
var _local2 = _global;
var _local3 = level;
_local1.halt();
_local1.dwarf.occI = _local2.levelData[_local3].dwarf_spawnInterval;
_local1.special.occI = _local2.levelData[_local3].special_spawnInterval;
_local1.dwarf.occurence = _local2.levelData[_local3].dwarf_occurence;
_local1.dwarf.maxOccurence = _local2.levelData[_local3].dwarf_maxOccurence;
_local1.go();
};
Spawner.prototype.spawnDwarf = function () {
var _local2 = _global;
var _local3 = this;
if (_local3.activeDwarfs < _local3.dwarf.maxOccurence) {
var _local1 = Math.round((Math.random() * (_local3.dwarf.occurence - 1)) + 1);
do {
_local2.itemMgr.actOnRandomGroupItem("dwarfs", "attack", null);
_local1--;
} while (_local1);
}
};
Spawner.prototype.spawnSpecial = function () {
_global.itemMgr.actOnRandomGroupItem("specials", "attack", null);
};
_global.Player = function () {
var _local1 = this;
_local1.life = 100;
_local1.points = 0;
_local1.mgFrenzy = false;
_global.hud.setLife(_local1.life);
_global.hud.setPoints(_local1.points);
_local1.weapons = new Array();
_local1.weapons.push(new Pistol());
_local1.weapons.push(new MachineGun());
_local1.activeWeapon = 0;
_local1.weapons[_local1.activeWeapon].setActive(true);
_local1.hasWeapon = new Array();
_local1.hasWeapon.push(true);
_local1.hasWeapon.push(false);
Key.addListener(_local1);
};
Player.prototype.onKeyDown = function () {
var _local1 = this;
if (Key.isDown(17)) {
if (_local1.activeWeapon == 1) {
_local1.mgMode(false);
} else if ((_local1.activeWeapon == 0) && (_local1.hasWeapon[1])) {
_local1.mgMode(true);
}
}
};
Player.prototype.mgMode = function (bool) {
var _local1 = this;
_global.hud.setMGmode(bool);
if (bool) {
if (_local1.mgFrenzy) {
_local1.addAmmo(100);
} else {
_local1.mgFrenzy = true;
_local1.hasWeapon[1] = true;
_local1.weapons[_local1.activeWeapon].setActive(false);
_local1.activeWeapon = 1;
_local1.weapons[_local1.activeWeapon].resetAmmo();
_local1.weapons[_local1.activeWeapon].setActive(true);
}
} else {
_local1.mgFrenzy = false;
_local1.weapons[_local1.activeWeapon].setActive(false);
_local1.activeWeapon = 0;
_local1.weapons[_local1.activeWeapon].setActive(true);
}
};
Player.prototype.addPoints = function (p) {
var _local1 = this;
if (_local1.life > 0) {
_local1.points = _local1.points + p;
}
_global.hud.setPoints(_local1.points);
};
Player.prototype.addLife = function (l) {
var _local1 = this;
_local1.life = _local1.life + l;
if (_local1.life > 100) {
_local1.life = 100;
}
_global.hud.setLife(_local1.life);
};
Player.prototype.addAmmo = function (a) {
this.weapons[this.activeWeapon].ammoUp(a);
};
Player.prototype.hit = function (type) {
var _local1 = _global;
var _local2 = this;
switch (type) {
case "crazycat" :
_local2.life = _local2.life - 30;
break;
case "messer" :
_local2.life = _local2.life - 10;
}
_local1.sounds.play("hero_hit01");
_local1.hud.flashBlood();
_local1.hud.setLife(_local2.life);
if (_local2.life < 1) {
trace("dead");
_local1.gameInit.endGame(false);
}
};
_global.Weapon = function (cross, smooth, ammoMaximum, ammoBegin, mag, magMaximum) {
var _local1 = this;
_local1.cross = cross;
_local1.crossSmooth = smooth;
_local1.ammoMax = ammoMaximum;
_local1.ammoStart = ammoBegin;
_local1.ammoNum = ammoBegin;
if (mag) {
_local1.hasMag = true;
_local1.magMax = magMaximum;
((_local1.ammoNum > _local1.magMax) ? ((_local1.magNum = _local1.magMax)) : ((_local1.magNum = _local1.ammoNum)));
_local1.ammoDecrease = _local1.ammoDownMag;
} else {
_local1.ammoDecrease = _local1.ammoDown;
}
((_local1.ammoNum > 0) ? ((_local1.hasAmmo = true)) : ((_local1.hasAmmo = false)));
Mouse.addListener(_local1);
Key.addListener(_local1);
};
Weapon.prototype.onKeyDown = function () {
if (Key.isDown(32)) {
_root.reload_tip.removeMovieClip();
this.reload();
}
};
Weapon.prototype.setActive = function (b) {
var _local1 = this;
var _local2 = _global;
if (b) {
_local2.hud.setAmmo(_local1.ammoNum);
_local2.hud.setMagAmmo(_local1.magNum);
_local2.hud.setCrossHair(_local1.cross, _local1.crossSmooth);
_local1.onMouseDown = _local1.fire;
} else {
_local2.hud.unsetCrossHair();
_local1.onMouseDown = null;
}
};
Weapon.prototype.setCrossHair = function (cross, smooth) {
_global.hud.setCrossHair(cross, smooth);
};
Weapon.prototype.unsetCrossHair = function () {
_global.hud.unsetCrossHair();
};
Weapon.prototype.reload = function () {
var _local1 = this;
((_local1.ammoNum > _local1.magMax) ? ((_local1.magNum = _local1.magMax)) : ((_local1.magNum = _local1.ammoNum)));
_global.hud.setMagAmmo(_local1.magNum);
_local1.magReload = false;
};
Weapon.prototype.resetAmmo = function () {
var _local1 = this;
_local1.ammoNum = _local1.ammoStart;
_local1.magNum = _local1.magMax;
};
Weapon.prototype.ammoUp = function (num) {
var _local1 = this;
_local1.ammoNum = _local1.ammoNum + num;
_local1.hasAmmo = true;
_global.hud.setAmmo(_local1.ammoNum);
};
Weapon.prototype.ammoDown = function (num) {
var _local1 = this;
_local1.ammoNum = _local1.ammoNum - num;
if (_local1.ammoNum == 0) {
_local1.hasAmmo = false;
_global.collector.targetMissed();
}
_global.hud.setAmmo(_local1.ammoNum);
};
Weapon.prototype.ammoDownMag = function (num) {
var _local1 = this;
var _local2 = _global;
_local1.ammoNum = _local1.ammoNum - num;
_local1.magNum = _local1.magNum - num;
if (_local1.ammoNum == 0) {
_local1.hasAmmo = false;
_local2.collector.targetMissed();
} else if (_local1.magNum == 0) {
_local1.magReload = true;
}
_local2.hud.setAmmo(_local1.ammoNum);
_local2.hud.setMagAmmo(_local1.magNum);
};
Weapon.prototype.firePoint = function (x, y) {
var _local1 = _global;
var _local2 = y;
var _local3 = x;
if (!this.hasAmmo) {
return(false);
}
if (this.magReload) {
return(false);
}
this.ammoDecrease(1);
if (_local1.itemMgr.actOnGroup("projectiles", "testHit", [_local3, _local2])) {
} else if (_local1.itemMgr.actOnGroup("dwarfs", "testHit", [_local3, _local2])) {
} else if (_local1.itemMgr.actOnGroup("specials", "testHit", [_local3, _local2])) {
} else {
_local1.sounds.playRandom("querschlaeger0", 3);
_local1.mainMgr.createFireBurst(_local3, _local2, _local1.terrain.testHit(_local3, _local2));
_local1.collector.targetMissed();
}
return(true);
};
Weapon.prototype.firePlane = function (x1, y1, x2, y2) {
var _local1 = this;
if (!_local1.hasAmmo) {
} else if (_local1.magReload) {
} else {
_local1.ammoDecrease(1);
if (_global.itemMgr.actOnAll("testPlaneHit", [x1, y1, x2, y2])) {
}
}
};
_global.Pistol = function () {
super("standard", 1, 99, 36, true, 6);
};
Pistol.prototype = new Weapon();
Pistol.prototype.fire = function () {
var _local1 = _global;
var _local2 = _root;
if ((_local1.player.weapons[0].magNum == 1) && (!_local2.space_pressed)) {
_local2.space_pressed = true;
_local2.attachMovie("reload_tip", "reload_tip", 999999, {_x:48, _y:319});
}
if (!super.firePoint(_xmouse, _ymouse)) {
} else {
_local1.sounds.play("pistol");
_local1.hud.shellFly();
}
};
Pistol.prototype.reload = function () {
if (!this.magReload) {
return(undefined);
}
_global.sounds.play("reload");
super.reload();
};
_global.MachineGun = function () {
super("standard", 1, 99, 99, false, 0);
this.fireNext = 0;
this.fireRate = 1;
};
MachineGun.prototype = new Weapon();
MachineGun.prototype.setActive = function (b) {
var _local1 = this;
super.setActive(b);
if (b) {
MovieClip.addListener(_local1);
_local1.onMouseUp = _local1.stopFire;
} else {
MovieClip.removeListener(_local1);
_local1.onMouseUp = null;
}
};
MachineGun.prototype.fire = function () {
this.onEnterFrame = this.steadyFire;
};
MachineGun.prototype.stopFire = function () {
this.fireNext = 0;
this.onEnterFrame = null;
};
MachineGun.prototype.steadyFire = function () {
var _local1 = this;
if (!(_local1.fireNext--)) {
if (!_local1.hasAmmo) {
_local1.stopFire();
_global.player.mgMode(false);
} else {
_global.sounds.play("heavyMachineGun");
super.firePoint(_xmouse, _ymouse);
_local1.fireNext = _local1.fireRate;
}
}
};
MachineGun.prototype.reload = function () {
if (!this.magReload) {
return(undefined);
}
super.reload();
};
_global.ShootableItem = function (mc, onHitF, g) {
var _local1 = this;
_local1.myMC = mc;
_local1._onHitFunc = onHitF;
_local1.group = g;
_local1.active = false;
_global.itemMgr.register(_local1, _local1.group);
};
ShootableItem.prototype.testHit = function (x, y) {
var _local3 = this;
if (!_local3.active) {
return(0);
}
var _local1 = _local3._mainColPlane.getBounds(_root);
if (x < _local1.xMin) {
return(0);
}
if (y < _local1.yMin) {
return(0);
}
if (x > _local1.xMax) {
return(0);
}
if (y > _local1.yMax) {
return(0);
}
if (_local3._subCollision) {
var _local2 = 0;
while (_local2 < _local3._subColNum) {
_local1 = _local3._subColPlanes[_local2].getBounds(_root);
if (x < _local1.xMin) {
} else if (y < _local1.yMin) {
} else if (x > _local1.xMax) {
} else if (y > _local1.yMax) {
} else {
_local3._onHitFunc(_local2 + 1);
return(_local2 + 1);
}
_local2++;
}
return(0);
}
_local3._onHitFunc(1);
return(1);
};
ShootableItem.prototype.testPlaneHit = function (x1, y1, x2, y2) {
var _local2 = this;
var _local3 = y2;
if (!_local2.active) {
return(0);
}
var _local1 = _local2._mainColPlane.getBounds(_root);
if (x2 < _local1.xMin) {
return(0);
}
if (_local3 < _local1.yMin) {
return(0);
}
if (x1 > _local1.xMax) {
return(0);
}
if (y1 > _local1.yMax) {
return(0);
}
if (_local2._subCollision) {
var i:Number = 0;
while (i < _local2._subColNum) {
_local1 = _local2._subColPlanes[i].getBounds(_root);
if (x2 < _local1.xMin) {
} else if (_local3 < _local1.yMin) {
} else if (x1 > _local1.xMax) {
} else if (y1 > _local1.yMax) {
} else {
_local2._onHitFunc(i + 1);
return(i + 1);
}
i++;
}
return(0);
}
_local2._onHitFunc(1);
return(1);
};
ShootableItem.prototype.setColPlanes = function (mainCol, sub, subCol) {
var _local1 = this;
if (mainCol == undefined) {
trace("WARNING collisionplane undefined in " + _local1.myMC);
}
_local1._mainColPlane = mainCol;
if (sub) {
_local1._subColPlanes = subCol;
_local1._subColNum = subCol.length;
}
_local1._subCollision = sub;
};
ShootableItem.prototype.callAfterFrameDelay = function (d, o, f, a) {
var _local1 = this;
_local1.fdDelay = d;
_local1.fdFunc = f;
_local1.fdObj = o;
_local1.fdArg = a;
MovieClip.addListener(_local1);
_local1.onEnterFrame = _local1.frameDelay;
};
ShootableItem.prototype.cancelFrameDelay = function () {
this.onEnterFrame = null;
};
ShootableItem.prototype.frameDelay = function () {
var _local1 = this;
if (!(--_local1.fdDelay)) {
_local1.fdFunc.apply(_local1.fdObj, _local1.fdArg);
_local1.onEnterFrame = null;
MovieClip.removeListener(_local1);
}
};
ShootableItem.prototype.destruct = function () {
var _local1 = this;
_global.itemMgr.unregister(_local1, _local1.group);
_local1.myMC.removeMovieClip();
};
_global.Dwarf = function (mc) {
var _local1 = this;
super(mc, _local1.onHit, "dwarfs");
super.setColPlanes(_local1.myMC.hges, true, [_local1.myMC.h_kopf, _local1.myMC.h_koerper]);
_local1.projectile = null;
_local1.shootIntervalID = null;
_local1.resetIntervalID = null;
_local1.resetInterval = 2000;
_local1.setLevel(0);
_local1.regen = false;
_local1.active = false;
};
Dwarf.prototype = new ShootableItem();
Dwarf.prototype.setLevel = function (level) {
var _local1 = _global;
var _local2 = level;
var _local3 = this;
_local3.startShootInterval = _local1.levelData[_local2].dwarf_startShootInterval;
_local3.shootInterval = _local1.levelData[_local2].dwarf_shootInterval;
_local3.shotNum = _local1.levelData[_local2].dwarf_maxShots;
};
Dwarf.prototype.attack = function () {
var _local1 = this;
if (_local1.active) {
return(false);
}
if (_local1.regen) {
return(false);
}
_local1.active = true;
_global.spawner.activeDwarfs++;
_local1.shootIntervalID = setInterval(_local1, "shoot", _local1.startShootInterval);
_local1.myMC.gotoAndPlay("hoch");
return(true);
};
Dwarf.prototype.shoot = function () {
var _local1 = this;
clearInterval(_local1.shootIntervalID);
if ((_local1.shotNum--) && (_global.curProjectiles < _global.maxProjectiles)) {
_local1.myMC.gotoAndPlay("werfen");
super.callAfterFrameDelay(5, _local1, _local1.fireProjectile, null);
} else {
_local1.retreat();
return;
}
_local1.shootIntervalID = setInterval(_local1, "shoot", _local1.shootInterval);
};
Dwarf.prototype.fireProjectile = function () {
var _local1 = this;
new Projectile(_local1.myMC._x, _local1.myMC._y, _local1.myMC._xscale, "messer");
if (!_local1.shotNum) {
_local1.retreat();
}
};
Dwarf.prototype.retreat = function () {
this.myMC.gotoAndPlay("runter");
this.regenerate();
};
Dwarf.prototype.onHit = function (zone) {
var _local1 = this;
if (zone == 1) {
_local1.myMC.gotoAndPlay("tod_01");
_global.collector.targetKilled("dwarf");
} else if (zone == 2) {
_local1.myMC.gotoAndPlay("tod_02");
_global.collector.targetKilled("dwarf");
}
_local1.regenerate();
};
Dwarf.prototype.regenerate = function () {
var _local1 = this;
super.cancelFrameDelay();
clearInterval(_local1.shootIntervalID);
_local1.resetIntervalID = setInterval(_local1, "reset", _local1.resetInterval);
_global.spawner.activeDwarfs--;
_local1.active = false;
_local1.regen = true;
};
Dwarf.prototype.reset = function () {
clearInterval(this.resetIntervalID);
this.regen = false;
};
_global.RunDwarf = function (mc) {
var _local1 = this;
super(mc, _local1.onHit, "specials");
super.setColPlanes(_local1.myMC.hges, true, [_local1.myMC.h_kopf, _local1.myMC.h_koerper]);
_local1.resetInterval = 2000;
_local1.resetIntervalID = null;
_local1.active = false;
_local1.regen = false;
};
RunDwarf.prototype = new ShootableItem();
RunDwarf.prototype.attack = function () {
var _local1 = this;
if (_local1.active) {
return(false);
}
if (_local1.regen) {
return(false);
}
_local1.active = true;
_local1.myMC._parent.gotoAndPlay("kommt");
_local1.myMC.gotoAndPlay("los");
return(true);
};
RunDwarf.prototype.retreat = function () {
this.regenerate();
};
RunDwarf.prototype.onHit = function (zone) {
var _local1 = this;
if (zone == 1) {
_local1.myMC.gotoAndPlay("tod_01");
_global.collector.targetKilled("rundwarf");
} else if (zone == 2) {
_local1.myMC.gotoAndPlay("tod_02");
_global.collector.targetKilled("rundwarf");
}
_local1.regenerate();
};
RunDwarf.prototype.onSurvived = function () {
trace("ufo - survied");
this.regenerate();
};
RunDwarf.prototype.regenerate = function () {
var _local1 = this;
_local1.resetIntervalID = setInterval(_local1, "reset", _local1.resetInterval);
_local1.active = false;
};
RunDwarf.prototype.reset = function () {
clearInterval(this.regenIntervalID);
this.regen = false;
};
_global.CrazyCat = function (mc) {
var _local1 = this;
super(mc, _local1.onHit, "dwarfs");
super.setColPlanes(_local1.myMC.h_ges, false, null);
_local1.resetInterval = 2000;
_local1.resetIntervalID = null;
_local1.active = false;
_local1.regen = false;
};
CrazyCat.prototype = new ShootableItem();
CrazyCat.prototype.attack = function () {
var _local1 = this;
if (_local1.active) {
return(false);
}
if (_local1.regen) {
return(false);
}
_local1.active = true;
_local1.myMC._parent.gotoAndPlay("kommt");
_local1.myMC.gotoAndPlay("los");
return(true);
};
CrazyCat.prototype.retreat = function () {
this.regenerate();
};
CrazyCat.prototype.onPlayerHit = function () {
_global.player.hit("crazycat");
};
CrazyCat.prototype.onHit = function (zone) {
this.myMC.gotoAndPlay("tod_01");
_global.collector.targetKilled("crazycat");
this.regenerate();
};
CrazyCat.prototype.regenerate = function () {
var _local1 = this;
_local1.resetIntervalID = setInterval(_local1, "reset", _local1.resetInterval);
_local1.active = false;
};
CrazyCat.prototype.reset = function () {
clearInterval(this.regenIntervalID);
this.regen = false;
};
_global.UFO = function (mc) {
var _local1 = this;
super(mc, _local1.onHit, "specials");
_local1.setColPlanes(_local1.myMC.h_tasse, false, null);
_local1.resetInterval = 2000;
_local1.resetIntervalID = null;
_local1.active = false;
_local1.regen = false;
};
UFO.prototype = new ShootableItem();
UFO.prototype.attack = function () {
var _local1 = this;
if (_local1.active) {
return(false);
}
if (_local1.regen) {
return(false);
}
_local1.active = true;
_local1.myMC._parent.gotoAndPlay("kommt");
_local1.myMC.gotoAndPlay("los");
return(true);
};
UFO.prototype.retreat = function () {
this.regenerate();
};
UFO.prototype.onHit = function (zone) {
var _local1 = this;
_local1.active = false;
_local1.myMC.gotoAndPlay("tod_01");
_global.collector.targetKilled("ufo");
_local1.regenerate();
};
UFO.prototype.onSurvived = function () {
trace("ufo - survied");
this.regenerate();
};
UFO.prototype.regenerate = function () {
var _local1 = this;
_local1.resetIntervalID = setInterval(_local1, "reset", _local1.resetInterval);
_local1.active = false;
};
UFO.prototype.reset = function () {
clearInterval(this.regenIntervalID);
this.regen = false;
};
_global.Ballon = function (mc) {
var _local1 = this;
super(mc, _local1.onHit, "specials");
_local1.setColPlanes(_local1.myMC.h_speed, false, null);
_local1.resetInterval = 2000;
_local1.resetIntervalID = null;
_local1.active = false;
_local1.regen = false;
};
Ballon.prototype = new ShootableItem();
Ballon.prototype.attack = function () {
var _local1 = this;
if (_local1.active) {
return(false);
}
if (_local1.regen) {
return(false);
}
_local1.active = true;
_local1.myMC._parent._x = 20 + Math.round(Math.random() * 560);
_local1.myMC._parent.gotoAndPlay("kommt");
_local1.myMC.gotoAndPlay("los");
return(true);
};
Ballon.prototype.retreat = function () {
this.regenerate();
};
Ballon.prototype.onHit = function (zone) {
_global.collector.targetKilled("ballon");
this.myMC.gotoAndPlay("tod_01");
this.regenerate();
};
Ballon.prototype.onSurvived = function () {
trace("ballon - survied");
this.regenerate();
};
Ballon.prototype.regenerate = function () {
var _local1 = this;
_local1.resetIntervalID = setInterval(_local1, "reset", _local1.resetInterval);
_local1.active = false;
};
Ballon.prototype.reset = function () {
clearInterval(this.regenIntervalID);
this.regen = false;
};
_global.Projectile = function (x, y, z, libname) {
var _local1 = this;
var _local2 = _global;
var _local3 = x;
super(_local2.mainMgr.attachMC(libname, _local3, y, z), _local1.onHit, "projectiles");
super.setColPlanes(_local1.myMC.hges, false, null);
_local2.curProjectiles++;
_local1.active = true;
_local1.time = Math.round((150 - z) / 2);
_local1.ctime = 0;
_local1.startX = _local3;
_local1.startY = y;
if (_local3 > _local2.stageWdiv2) {
_local1.stepX = (_local2.stageWdiv2 - (_local3 * 0.8)) / _local1.time;
} else {
_local1.stepX = (_local2.stageWdiv2 - (_local3 * 1.2)) / _local1.time;
}
_local1.stepY = _local2.stageHdiv2 / _local1.time;
_local1.stepZ = (300 - z) / _local1.time;
_local1.curveT = ((y / _local2.stageH) * 30) + (30 - (0.3 * z));
_local1.cCurve = 0;
_local1.curve = 0;
_local1.stepC = _local1.curveT / _local1.time;
MovieClip.addListener(_local1);
_local1.onEnterFrame = _local1.fly;
};
Projectile.prototype = new ShootableItem();
Projectile.prototype.fly = function () {
var _local1 = this;
if (_local1.ctime == _local1.time) {
_local1.playerHit();
}
_local1.curve = Math.pow(_local1.cCurve, 2) - (_local1.curveT * _local1.cCurve);
_local1.myMC._x = _local1.startX + (_local1.stepX * _local1.ctime);
_local1.myMC._y = (_local1.startY + _local1.curve) + (_local1.stepY * _local1.ctime);
_local1.myMC._xscale = _local1.myMC._xscale + _local1.stepZ;
_local1.myMC._yscale = _local1.myMC._yscale + _local1.stepZ;
_local1.cCurve = _local1.StepC * _local1.cTime;
_local1.ctime++;
};
Projectile.prototype.playerHit = function () {
var _local1 = this;
_local1.active = false;
_local1.onEnterFrame = null;
_global.player.hit("messer");
_local1.kill();
};
Projectile.prototype.onHit = function () {
var _local1 = this;
_local1.active = false;
_local1.onEnterFrame = null;
_local1.myMC.gotoAndPlay("tod_01");
_global.collector.targetKilled("messer");
super.callAfterFrameDelay(5, _local1, _local1.kill, null);
};
Projectile.prototype.kill = function () {
_global.curProjectiles--;
super.destruct();
};
_global.GameInit = function (tl) {
var _local1 = this;
trace("gameinit------------------------------");
_local1.timeline = tl;
_local1.setGlobals();
_local1.setCallBack(_local1, _local1.setGlobalObjects, null);
_local1.loadLevelData();
};
GameInit.prototype.startGame = function () {
this.timeline.gotoAndStop("go");
_global.spawner.setLevel(0);
};
GameInit.prototype.endGame = function (won) {
var _local1 = _global;
_local1.spawner.halt();
_local1.itemMgr.actOnGroup("dwarfs", "onHit", [1]);
_local1.itemMgr.actOnGroup("projectiles", "onHit", null);
_local1.itemMgr.kill();
_local1.collector.targetMissed();
_local1.hud.unsetCross();
_local1.hud.gameOver();
_local1.player_points = _local1.player.points;
_local1.player_level = _local1.collector.level + 1;
_local1.mainMgr = null;
_local1.itemMgr = null;
_local1.hud = null;
_local1.sounds = null;
_local1.terrain = null;
_local1.spawner = null;
_local1.collector = null;
_local1.player = null;
delete _local1.mainMgr;
delete _local1.itemMgr;
delete _local1.hud;
delete _local1.sounds;
delete _local1.terrain;
delete _local1.spawner;
delete _local1.collector;
delete _local1.player;
gotoAndPlay (91);
};
GameInit.prototype.goHighScore = function () {
};
GameInit.prototype.setGlobals = function () {
var _local1 = _global;
_local1.stageW = Stage.width;
_local1.stageH = Stage.height;
_local1.stageWdiv2 = _local1.stageW / 2;
_local1.stageHdiv2 = _local1.stageH / 2;
_local1.levelData = new Array();
};
GameInit.prototype.setGlobalObjects = function () {
var _local1 = _global;
var _local2 = this;
_local1.mainMgr = new MainMgr(_local2.timeline);
_local1.itemMgr = new ItemMgr();
_local1.hud = new HUD(_local2.timeline.anzeige);
_local1.sounds = new Sounds(_local2.timeline);
_local1.terrain = new Terrain();
_local1.spawner = new Spawner();
_local1.collector = new Collector();
_local1.player = new Player();
_local1.highscore = new Highscore(_local2.timeline);
_local2.startGame();
};
GameInit.prototype.loadLevelData = function () {
var _local1 = this;
_local1.levelXML = new XML();
_local1.levelXML.ignoreWhite = true;
_local1.levelXML.main = _local1;
_local1.levelXML.onLoad = _local1.onLevelData;
_local1.levelXML.load("data/leveldata.xml");
};
GameInit.prototype.onLevelData = function (success) {
var _local1 = _global;
_local1.levels = 6;
_local1.levelData.push({dwarf_maxOccurence:6, dwarf_maxShots:6, dwarf_occurence:1, dwarf_shootInterval:1000, dwarf_spawnInterval:1000, dwarf_startShootInterval:2000, killsToMaster:25, projectile_max:2, special_spawnInterval:5000});
_local1.levelData.push({dwarf_maxOccurence:2, dwarf_maxShots:1, dwarf_occurence:1, dwarf_shootInterval:2000, dwarf_spawnInterval:2000, dwarf_startShootInterval:2000, killsToMaster:25, projectile_max:2, special_spawnInterval:15000});
_local1.levelData.push({dwarf_maxOccurence:3, dwarf_maxShots:2, dwarf_occurence:1, dwarf_shootInterval:1000, dwarf_spawnInterval:1500, dwarf_startShootInterval:1000, killsToMaster:50, projectile_max:2, special_spawnInterval:15000});
_local1.levelData.push({dwarf_maxOccurence:4, dwarf_maxShots:1, dwarf_occurence:2, dwarf_shootInterval:1000, dwarf_spawnInterval:1000, dwarf_startShootInterval:1000, killsToMaster:50, projectile_max:2, special_spawnInterval:20000});
_local1.levelData.push({dwarf_maxOccurence:2, dwarf_maxShots:6, dwarf_occurence:1, dwarf_shootInterval:2000, dwarf_spawnInterval:2000, dwarf_startShootInterval:2000, killsToMaster:50, projectile_max:2, special_spawnInterval:15000});
_local1.levelData.push({dwarf_maxOccurence:2, dwarf_maxShots:1, dwarf_occurence:1, dwarf_shootInterval:2000, dwarf_spawnInterval:2000, dwarf_startShootInterval:2000, killsToMaster:300000, projectile_max:2, special_spawnInterval:15000});
this.main.callBack();
delete this;
};
GameInit.prototype.setCallBack = function (obj, func, arg) {
var _local1 = this;
_local1._cbObj = obj;
_local1._cbFunc = func;
_local1._cbArgs = arg;
};
GameInit.prototype.callBack = function () {
var _local1 = this;
_local1._cbFunc.apply(_local1._cbObj, _local1._cbArgs);
};
_global.Highscore = function (tl) {
var _local1 = this;
_local1.tl = tl;
_local1.serverUrl = "http://www.ballz.de/flash/highscore/";
_local1.maxEntries = 10;
_local1.highScoreData = new Array();
};
Highscore.prototype.displayHighscore = function () {
var _local2 = this;
trace("displaying");
var _local1 = 0;
while (_local1 < _local2.maxEntries) {
trace((((("displaying score: " + _local2.highScoreData[_local1].score) + " name: ") + _local2.highScoreData[_local1].name) + " level: ") + _local2.highScoreData[_local1].level);
_local2.tl["score" + _local1].text = _local2.highScoreData[_local1].score;
_local2.tl["name" + _local1].text = _local2.highScoreData[_local1].name;
_local2.tl["level" + _local1].text = _local2.highScoreData[_local1].level;
_local1++;
}
_local2.blocker._visible = false;
};
Highscore.prototype.startUpdate = function (score, name, level) {
var _local1 = this;
trace("updating highscore");
_local1.newscore = score;
_local1.newname = name;
_local1.newlevel = level;
_local1.highScoreData = new Array();
_local1.loadVars();
};
Highscore.prototype.afterLoad = function () {
var _local1 = this;
trace("after load");
if (_local1.addEntry(_local1.newscore, _local1.newname, _local1.newlevel)) {
trace("aufgenommen!!");
_local1.saveVars();
_local1.displayHighscore();
} else {
trace("nicht aufgenommen!!");
_local1.displayHighscore();
}
};
Highscore.prototype.loadVars = function () {
var _local1 = this;
trace("loading");
_local1.score = new LoadVars();
_local1.score.main = _local1;
_local1.score.onLoad = _local1.onLoadVars;
_local1.score.load(_local1.serverUrl + "load.php", "POST");
};
Highscore.prototype.onLoadVars = function () {
var _local3 = _global;
var str = unescape(this);
trace("this: " + this);
var sArray = str.split("_");
var _local2 = 0;
while (_local2 < _local3.highscore.maxEntries) {
var _local1 = sArray[_local2].split("-");
trace((((("name: " + _local1[0]) + " score: ") + _local1[1]) + " level: ") + _local1[2]);
_local3.highscore.highScoreData.push({name:_local1[1], score:Number(_local1[0]), level:Number(_local1[2])});
_local2++;
}
_local3.highscore.afterLoad();
};
Highscore.prototype.addEntry = function (score, name, level) {
var _local2 = this;
var _local3 = name;
trace((((("checking score: " + score) + " name: ") + _local3) + " level: ") + level);
if (!_local2.checkEntry(score)) {
return(false);
}
var l = _local2.maxEntries;
var _local1 = 0;
while (_local1 < l) {
if (_local2.highScoreData[_local1].score < score) {
_local2.highScoreData.splice(_local1, 0, {name:_local3, score:score, level:level});
return(true);
}
_local1++;
}
return(false);
};
Highscore.prototype.checkEntry = function (score) {
var _local1 = this;
var l = _local1.maxEntries;
if (_local1.highScoreData[_local1.maxEntries - 1].score < score) {
return(true);
}
return(false);
};
Highscore.prototype.saveVars = function () {
var _local2 = this;
var _local3 = "";
var _local1 = 0;
while (_local1 < _local2.maxEntries) {
_local3 = _local3 + _local2.highScoreData[_local1].score;
_local3 = _local3 + ("-" + _local2.highScoreData[_local1].name);
_local3 = _local3 + ("-" + _local2.highScoreData[_local1].level);
_local3 = _local3 + "_";
_local1++;
}
trace("saving: " + _local3);
_local2.score = new LoadVars();
_local2.score.str = _local3;
_local2.score.sendAndLoad(_local2.serverUrl + "save.php", _local2.score);
};
stop();
Frame 59
stopAllSounds();
Frame 89
_global.gameInit = new GameInit(this);
stop();
Frame 90
stop();
Frame 91
play();
Frame 109
_quality = "HIGH";
stopAllSounds();
Frame 180
_root.fin_score_str = "Final score: " + _global.player_points;
stop();
Symbol 11 MovieClip Frame 1
var gameBytesTotal = 0;
var gameBytesLoaded = 0;
var percent = 0;
Symbol 11 MovieClip Frame 3
gameBytesTotal = _root.getBytesTotal();
gameBytesLoaded = _root.getBytesLoaded();
percent = Math.round((gameBytesLoaded / gameBytesTotal) * 100);
bar.loadbar._xscale = percent;
if (((gameBytesLoaded >= gameBytesTotal) && (gameBytesTotal > 0)) && (_root.logo._currentframe >= _root.logo._totalframes)) {
_root.gotoAndPlay("start");
stop();
} else {
gotoAndPlay ("preload");
}
Symbol 14 Button
on (press) {
getURL (_root.main_link, "_blank");
}
Symbol 66 MovieClip Frame 1
_root.loading._visible = false;
Symbol 66 MovieClip Frame 134
_root.loading._visible = true;
stop();
Symbol 77 MovieClip [antitreffer_old] Frame 9
this.removeMovieClip();
Symbol 80 MovieClip [antitreffer] Frame 5
this.removeMovieClip();
Symbol 83 MovieClip [huelse] Frame 12
this.removeMovieClip();
Symbol 99 MovieClip [messer] Frame 10
gotoAndPlay (1);
Symbol 106 MovieClip Frame 1
stop();
Symbol 113 Button
on (press) {
getURL (_root.bang_head_link, "_blank");
}
Symbol 131 Button
on (press) {
getURL (_root.main_link, "_blank");
}
Symbol 140 Button
on (release) {
_quality = "HIGH";
play();
}
Symbol 144 Button
on (press) {
getURL (_root.main_link, "_blank");
}
Symbol 148 Button
on (press) {
getURL (_root.viewscores_link, "_blank");
}
Symbol 152 Button
on (press) {
getURL (_root.download_link, "_blank");
}
Symbol 163 MovieClip Frame 6
stop();
Symbol 180 MovieClip Frame 15
stop();
Symbol 187 MovieClip Frame 10
stop();
Symbol 196 MovieClip Frame 10
stop();
Symbol 205 MovieClip Frame 10
stop();
Symbol 216 MovieClip Frame 1
stop();
Symbol 216 MovieClip Frame 7
stop();
Symbol 216 MovieClip Frame 14
stop();
Symbol 216 MovieClip Frame 26
wurf_ani.gotoAndPlay(1);
Symbol 216 MovieClip Frame 41
stop();
Symbol 216 MovieClip Frame 64
gotoAndStop (1);
Symbol 216 MovieClip Frame 75
gotoAndStop (1);
Symbol 218 MovieClip Frame 1
this.d1 = new Dwarf(this.zwerg_baum_01);
this.d2 = new Dwarf(this.zwerg_baum_02);
this.d3 = new Dwarf(this.zwerg_baum_03);
stop();
Symbol 261 MovieClip Frame 11
stop();
Symbol 268 MovieClip Frame 1
stop();
Symbol 268 MovieClip Frame 12
stop();
Symbol 268 MovieClip Frame 26
stop();
Symbol 268 MovieClip Frame 39
stop();
Symbol 268 MovieClip Frame 61
gotoAndStop (1);
Symbol 268 MovieClip Frame 78
gotoAndStop (1);
Symbol 269 MovieClip Frame 1
this.d1 = new Dwarf(this.zwerg_teich);
stop();
Symbol 276 MovieClip Frame 11
stop();
Symbol 287 MovieClip Frame 10
stop();
Symbol 288 MovieClip Frame 1
stop();
Symbol 288 MovieClip Frame 7
stop();
Symbol 288 MovieClip Frame 14
stop();
Symbol 288 MovieClip Frame 26
wurf_ani.gotoAndPlay(1);
Symbol 288 MovieClip Frame 41
stop();
Symbol 288 MovieClip Frame 64
gotoAndStop (1);
Symbol 288 MovieClip Frame 75
gotoAndStop (1);
Symbol 290 MovieClip Frame 1
this.d1 = new Dwarf(this.zwerg_golem01);
this.d2 = new Dwarf(this.zwerg_golem02);
stop();
Symbol 292 MovieClip Frame 1
this.d1 = new Dwarf(this.zwerg_1);
this.d2 = new Dwarf(this.zwerg_2);
stop();
Symbol 295 MovieClip Frame 1
this.d1 = new Dwarf(this.zwerg_berg_1);
this.d2 = new Dwarf(this.zwerg_berg_2);
stop();
Symbol 303 MovieClip Frame 1
stop();
Symbol 303 MovieClip Frame 100
stop();
Symbol 343 MovieClip Frame 1
stop();
Symbol 343 MovieClip Frame 40
gotoAndStop (1);
Symbol 343 MovieClip Frame 92
gotoAndStop (1);
Symbol 343 MovieClip Frame 143
stop();
Symbol 343 MovieClip Frame 195
gotoAndStop (1);
Symbol 343 MovieClip Frame 248
gotoAndStop (1);
Symbol 343 MovieClip Frame 282
gotoAndStop (1);
Symbol 343 MovieClip Frame 308
gotoAndStop (1);
Symbol 343 MovieClip Frame 334
gotoAndStop (1);
Symbol 343 MovieClip Frame 357
gotoAndStop (1);
Symbol 343 MovieClip Frame 378
gotoAndStop (1);
Symbol 349 MovieClip Frame 1
stop();
Symbol 362 MovieClip Frame 1
stop();
Symbol 362 MovieClip Frame 2
stop();
Symbol 362 MovieClip Frame 3
stop();
Symbol 362 MovieClip Frame 4
stop();
Symbol 362 MovieClip Frame 5
stop();
Symbol 362 MovieClip Frame 6
stop();
Symbol 365 MovieClip Frame 1
stop();
Symbol 365 MovieClip Frame 7
stop();
Symbol 365 MovieClip Frame 12
gotoAndStop (1);
Symbol 378 Button
on (press) {
getURL (_root.main_link, "_blank");
}
Symbol 385 MovieClip Frame 1
stop();
Symbol 385 MovieClip Frame 6
gotoAndPlay ("los");
Symbol 385 MovieClip Frame 9
_parent.stop();
Symbol 385 MovieClip Frame 40
gotoAndStop (1);
_parent.gotoAndStop(2);
Symbol 386 MovieClip Frame 1
this.u1 = new UFO(this.ufo2);
Symbol 386 MovieClip Frame 2
stop();
Symbol 386 MovieClip Frame 115
this.u1.onSurvived();
ufo2.gotoAndStop(1);
gotoAndStop (2);
Symbol 421 MovieClip Frame 1
stop();
Symbol 421 MovieClip Frame 12
gotoAndPlay ("los");
Symbol 421 MovieClip Frame 14
_parent.stop();
Symbol 421 MovieClip Frame 27
gotoAndStop (1);
_parent.gotoAndStop(2);
Symbol 421 MovieClip Frame 28
_parent.stop();
Symbol 421 MovieClip Frame 45
gotoAndStop (1);
_parent.gotoAndStop(2);
Symbol 422 MovieClip Frame 1
this.d1 = new RunDwarf(this.zwerg_laeufer_02);
stop();
Symbol 422 MovieClip Frame 2
stop();
Symbol 422 MovieClip Frame 82
gotoAndStop (2);
this.d1.onSurvived();
zwerg_laeufer_02.gotoAndStop(1);
Symbol 456 MovieClip Frame 1
stop();
Symbol 456 MovieClip Frame 8
gotoAndPlay ("los");
Symbol 456 MovieClip Frame 9
_parent.stop();
Symbol 456 MovieClip Frame 44
_parent.gotoAndStop(2);
Symbol 461 MovieClip Frame 1
this.cc = new CrazyCat(this.racer2);
stop();
Symbol 461 MovieClip Frame 2
stop();
Symbol 461 MovieClip Frame 48
this.cc.onPlayerHit();
Symbol 461 MovieClip Frame 53
gotoAndStop (2);
Symbol 469 MovieClip Frame 1
stop();
Symbol 469 MovieClip Frame 4
stop();
Symbol 469 MovieClip Frame 14
_parent.gotoAndStop(2);
gotoAndStop (1);
Symbol 470 MovieClip Frame 1
this.b = new Ballon(this.speed2);
Symbol 470 MovieClip Frame 2
stop();
Symbol 470 MovieClip Frame 110
this.b.onSurvived();
speed2.gotoAndStop(1);
gotoAndStop (2);
Symbol 473 MovieClip Frame 1
_global.terrain.register(100, [this.plane_1_1, this.plane_1_2, this.plane_1_3]);
_global.terrain.register(80, [this.plane_2_1]);
_global.terrain.register(60, [this.plane_3_1, this.plane_3_2, this.plane_3_3]);
_global.terrain.register(50, [this.plane_4_1, this.plane_4_2, this.plane_4_3, this.plane_4_4]);
_global.terrain.register(30, [this.plane_5_1]);
Symbol 484 Button
on (release) {
gotoAndStop (53);
}
Symbol 503 Button
on (press) {
getURL (_root.bang_head_link, "_blank");
}
Symbol 505 Button
on (press) {
var hashkey = _root.hex_md5(("gameid=1256&hiscore=" + _global.player_points) + "2DPlay.com/");
getURL (String(((_root.scores_link + _global.player_points) + "&hash=") + hashkey), "_blank");
}