Frame 1
if (!music) {
music = new Sound();
music.attachSound("music");
}
stop();
Frame 2
function setPlaying(what) {
playing = what;
}
function loadLevel(l) {
setPlaying(false);
if (_root.deploy[l]) {
frags = 0;
dirge._x = 276;
dirge._y = 350;
dirge.setWalking(true);
dirge.setStaggering(false);
dirge.setSwinging(false);
level = l;
_root.ground.gotoAndStop(level);
interface.countdown.gotoAndPlay(1);
} else {
trace("YOU WIN");
unloadGame();
_root.gotoAndStop("youwin");
}
}
function unloadGame() {
interface.removeMovieClip();
raven.removeMovieClip();
dirge.removeMovieClip();
levels.removeMovieClip();
music.stop();
for (i in zsort) {
if (i != -1) {
zsort[i].removeMovieClip();
}
}
}
function levelClear() {
_root.playing = false;
_root.interface.levelclear.play();
}
function zSorter() {
for (i in zsort) {
if (zsort[i] != -1) {
zsort[i].swapDepths(zsort[i]._y);
}
}
}
function addZombie(species, level) {
switch (species) {
case 1 :
var zombie = _root.attachMovie("zombie" + species, ("zombie" + species) + _root.depth, _root.depth++, {species:1, level:1});
break;
case 2 :
var zombie = _root.attachMovie("zombie" + species, ("zombie" + species) + _root.depth, _root.depth++, {species:2, level:1});
break;
case 3 :
var zombie = _root.attachMovie("zombie" + species, ("zombie" + species) + _root.depth, _root.depth++, {species:3, level:1});
}
zombie.enemyNum = _root.enemies.length;
_root.enemies[_root.enemies.length] = zombie;
zombie.zNum = _root.zsort.length;
_root.zsort[_root.zsort.length] = zombie;
}
function SpeciesType(p, st, h, sp) {
this.points = p;
this.strength = st;
this.health = h;
this.speed = sp;
}
function Zombie() {
this.points = _root.species[this.species - 1].points;
this.strength = _root.species[this.species - 1].strength * (1 + (this.level / 2));
this.health = _root.species[this.species - 1].health * (1 + (this.level / 2));
this.speed = _root.species[this.species - 1].speed * (1 + (this.level / 2));
this.alive = true;
this.walking = true;
this.swinging = false;
this.damage = 0;
this.rand = Math.random;
this.round = Math.round;
this.sin = Math.sin;
this.cos = Math.cos;
this.atan2 = Math.atan2;
this.PI = Math.PI;
this.sqrt = Math.sqrt;
this.abs = Math.abs;
this.r2D = function (r) {
return(r / (this.PI / 180));
};
this.Init();
}
Zombie.prototype = new MovieClip();
Zombie.prototype.Init = function (species, level) {
trace("MADE A ZOMBIE");
};
Zombie.prototype.onLoad = function () {
this._y = -100 + (this.rand() * 50);
this._x = 550 - (this.rand() * 550);
};
Zombie.prototype.onEnterFrame = function () {
if ((_root.playing && (this.isAlive())) && (!this.isSwinging())) {
this.doWalk();
if ((this.abs(this._x - _root.dirge._x) < (this._width / 2)) && (this.abs(_root.dirge._y - this._y) < 32)) {
this.setSwinging(true);
}
if ((this.abs(this._x - _root.raven._x) < (this._width / 2)) && (this.abs(_root.raven._y - this._y) < 45)) {
this.setSwinging(true);
}
}
};
Zombie.prototype.setAlive = function (what) {
this.alive = what;
};
Zombie.prototype.isAlive = function () {
return(this.alive);
};
Zombie.prototype.isWalking = function () {
return(this.walking);
};
Zombie.prototype.setWalking = function (what) {
this.walking = what;
if (what) {
this.zombie.gotoAndPlay("walk");
}
};
Zombie.prototype.doWalk = function () {
if (!this.isWalking()) {
this.setWalking(true);
}
var dY = (_root.raven._y - this._y);
var dX = (_root.raven._x - this._x);
var dD = this.atan2(dY, dX);
var dDeg = this.r2D(dD);
var dHyp = this.sqrt((dY * dY) + (dX * dX));
this._x = this._x + (this.cos(dD) * this.speed);
this._y = this._y + (this.sin(dD) * this.speed);
};
Zombie.prototype.dropEnbalm = function (x, y) {
trace((("DROP ENBALMING FLUID:" + x) + " : ") + y);
var enbalm = _root.attachMovie("enbalm", "enbalm" + _root.depth, _root.depth++);
enbalm._x = x;
enbalm._y = y;
enbalm.vialNum = _root.enbalms.length;
_root.enbalms[_root.enbalms.length] = enbalm;
enbalm.zNum = _root.zsort.length;
_root.zsort[_root.zsort.length] = enbalm;
};
Zombie.prototype.isSwinging = function () {
return(this.swinging);
};
Zombie.prototype.setSwinging = function (what) {
if (!this.isAlive()) {
return(undefined);
}
if (!what) {
this.swinging = false;
this.setWalking(true);
} else if (_root.dirge.isAlive()) {
this.zombie.gotoAndPlay("swipe");
this.swinging = true;
}
};
Zombie.prototype.doDamage = function (amount) {
if (this.isAlive()) {
this.damage = this.damage + amount;
if (this.damage >= this.health) {
this.doKill();
} else {
this._y = this._y - 20;
}
}
};
Zombie.prototype.doHurt = function () {
trace("HIT YOU");
_root.dirge.doDamage(this.strength);
};
Zombie.prototype.doHurtRaven = function () {
trace("HIT RAVEN");
_root.raven.doDie();
};
Zombie.prototype.doKill = function () {
this.setAlive(false);
this.zombie.gotoAndPlay("kill");
if (this.rand() > 0.8) {
this.dropEnbalm(this._x, this._y);
}
_root.frags = _root.frags + 1;
_root.points = _root.points + this.points;
if (_root.frags >= deploy[_root.level].length) {
levelClear();
}
};
Zombie.prototype.removeClip = function () {
trace("Removing clip " + this._name);
_root.zsort[this.zNum] = -1;
this.removeMovieClip();
};
Object.registerClass("zombie1", Zombie);
Object.registerClass("zombie2", Zombie);
Object.registerClass("zombie3", Zombie);
depth = 10;
species = new array();
species[0] = new SpeciesType(100, 10, 25, 1.5);
species[1] = new SpeciesType(200, 10, 15, 1.25);
species[2] = new SpeciesType(300, 15, 55, 0.75);
playing = 0;
levelstart = 0;
frags = 0;
level = 0;
points = 0;
deploy = new array();
enemies = new array();
enbalms = new array();
zsort = new array();
music.start(0, 999);
interface = _root.attachMovie("interface", "interface", 998);
interface._x = 0;
interface._y = 0;
raven = _root.attachMovie("raven", "raven", 999);
raven._x = 280;
raven._y = 441;
dirge = _root.attachMovie("dirge", "dirge", 997);
dirge._x = 276;
dirge._y = 350;
dirge._xscale = (dirge._yscale = 25);
levels = _root.attachMovie("levels", "levels", 990);
zsort[0] = dirge;
Frame 3
loadLevel(1);
stop();
Frame 4
stop();
Symbol 30 MovieClip [raven] Frame 1
this.doDie = function () {
_root.playing = false;
_root.interface.gameover.play();
};
stop();
Symbol 36 MovieClip [enbalm] Frame 1
stop();
Instance of Symbol 34 MovieClip in Symbol 36 MovieClip [enbalm] Frame 1
onClipEvent (enterFrame) {
if ((Math.abs(_parent._x - _root.dirge._x) < (_parent._width / 2)) && (Math.abs(_root.dirge._y - _parent._y) < (_parent._height / 2))) {
_root.dirge.powerUp();
_parent.gotoAndPlay("pickup");
}
}
Symbol 36 MovieClip [enbalm] Frame 9
_root.zsort[this.zNum] = -1;
this.removeMovieClip();
stop();
Symbol 61 MovieClip Frame 1
this.abs = Math.abs;
this.onEnterFrame = function () {
var point = new Object();
point.x = hitarea._x;
point.y = hitarea._y;
localToGlobal(point);
for (i in _parent._parent._parent.enemies) {
if ((this.abs(_parent._parent._parent.enemies[i]._x - point.x) < (this._width / 2)) && (this.abs((_parent._parent._parent.enemies[i]._y - 60) - point.y) < (this._height / 2))) {
this._parent._parent.doHurt(i);
}
}
};
stop();
Symbol 76 MovieClip Frame 19
gotoAndPlay (1);
Symbol 76 MovieClip Frame 34
_parent.setSwinging(false);
Symbol 76 MovieClip Frame 50
_parent.setSwinging(false);
Symbol 76 MovieClip Frame 62
gotoAndPlay (56);
Symbol 76 MovieClip Frame 100
stop();
Symbol 76 MovieClip Frame 116
_parent.setStaggering(false);
Symbol 77 MovieClip [dirge] Frame 1
this.speed = 5;
this.health = 100;
this.alive = true;
this.walking = false;
this.swinging = false;
this.staggering = false;
this.damage = 0;
this.strength = 15;
this.rand = Math.random;
this.round = Math.round;
this.sin = Math.sin;
this.cos = Math.cos;
this.atan2 = Math.atan2;
this.PI = Math.PI;
this.sqrt = Math.sqrt;
this.abs = Math.abs;
this.r2D = function (r) {
return(r / (this.PI / 180));
};
this.onEnterFrame = function () {
if (_root.playing) {
if ((this.isAlive() && (!this.isSwinging())) && (!this.isStaggering())) {
var dX = (this._parent._xmouse - this._x);
var dY = (this._parent._ymouse - this._y);
if ((dX && (this.abs(dX) > 15)) || (dY && (this.abs(dY) > 15))) {
this.doWalk();
} else if (this.isWalking()) {
this.setWalking(false);
}
}
_root.zSorter();
} else if (this.isAlive() && (this.isWalking())) {
this.setWalking(false);
}
};
this.onMouseDown = function () {
if (_root.playing && (!this.isSwinging())) {
this.setSwinging(true);
}
};
this.setAlive = function (what) {
this.alive = what;
};
this.isAlive = function () {
return(this.alive);
};
this.isWalking = function () {
return(this.walking);
};
this.setWalking = function (what) {
this.walking = what;
if (!what) {
(dirge.gotoAndPlay("idle"));// not popped
} else {
(dirge.gotoAndPlay("walk"));// not popped
}
};
this.doWalk = function () {
if (!this.isWalking()) {
this.setWalking(true);
}
var mY = this._ymouse;
var mX = this._xmouse;
var mD = this.atan2(mY, mX);
var mDeg = r2D(mD);
this._x = this._x + (this.cos(mD) * this.speed);
this._y = this._y + (this.sin(mD) * this.speed);
};
this.isSwinging = function () {
return(this.swinging);
};
this.setSwinging = function (what) {
if (!this.isAlive()) {
return(undefined);
}
if (!what) {
this.setWalking(true);
if (!this.isWalking()) {
(dirge.gotoAndPlay("idle"));// not popped
} else {
(dirge.gotoAndPlay("walk"));// not popped
}
this.swinging = false;
} else {
this.setStaggering(false);
var swing = (1 + round(rand() * 1));
dirge.gotoAndPlay("swing" + swing);
this.swinging = true;
}
};
this.powerUp = function () {
this.damage = this.damage - 10;
_parent.interface.setDamage(this.damage / this.health);
};
this.isStaggering = function () {
return(this.staggering);
};
this.setStaggering = function (what) {
this.staggering = what;
if (!what) {
this.setWalking(true);
if (!this.isWalking()) {
(dirge.gotoAndPlay("idle"));// not popped
} else {
(dirge.gotoAndPlay("walk"));// not popped
}
} else {
this.setSwinging(false);
dirge.gotoAndPlay("owshiat");
}
};
this.doHurt = function (enemy) {
trace("HIT ZOMBIE: " + enemy);
_parent.enemies[enemy].doDamage(this.strength);
};
this.setDamage = function (amount) {
this.damage = amount;
_parent.interface.setDamage(this.damage / this.health);
};
this.doDamage = function (amount) {
if (!this.isAlive()) {
return(undefined);
}
this.damage = this.damage + amount;
((this._y < 400) ? ((this._y = this._y + 50)) : ((this._y = 450)));
this.setStaggering(true);
_parent.interface.setDamage(this.damage / this.health);
if ((this.damage / this.health) >= 1) {
this.doDie();
}
};
this.doDie = function () {
_root.playing = false;
this.setAlive(false);
dirge.gotoAndPlay("die");
_root.interface.gameover.play();
};
stop();
Symbol 100 MovieClip Frame 28
if (!_parent.isAlive()) {
gotoAndPlay (65);
} else {
gotoAndPlay (1);
}
Symbol 100 MovieClip Frame 48
if ((_parent.abs(_parent._x - _root.dirge._x) < (_parent._width / 2)) && (_parent.abs(_root.dirge._y - _parent._y) < 30)) {
_parent.doHurt();
}
if ((_parent.abs(_parent._x - _root.raven._x) < (_parent._width / 2)) && (_parent.abs(_root.raven._y - _parent._y) < 30)) {
_parent.doHurtRaven();
}
Symbol 100 MovieClip Frame 59
_parent.setSwinging(false);
Symbol 100 MovieClip Frame 88
_parent.removeClip();
stop();
Symbol 110 MovieClip Frame 12
if (!_parent.isAlive()) {
gotoAndPlay (46);
} else {
gotoAndPlay (1);
}
Symbol 110 MovieClip Frame 24
if ((_parent.abs(_parent._x - _root.dirge._x) < (_parent._width / 2)) && (_parent.abs(_root.dirge._y - _parent._y) < 30)) {
_parent.doHurt();
}
if ((_parent.abs(_parent._x - _root.raven._x) < (_parent._width / 2)) && (_parent.abs(_root.raven._y - _parent._y) < 30)) {
_parent.doHurtRaven();
}
Symbol 110 MovieClip Frame 31
_parent.setSwinging(false);
Symbol 110 MovieClip Frame 67
_parent.removeClip();
stop();
Symbol 115 MovieClip Frame 17
if (!_parent.isAlive()) {
gotoAndPlay (46);
} else {
gotoAndPlay (1);
}
Symbol 115 MovieClip Frame 28
if ((_parent.abs(_parent._x - _root.dirge._x) < (_parent._width / 2)) && (_parent.abs(_root.dirge._y - _parent._y) < 30)) {
_parent.doHurt();
}
if ((_parent.abs(_parent._x - _root.raven._x) < (_parent._width / 2)) && (_parent.abs(_root.raven._y - _parent._y) < 30)) {
_parent.doHurtRaven();
}
Symbol 115 MovieClip Frame 36
_parent.setSwinging(false);
Symbol 115 MovieClip Frame 67
_parent.removeClip();
stop();
Symbol 137 Button
on (release) {
_root.gotoAndPlay("menu");
_root.unloadGame();
}
Symbol 142 Button
on (release) {
_root.gotoAndPlay("game");
_root.unloadGame();
}
Symbol 146 MovieClip Frame 1
stop();
Symbol 146 MovieClip Frame 15
stop();
Symbol 157 MovieClip Frame 1
Symbol 157 MovieClip Frame 115
_root.levelstart = getTimer();
_root.playing = true;
stop();
Symbol 162 MovieClip Frame 1
stop();
Symbol 162 MovieClip Frame 92
_root.loadLevel(++_root.level);
Symbol 184 MovieClip Frame 1
stop();
Symbol 187 MovieClip [interface] Frame 1
this.round = Math.round;
this.setDamage = function (ratio) {
this.damage.gotoAndStop(1 + this.round(ratio * 10));
};
this.addPoints = function (points) {
this.pointsstr = (this.pointsstr * 1) + points;
};
this.setLevel = function (level) {
this.level = level;
};
stop();
Symbol 188 MovieClip [levels] Frame 1
function resurect(l, s, t) {
this.resurected = false;
this.species = s;
this.time = t;
if (!_root.deploy[l]) {
_root.deploy[l] = new array();
}
_root.deploy[l][_root.deploy[l].length] = this;
}
this.onEnterFrame = function () {
if (_root.playing) {
ltime = (getTimer() - _root.levelstart) / 1000;
for (i in _root.deploy[_root.level]) {
if (_root.deploy[_root.level][i].time <= ltime) {
if (!_root.deploy[_root.level][i].resurected) {
trace((("ZOMBIE RESURECTED: " + _root.levelstart) + " :: ") + ltime);
_root.addZombie(_root.deploy[_root.level][i].species, 1);
_root.deploy[_root.level][i].resurected = true;
}
}
}
}
};
new resurect(1, 1, 1);
new resurect(1, 1, 2);
new resurect(1, 2, 10);
new resurect(1, 1, 20);
new resurect(1, 3, 25);
new resurect(1, 2, 30);
new resurect(1, 1, 40);
new resurect(1, 2, 42);
new resurect(1, 3, 42);
new resurect(2, 2, 1);
new resurect(2, 2, 1);
new resurect(2, 1, 5);
new resurect(2, 3, 10);
new resurect(2, 3, 10);
new resurect(2, 2, 13);
new resurect(2, 1, 20);
new resurect(2, 1, 22);
new resurect(2, 3, 25);
new resurect(2, 1, 30);
new resurect(2, 1, 30);
new resurect(3, 1, 1);
new resurect(3, 2, 1);
new resurect(3, 2, 5);
new resurect(3, 2, 10);
new resurect(3, 3, 10);
new resurect(3, 3, 13);
new resurect(3, 1, 20);
new resurect(3, 2, 22);
new resurect(3, 2, 25);
new resurect(3, 1, 30);
new resurect(3, 3, 30);
new resurect(4, 1, 1);
new resurect(4, 1, 1);
new resurect(4, 1, 5);
new resurect(4, 2, 10);
new resurect(4, 2, 10);
new resurect(4, 2, 13);
new resurect(4, 1, 20);
new resurect(4, 2, 22);
new resurect(4, 3, 25);
new resurect(4, 3, 30);
new resurect(4, 3, 30);
new resurect(5, 2, 1);
new resurect(5, 2, 1);
new resurect(5, 2, 5);
new resurect(5, 2, 10);
new resurect(5, 1, 10);
new resurect(5, 1, 13);
new resurect(5, 1, 20);
new resurect(5, 2, 22);
new resurect(5, 2, 25);
new resurect(5, 1, 30);
new resurect(5, 3, 30);
new resurect(6, 1, 1);
new resurect(6, 2, 1);
new resurect(6, 3, 5);
new resurect(6, 1, 10);
new resurect(6, 2, 10);
new resurect(6, 3, 13);
new resurect(6, 1, 20);
new resurect(6, 2, 22);
new resurect(6, 3, 25);
new resurect(6, 1, 30);
new resurect(6, 2, 30);
new resurect(7, 1, 1);
new resurect(7, 2, 1);
new resurect(7, 2, 5);
new resurect(7, 2, 10);
new resurect(7, 2, 10);
new resurect(7, 2, 13);
new resurect(7, 3, 20);
new resurect(7, 2, 22);
new resurect(7, 2, 25);
new resurect(7, 1, 30);
new resurect(7, 3, 30);
new resurect(8, 1, 1);
new resurect(8, 2, 1);
new resurect(8, 2, 5);
new resurect(8, 2, 10);
new resurect(8, 3, 10);
new resurect(8, 3, 13);
new resurect(8, 1, 20);
new resurect(8, 2, 22);
new resurect(8, 3, 25);
new resurect(8, 1, 30);
new resurect(8, 3, 30);
new resurect(9, 1, 1);
new resurect(9, 2, 1);
new resurect(9, 3, 5);
new resurect(9, 3, 10);
new resurect(9, 3, 10);
new resurect(9, 1, 13);
new resurect(9, 1, 20);
new resurect(9, 3, 22);
new resurect(9, 2, 25);
new resurect(9, 1, 30);
new resurect(9, 3, 30);
new resurect(10, 1, 1);
new resurect(10, 2, 1);
new resurect(10, 3, 5);
new resurect(10, 3, 10);
new resurect(10, 3, 10);
new resurect(10, 3, 13);
new resurect(10, 3, 20);
new resurect(10, 3, 22);
new resurect(10, 3, 25);
new resurect(10, 3, 30);
new resurect(10, 1, 30);
stop();
Symbol 206 Button
on (release) {
_root.play();
}
Symbol 210 Button
on (release) {
gotoAndPlay (9);
}
Symbol 223 Button
on (release) {
gotoAndStop (1);
}
Symbol 224 MovieClip Frame 6
stop();
Symbol 224 MovieClip Frame 31
stop();
Symbol 225 MovieClip Frame 1
stop();
Symbol 248 Button
on (release) {
_root.gotoAndStop("menu");
}
Symbol 249 Button
on (release) {
_root.gotoAndPlay("game");
}
Symbol 250 MovieClip Frame 1
stop();
Symbol 252 MovieClip Frame 86
stop();