Section 1
//BeamLazor (bullets.BeamLazor)
package bullets {
import flash.display.*;
public class BeamLazor extends Bullet {
var boom:Boolean;// = false
public var hitbox:MovieClip;
var o:Number;// = 0
var splinters:Number;
var time:Number;// = 0
public function BeamLazor(x:Number, y:Number, angle:Number){
time = 0;
o = 0;
boom = false;
addFrameScript(6, frame7);
super(x, y, NaN, NaN, angle, 0);
this.time = time;
small = false;
stop();
time = 0;
}
override function hitPlayer(){
if (((hitbox) && (hitbox.hitTestPoint(player.x, player.y, true)))){
player.hit();
};
}
function frame7(){
if (this){
kill();
};
}
override function special(){
time++;
if (time == 37){
nextFrame();
};
if (time == 40){
nextFrame();
};
if (time == 77){
prevFrame();
};
if (time == 80){
prevFrame();
};
if (time == 83){
gotoAndPlay(4);
};
}
}
}//package bullets
Section 2
//BigWhiteBullet (bullets.BigWhiteBullet)
package bullets {
import flash.display.*;
public class BigWhiteBullet extends Bullet {
public var hitbox:MovieClip;
public function BigWhiteBullet(x:Number, y:Number, xspeed:Number=NaN, yspeed:Number=NaN, angle:Number=NaN, speed:Number=NaN){
super(x, y, xspeed, yspeed, angle, speed);
glow();
}
override function hitPlayer(){
if (hitbox.hitTestPoint(player.x, player.y, true)){
player.hit();
kill();
};
}
}
}//package bullets
Section 3
//BlueBullet (bullets.BlueBullet)
package bullets {
import flash.display.*;
public class BlueBullet extends Bullet {
public var hitbox:MovieClip;
public function BlueBullet(x:Number, y:Number, xspeed:Number=NaN, yspeed:Number=NaN, angle:Number=NaN, speed:Number=NaN){
super(x, y, xspeed, yspeed, angle, speed);
glow();
}
override function hitPlayer(){
if (hitbox.hitTestPoint(player.x, player.y, true)){
player.hit();
kill();
};
}
}
}//package bullets
Section 4
//BlueWave (bullets.BlueWave)
package bullets {
import flash.display.*;
public class BlueWave extends Bullet {
public var hitbox:MovieClip;
public function BlueWave(x:Number, y:Number, xspeed:Number=NaN, yspeed:Number=NaN, angle:Number=NaN, speed:Number=NaN){
super(x, y, xspeed, yspeed, angle, speed);
this.size = 25;
glow();
}
override function hitPlayer(){
if (hitbox.hitTestPoint(player.x, player.y, true)){
player.hit();
kill();
};
}
}
}//package bullets
Section 5
//BubbleBall (bullets.BubbleBall)
package bullets {
import flash.display.*;
public class BubbleBall extends Bullet {
public var hitbox:MovieClip;
var t:int;// = 0
var acc:Number;// = 0.1
public function BubbleBall(x:Number, y:Number, xspeed:Number=NaN, yspeed:Number=NaN, angle:Number=NaN, speed:Number=NaN){
acc = 0.1;
t = 0;
super(x, y, xspeed, yspeed, angle, speed);
glow();
}
override function hitPlayer(){
if (hitbox.hitTestPoint(player.x, player.y, true)){
player.hit();
};
}
override function special(){
t++;
if ((t % 13) == 0){
parent.addChild(new BubbleBullet2(x, y, NaN, NaN, this.rotation, 3));
parent.addChild(new BubbleBullet2(x, y, NaN, NaN, (this.rotation + 180), 3));
};
}
}
}//package bullets
Section 6
//BubbleBall2 (bullets.BubbleBall2)
package bullets {
import levels.*;
import flash.display.*;
public class BubbleBall2 extends Bullet {
var distance:Number;
var an:Number;
public var hitbox:MovieClip;
var t:int;// = 0
var ang:Number;
public function BubbleBall2(x:Number, y:Number, an:Number, distance:Number){
t = 0;
super(x, y);
this.an = an;
size = 10000;
glow();
this.distance = distance;
}
override function hitPlayer(){
if (((hitbox) && (hitbox.hitTestPoint(player.x, player.y, true)))){
player.hit();
};
}
override function death(){
var a:Number;
dead = true;
stop();
a = 0;
while (a < 15) {
parent.addChild(new GodBullet(x, y, (Math.random() * 360), ((Math.random() * 3) + 3)));
a++;
};
}
override function special(){
t++;
an = (an + 1);
ang = ((an * Math.PI) / 180);
this.x = ((parent as Level).player.x + (Math.cos(ang) * distance));
this.y = ((parent as Level).player.y + (Math.sin(ang) * distance));
if (x > 500){
x = 500;
};
if (y > 600){
y = 600;
};
if (y < 0){
y = 0;
};
if (x < 0){
x = 0;
};
if ((t % 3) == 0){
parent.addChild(new GodBullet(x, y, (t * 9), 2));
parent.addChild(new BubbleBullet2(x, y, NaN, NaN, ((t * 9) + 180), 2));
};
return (false);
}
}
}//package bullets
Section 7
//BubbleBall3 (bullets.BubbleBall3)
package bullets {
import levels.*;
import flash.display.*;
public class BubbleBall3 extends Bullet {
var distance:Number;
var an:Number;
public var hitbox:MovieClip;
var t:int;// = 0
var ang:Number;
public function BubbleBall3(x:Number, y:Number, an:Number, distance:Number){
t = 0;
super(x, y);
this.an = an;
size = 10000;
glow();
this.distance = distance;
}
override function hitPlayer(){
if (((hitbox) && (hitbox.hitTestPoint(player.x, player.y, true)))){
player.hit();
};
}
override function death(){
dead = true;
stop();
}
override function special(){
var b:int;
t++;
this.x = (((parent as Level).player.x - 400) + (800 * an));
this.y = (parent as Level).player.y;
if (x > 500){
x = 500;
};
if (y > 600){
y = 600;
};
if (y < 0){
y = 0;
};
if (x < 0){
x = 0;
};
if ((t % 35) == 0){
b = 0;
while (b < 360) {
parent.addChild(new BubbleBullet2(x, y, NaN, NaN, b, 3));
b = (b + 30);
};
};
if ((t % 5) == 0){
parent.addChild(new BlueWave(x, y, NaN, NaN, ((getAngle(x, y) + (Math.random() * 120)) - 60), 2));
};
return (false);
}
}
}//package bullets
Section 8
//BubbleBullet (bullets.BubbleBullet)
package bullets {
import flash.display.*;
public class BubbleBullet extends Bullet {
public var hitbox:MovieClip;
public function BubbleBullet(x:Number, y:Number, xspeed:Number=NaN, yspeed:Number=NaN, angle:Number=NaN, speed:Number=NaN){
super(x, y, xspeed, yspeed, angle, speed);
glow();
this.size = 25;
}
override function hitPlayer(){
if (hitbox.hitTestPoint(player.x, player.y, true)){
player.hit();
kill();
};
}
}
}//package bullets
Section 9
//BubbleBullet2 (bullets.BubbleBullet2)
package bullets {
import flash.display.*;
public class BubbleBullet2 extends Bullet {
public var hitbox:MovieClip;
public function BubbleBullet2(x:Number, y:Number, xspeed:Number=NaN, yspeed:Number=NaN, angle:Number=NaN, speed:Number=NaN){
super(x, y, xspeed, yspeed, angle, speed);
glow();
this.scaleX = (this.scaleX * (this.scaleY = (this.scaleY * (0.7 + (Math.random() / 3)))));
this.size = 20;
}
override function hitPlayer(){
if (hitbox.hitTestPoint(player.x, player.y, true)){
player.hit();
kill();
};
}
}
}//package bullets
Section 10
//Bullet (bullets.Bullet)
package bullets {
import levels.*;
import flash.display.*;
import players.*;
import flash.geom.*;
public class Bullet extends MovieClip {
public var size:Number;// = 10
public var small:Boolean;// = true
public var hitbo:MovieClip;
public var dead:Boolean;// = false
public var yspeed:Number;
public var bounce:Number;// = 0
public var xspeed:Number;
public var player:Player;
public function Bullet(x:Number, y:Number, xspeed:Number=NaN, yspeed:Number=NaN, angle:Number=INF, speed:Number=NaN, spin:Number=NaN){
bounce = 0;
size = 10;
dead = false;
small = true;
super();
this.x = x;
this.y = y;
if (angle == Infinity){
this.xspeed = xspeed;
this.yspeed = yspeed;
} else {
this.rotation = Math.floor((angle - 90));
angle = (angle * (Math.PI / 180));
this.xspeed = (Math.cos(angle) * speed);
this.yspeed = (Math.sin(angle) * speed);
};
Global.vars.bulletArray.push(this);
cacheAsBitmap = true;
Global.vars.bullets++;
}
public function getAngle(x:Number, y:Number):Number{
var player:Player;
var n:Number;
player = (parent as Level).player;
n = ((Math.atan(((y - player.y) / (x - player.x))) / Math.PI) * 180);
if (x >= player.x){
return ((n + 180));
};
return (n);
}
function hitPlayer(){
if (hitbo.hitTestPoint(player.x, player.y, true)){
player.hit();
kill();
};
}
public function kill(){
Global.vars.bullets--;
death();
dead = true;
stop();
if (this){
parent.removeChild(this);
};
Global.vars.bulletArray.splice(Global.vars.bulletArray.indexOf(this), 1);
}
function death(){
}
function setBounce(b:Number){
this.bounce = b;
}
public function glow(){
if (Global.vars.options[1]){
stop();
} else {
gotoAndStop(2);
};
}
function special(){
}
function bounceOff(){
if (bounce == 0){
kill();
} else {
bounce--;
x = (x + xspeed);
y = (y + yspeed);
};
}
public function move(){
x = (x + xspeed);
y = (y + yspeed);
player = (parent as Level).player;
special();
if ((((((y < -(size))) || ((y > (600 + size))))) || ((parent as Level).gameOff))){
kill();
} else {
if ((((x > (500 + size))) || ((x < -(size))))){
kill();
} else {
hitPlayer();
};
};
}
}
}//package bullets
Section 11
//DemonBullet (bullets.DemonBullet)
package bullets {
import flash.display.*;
public class DemonBullet extends Bullet {
public var hitbox:MovieClip;
public function DemonBullet(x:Number, y:Number, xspeed:Number=NaN, yspeed:Number=NaN, angle:Number=NaN, speed:Number=NaN){
super(x, y, xspeed, yspeed, angle, speed);
size = 40;
small = false;
glow();
}
override function hitPlayer(){
if (hitbox.hitTestPoint(player.x, player.y, true)){
player.hit();
};
}
}
}//package bullets
Section 12
//DevilBall (bullets.DevilBall)
package bullets {
import flash.display.*;
public class DevilBall extends Bullet {
public var hitbox:MovieClip;
var acc:Number;// = 0.3
var time:int;// = 150
public function DevilBall(x:Number, y:Number, angle:Number, speed:Number){
time = 150;
acc = 0.3;
addFrameScript(0, frame1, 2, frame3);
super(x, y, NaN, NaN, angle, speed);
size = 400;
small = false;
}
function death2(){
var a:Number;
a = 0;
while (a < 360) {
parent.addChild(new DevilBullet2(x, y, a, 5));
a = (a + 20);
};
play();
}
override function hitPlayer(){
if (((hitbox) && (hitbox.hitTestPoint(player.x, player.y, true)))){
player.hit();
};
}
function frame3(){
if (this){
kill();
};
}
function frame1(){
stop();
}
override function special(){
if (x > player.x){
xspeed = (xspeed - acc);
};
if (x < player.x){
xspeed = (xspeed + acc);
};
if (y > player.y){
yspeed = (yspeed - acc);
};
if (y < player.y){
yspeed = (yspeed + acc);
};
yspeed = (yspeed * 0.97);
xspeed = (xspeed * 0.97);
if ((time % 8) == 0){
parent.addChild(new DevilBullet(x, y, (Math.random() * 360), 3));
};
time--;
if (time == 0){
this.death2();
};
}
}
}//package bullets
Section 13
//DevilBullet (bullets.DevilBullet)
package bullets {
import flash.display.*;
public class DevilBullet extends Bullet {
public var hitbox:MovieClip;
public function DevilBullet(x:Number, y:Number, angle:Number, speed:Number){
super(x, y, NaN, NaN, angle, speed);
glow();
}
override function hitPlayer(){
if (hitbox.hitTestPoint(player.x, player.y, true)){
player.hit();
kill();
};
}
}
}//package bullets
Section 14
//DevilBullet2 (bullets.DevilBullet2)
package bullets {
import flash.display.*;
public class DevilBullet2 extends Bullet {
public var hitbox:MovieClip;
public function DevilBullet2(x:Number, y:Number, angle:Number, speed:Number){
super(x, y, NaN, NaN, angle, speed);
glow();
}
override function hitPlayer(){
if (hitbox.hitTestPoint(player.x, player.y, true)){
player.hit();
kill();
};
}
}
}//package bullets
Section 15
//DevilBullet3 (bullets.DevilBullet3)
package bullets {
import flash.display.*;
public class DevilBullet3 extends Bullet {
public var hitbox:MovieClip;
var bounc:int;// = 1
public function DevilBullet3(x:Number, y:Number, angle:Number, speed:Number){
bounc = 1;
super(x, y, NaN, NaN, angle, speed);
glow();
size = 20;
bounc = 1;
}
override function hitPlayer(){
if (hitbox.hitTestPoint(player.x, player.y, true)){
player.hit();
kill();
};
}
override function special(){
if (bounc > 0){
if (y < -5){
y = 605;
bounc--;
};
if (y > 605){
y = -5;
bounc--;
};
if (x < -5){
x = 505;
bounc--;
};
if (x > 505){
x = -5;
bounc--;
};
};
}
}
}//package bullets
Section 16
//DualBall (bullets.DualBall)
package bullets {
import flash.display.*;
public class DualBall extends Bullet {
public var hitbox:MovieClip;
var acc:Number;// = 0.2
var time:int;// = 90
public function DualBall(x:Number, y:Number, angle:Number, speed:Number){
time = 90;
acc = 0.2;
addFrameScript(0, frame1, 2, frame3);
super(x, y, NaN, NaN, angle, speed);
size = 400;
small = false;
}
function death2(){
var a:Number;
a = 0;
while (a < 360) {
parent.addChild(new GodBullet2(x, y, a, 3));
parent.addChild(new RedBullet(x, y, NaN, NaN, (a + 10), 8));
a = (a + 20);
};
play();
}
override function hitPlayer(){
if (((hitbox) && (hitbox.hitTestPoint(player.x, player.y, true)))){
player.hit();
};
}
function frame3(){
if (this){
kill();
};
}
function frame1(){
stop();
}
override function special(){
if ((time % 8) == 0){
parent.addChild(new SmallRedBullet(x, y, NaN, NaN, (Math.random() * 360), 3));
};
if ((time % 4) == 0){
parent.addChild(new GodBullet(x, y, (Math.random() * 360), 2));
};
time--;
if (time == 0){
this.death2();
};
}
}
}//package bullets
Section 17
//FlameBullet (bullets.FlameBullet)
package bullets {
import flash.display.*;
public class FlameBullet extends Bullet {
public var hitbox:MovieClip;
public function FlameBullet(x:Number, y:Number, xspeed:Number=NaN, yspeed:Number=NaN, angle:Number=NaN, speed:Number=NaN){
super(x, y, xspeed, yspeed, angle, speed);
glow();
}
override function hitPlayer(){
if (hitbox.hitTestPoint(player.x, player.y, true)){
player.hit();
kill();
};
}
}
}//package bullets
Section 18
//GlowBall (bullets.GlowBall)
package bullets {
import flash.display.*;
public class GlowBall extends Bullet {
public var hitbox:MovieClip;
public function GlowBall(x:Number, y:Number, angle:Number, speed:Number){
super(x, y, NaN, NaN, angle, speed);
size = 60;
small = false;
glow();
}
override function hitPlayer(){
if (hitbox.hitTestPoint(player.x, player.y, true)){
player.hit();
};
}
}
}//package bullets
Section 19
//GodBall (bullets.GodBall)
package bullets {
import flash.display.*;
public class GodBall extends Bullet {
public var hitbox:MovieClip;
public function GodBall(x:Number, y:Number, angle:Number, speed:Number){
super(x, y, NaN, NaN, angle, speed);
size = 60;
small = false;
glow();
}
override function hitPlayer(){
if (hitbox.hitTestPoint(player.x, player.y, true)){
player.hit();
};
}
}
}//package bullets
Section 20
//GodBall2 (bullets.GodBall2)
package bullets {
public class GodBall2 extends Bullet {
var acc:Number;// = 0.2
var time:int;// = 180
public function GodBall2(x:Number, y:Number, angle:Number, speed:Number){
time = 180;
acc = 0.2;
addFrameScript(0, frame1, 1, frame2);
super(x, y, NaN, NaN, angle, speed);
size = 700;
small = false;
glow();
}
override function hitPlayer(){
}
function frame1(){
stop();
}
override function special(){
if (x > 500){
x = 500;
};
if (y > 600){
y = 600;
};
if (y < 0){
y = 0;
};
if (x < 0){
x = 0;
};
if (x > player.x){
xspeed = (xspeed - acc);
};
if (x < player.x){
xspeed = (xspeed + acc);
};
if (y > player.y){
yspeed = (yspeed - acc);
};
if (y < player.y){
yspeed = (yspeed + acc);
};
yspeed = (yspeed * 0.95);
xspeed = (xspeed * 0.95);
parent.addChild(new GodBullet2(x, y, ((time * 7) % 360), 3.5));
parent.addChild(new PurpleBullet(x, y, NaN, NaN, ((time * 7) % 360), 4.5));
time--;
}
function frame2(){
if (this){
kill();
};
}
}
}//package bullets
Section 21
//GodBullet (bullets.GodBullet)
package bullets {
import flash.display.*;
public class GodBullet extends Bullet {
public var hitbox:MovieClip;
public function GodBullet(x:Number, y:Number, angle:Number, speed:Number){
super(x, y, NaN, NaN, angle, speed);
glow();
}
override function hitPlayer(){
if (hitbox.hitTestPoint(player.x, player.y, true)){
player.hit();
kill();
};
}
}
}//package bullets
Section 22
//GodBullet2 (bullets.GodBullet2)
package bullets {
import flash.display.*;
public class GodBullet2 extends Bullet {
public var hitbox:MovieClip;
public function GodBullet2(x:Number, y:Number, angle:Number, speed:Number){
super(x, y, NaN, NaN, angle, speed);
glow();
}
override function hitPlayer(){
if (hitbox.hitTestPoint(player.x, player.y, true)){
player.hit();
kill();
};
}
}
}//package bullets
Section 23
//GodBullet3 (bullets.GodBullet3)
package bullets {
public class GodBullet3 extends GodBullet {
var bounc:int;// = 1
public function GodBullet3(x:Number, y:Number, angle:Number, speed:Number){
bounc = 1;
super(x, y, angle, speed);
size = 20;
bounc = 1;
glow();
}
override function hitPlayer(){
if (hitbox.hitTestPoint(player.x, player.y, true)){
player.hit();
kill();
};
}
override function special(){
if (bounc > 0){
if (y < 0){
yspeed = (yspeed * -1);
bounc--;
};
};
}
}
}//package bullets
Section 24
//GodDiamond (bullets.GodDiamond)
package bullets {
import flash.display.*;
public class GodDiamond extends Bullet {
public var hitbox:MovieClip;
public function GodDiamond(x:Number, y:Number, angle:Number, speed:Number){
super(x, y, NaN, NaN, angle, speed);
glow();
}
override function hitPlayer(){
if (hitbox.hitTestPoint(player.x, player.y, true)){
player.hit();
kill();
};
}
}
}//package bullets
Section 25
//GreenBall (bullets.GreenBall)
package bullets {
import flash.display.*;
public class GreenBall extends Bullet {
public var hitbox:MovieClip;
public function GreenBall(x:Number, y:Number, angle:Number, speed:Number){
super(x, y, NaN, NaN, angle, speed);
size = 50;
small = false;
glow();
}
override function hitPlayer(){
if (hitbox.hitTestPoint(player.x, player.y, true)){
player.hit();
};
}
}
}//package bullets
Section 26
//GreenBullet (bullets.GreenBullet)
package bullets {
import flash.display.*;
public class GreenBullet extends Bullet {
var speedy:Number;
var speedx:Number;
public var hitbox:MovieClip;
var time:int;
public function GreenBullet(x:Number, y:Number, angle:Number, speed:Number, time:int){
super(x, y, NaN, NaN, angle, speed);
size = 50;
this.time = time;
small = false;
glow();
speedx = xspeed;
speedy = yspeed;
}
override function hitPlayer(){
if (hitbox.hitTestPoint(player.x, player.y, true)){
player.hit();
kill();
};
}
override function special(){
if (time > 0){
xspeed = (xspeed * 0.95);
yspeed = (yspeed * 0.95);
};
time--;
if (time == 0){
xspeed = speedx;
yspeed = speedy;
};
}
}
}//package bullets
Section 27
//GreenSlimeBullet (bullets.GreenSlimeBullet)
package bullets {
import flash.display.*;
public class GreenSlimeBullet extends Bullet {
public var hitbox:MovieClip;
public function GreenSlimeBullet(x:Number, y:Number, xspeed:Number=NaN, yspeed:Number=NaN, angle:Number=NaN, speed:Number=NaN){
super(x, y, xspeed, yspeed, angle, speed);
glow();
}
override function hitPlayer(){
if (hitbox.hitTestPoint(player.x, player.y, true)){
player.hit();
kill();
};
}
}
}//package bullets
Section 28
//HomingBullet (bullets.HomingBullet)
package bullets {
import levels.*;
import flash.display.*;
public class HomingBullet extends Bullet {
public var hitbox:MovieClip;
var acc:Number;// = 0.2
public function HomingBullet(a:Number, b:Number, c:Number, d:Number){
acc = 0.2;
super(a, b, c, d);
width = (width * 1.5);
height = (height * 1.5);
glow();
}
override function hitPlayer(){
if (hitbox.hitTestPoint(player.x, player.y, true)){
player.hit();
kill();
};
}
override public function move(){
player = (parent as Level).player;
if (x > player.x){
xspeed = (xspeed - acc);
};
if (x < player.x){
xspeed = (xspeed + acc);
};
if (y > player.y){
yspeed = (yspeed - acc);
};
if (y < player.y){
yspeed = (yspeed + acc);
};
x = (x + xspeed);
y = (y + yspeed);
if ((((x > (parent as Level).xlimit)) || ((x < 0)))){
kill();
} else {
if ((((((y > (parent as Level).ylimit)) || ((y < 0)))) || ((parent as Level).gameOff))){
kill();
} else {
hitPlayer();
};
};
}
}
}//package bullets
Section 29
//HugeDevilBullet (bullets.HugeDevilBullet)
package bullets {
import flash.display.*;
public class HugeDevilBullet extends Bullet {
public var hitbox:MovieClip;
public function HugeDevilBullet(x:Number, y:Number, angle:Number, speed:Number){
var scale:Number;
super(x, y, NaN, NaN, angle, speed);
scale = (1 - (Math.random() / 3));
this.scaleX = (this.scaleX * scale);
this.scaleY = (this.scaleY * scale);
size = 100;
small = false;
glow();
}
override function hitPlayer(){
if (hitbox.hitTestPoint(player.x, player.y, true)){
player.hit();
};
}
}
}//package bullets
Section 30
//HugeOrangeBullet (bullets.HugeOrangeBullet)
package bullets {
import flash.display.*;
public class HugeOrangeBullet extends Bullet {
public var hitbox:MovieClip;
public function HugeOrangeBullet(x:Number, y:Number, angle:Number, speed:Number){
var scale:Number;
super(x, y, NaN, NaN, angle, speed);
scale = (1.1 - (Math.random() / 3));
this.scaleX = (this.scaleX * scale);
this.scaleY = (this.scaleY * scale);
size = 100;
small = false;
glow();
}
override function hitPlayer(){
if (hitbox.hitTestPoint(player.x, player.y, true)){
player.hit();
};
}
}
}//package bullets
Section 31
//HugeRedBullet (bullets.HugeRedBullet)
package bullets {
import flash.display.*;
public class HugeRedBullet extends Bullet {
public var hitbox:MovieClip;
public function HugeRedBullet(x:Number, y:Number, angle:Number, speed:Number){
var scale:Number;
super(x, y, NaN, NaN, angle, speed);
scale = (1.2 - (Math.random() / 2));
this.scaleX = (this.scaleX * scale);
this.scaleY = (this.scaleY * scale);
size = 100;
small = false;
glow();
}
override function hitPlayer(){
if (hitbox.hitTestPoint(player.x, player.y, true)){
player.hit();
};
}
}
}//package bullets
Section 32
//LeafBullet (bullets.LeafBullet)
package bullets {
import flash.display.*;
public class LeafBullet extends Bullet {
public var hitbox:MovieClip;
public function LeafBullet(x:Number, y:Number, xspeed:Number=NaN, yspeed:Number=NaN, angle:Number=NaN, speed:Number=NaN){
super(x, y, xspeed, yspeed, angle, speed);
glow();
}
override function hitPlayer(){
if (hitbox.hitTestPoint(player.x, player.y, true)){
player.hit();
kill();
};
}
}
}//package bullets
Section 33
//OrangeBomb (bullets.OrangeBomb)
package bullets {
import flash.display.*;
public class OrangeBomb extends Bullet {
var boom:Boolean;// = false
public var hitbox:MovieClip;
var o:Number;// = 0
var splinters:Number;
var time:Number;// = 0
public function OrangeBomb(x:Number, y:Number, xspeed:Number=NaN, yspeed:Number=NaN, angle:Number=NaN, speed:Number=NaN, time:int=60, splinters:int=4){
time = 0;
o = 0;
boom = false;
addFrameScript(5, frame6, 26, frame27);
super(x, y, xspeed, yspeed, angle, speed);
this.time = time;
this.splinters = splinters;
small = false;
}
override function hitPlayer(){
if (((hitbox) && (hitbox.hitTestPoint(player.x, player.y, true)))){
player.hit();
};
}
function frame6(){
stop();
}
override function death(){
var a:Number;
boom = true;
size = 10000;
play();
a = 0;
while (a < splinters) {
if (((this) && (parent))){
parent.addChild(new OrangeBullet(x, y, NaN, NaN, (Math.random() * 360), ((Math.random() * 3) + 3)));
};
a++;
};
}
function frame27(){
if (this){
kill();
};
}
override function special(){
time--;
if (time == 0){
death();
};
if (boom){
x = (x - xspeed);
y = (y - yspeed);
};
}
}
}//package bullets
Section 34
//OrangeBullet (bullets.OrangeBullet)
package bullets {
import flash.display.*;
public class OrangeBullet extends Bullet {
public var hitbox:MovieClip;
public function OrangeBullet(x:Number, y:Number, xspeed:Number=NaN, yspeed:Number=NaN, angle:Number=NaN, speed:Number=NaN){
super(x, y, xspeed, yspeed, angle, speed);
glow();
}
override function hitPlayer(){
if (hitbox.hitTestPoint(player.x, player.y, true)){
player.hit();
kill();
};
}
}
}//package bullets
Section 35
//OrangeLazor (bullets.OrangeLazor)
package bullets {
import flash.display.*;
public class OrangeLazor extends Bullet {
public var hitbox:MovieClip;
public function OrangeLazor(x:Number, y:Number, xspeed:Number=NaN, yspeed:Number=NaN, angle:Number=NaN, speed:Number=NaN){
super(x, y, xspeed, yspeed, angle, speed);
glow();
}
override function hitPlayer(){
if (hitbox.hitTestPoint(player.x, player.y, true)){
player.hit();
kill();
};
}
}
}//package bullets
Section 36
//OrbitBall (bullets.OrbitBall)
package bullets {
import levels.*;
import flash.display.*;
public class OrbitBall extends Bullet {
var distance:Number;
var an:Number;
public var hitbox:MovieClip;
var t:int;// = 0
var ang:Number;
public function OrbitBall(x:Number, y:Number, an:Number, distance:Number){
t = 0;
addFrameScript(12, frame13, 23, frame24);
super(x, y);
this.an = an;
size = 10000;
this.distance = distance;
}
override function hitPlayer(){
if (((hitbox) && (hitbox.hitTestPoint(player.x, player.y, true)))){
player.hit();
};
}
function frame13(){
stop();
}
function frame24(){
if (this){
kill();
};
}
override function death(){
var a:Number;
dead = true;
stop();
a = 0;
while (a < 30) {
parent.addChild(new OrangeBullet(x, y, NaN, NaN, (Math.random() * 360), ((Math.random() * 3) + 3)));
a++;
};
}
override function special(){
t++;
an = (an + 3);
ang = ((an * Math.PI) / 180);
this.x = ((parent as Level).player.x + (Math.cos(ang) * distance));
this.y = ((parent as Level).player.y + (Math.sin(ang) * distance));
if (x > 500){
x = 500;
};
if (y > 600){
y = 600;
};
if (y < 0){
y = 0;
};
if (x < 0){
x = 0;
};
if ((t % 4) == 0){
parent.addChild(new OrangeBullet(x, y, NaN, NaN, getAngle(x, y), 2));
parent.addChild(new OrangeBullet(x, y, NaN, NaN, -(getAngle(x, y)), 2));
parent.addChild(new OrangeBullet(x, y, NaN, NaN, getAngle(x, y), -2));
parent.addChild(new OrangeBullet(x, y, NaN, NaN, -(getAngle(x, y)), -2));
};
return (false);
}
}
}//package bullets
Section 37
//PinkBullet (bullets.PinkBullet)
package bullets {
import flash.display.*;
public class PinkBullet extends Bullet {
public var hitbox:MovieClip;
public function PinkBullet(x:Number, y:Number, xspeed:Number=NaN, yspeed:Number=NaN, angle:Number=NaN, speed:Number=NaN){
super(x, y, xspeed, yspeed);
this.scaleX = (this.scaleX * (this.scaleY = (this.scaleY * (0.5 + (Math.random() / 2)))));
this.x = (this.x + ((Math.random() * 30) - 15));
this.y = (this.y + ((Math.random() * 30) - 15));
glow();
}
override function hitPlayer(){
if (hitbox.hitTestPoint(player.x, player.y, true)){
player.hit();
kill();
};
}
}
}//package bullets
Section 38
//PurpleBall (bullets.PurpleBall)
package bullets {
import flash.display.*;
public class PurpleBall extends Bullet {
public var hitbox:MovieClip;
var acc:Number;// = 0.3
public function PurpleBall(x:Number, y:Number, xspeed:Number=NaN, yspeed:Number=NaN, angle:Number=NaN, speed:Number=NaN){
acc = 0.3;
addFrameScript(108, frame109);
super(x, y, xspeed, yspeed, angle, speed);
size = 200;
}
override function hitPlayer(){
if (((hitbox) && (hitbox.hitTestPoint(player.x, player.y, true)))){
player.hit();
};
}
function frame109(){
if (this){
kill();
};
}
override function special(){
if (x > player.x){
xspeed = (xspeed - acc);
};
if (x < player.x){
xspeed = (xspeed + acc);
};
if (y > player.y){
yspeed = (yspeed - acc);
};
if (y < player.y){
yspeed = (yspeed + acc);
};
yspeed = (yspeed * 0.97);
xspeed = (xspeed * 0.97);
}
}
}//package bullets
Section 39
//PurpleBullet (bullets.PurpleBullet)
package bullets {
import flash.display.*;
public class PurpleBullet extends Bullet {
public var hitbox:MovieClip;
public function PurpleBullet(x:Number, y:Number, xspeed:Number=NaN, yspeed:Number=NaN, angle:Number=NaN, speed:Number=NaN){
super(x, y, xspeed, yspeed, angle, speed);
glow();
}
override function hitPlayer(){
if (hitbox.hitTestPoint(player.x, player.y, true)){
player.hit();
kill();
};
}
}
}//package bullets
Section 40
//RedBullet (bullets.RedBullet)
package bullets {
import flash.display.*;
public class RedBullet extends Bullet {
public var hitbox:MovieClip;
public function RedBullet(x:Number, y:Number, xspeed:Number=NaN, yspeed:Number=NaN, angle:Number=NaN, speed:Number=NaN){
super(x, y, xspeed, yspeed, angle, speed);
glow();
}
override function hitPlayer(){
if (hitbox.hitTestPoint(player.x, player.y, true)){
player.hit();
kill();
};
}
}
}//package bullets
Section 41
//RedDiamond (bullets.RedDiamond)
package bullets {
import flash.display.*;
public class RedDiamond extends Bullet {
public var hitbox:MovieClip;
public function RedDiamond(x:Number, y:Number, xspeed:Number=NaN, yspeed:Number=NaN, angle:Number=NaN, speed:Number=NaN){
super(x, y, xspeed, yspeed, angle, speed);
glow();
}
override function hitPlayer(){
if (hitbox.hitTestPoint(player.x, player.y, true)){
player.hit();
kill();
};
}
}
}//package bullets
Section 42
//RedLazor (bullets.RedLazor)
package bullets {
import flash.display.*;
public class RedLazor extends Bullet {
public var hitbox:MovieClip;
public function RedLazor(x:Number, y:Number, xspeed:Number=NaN, yspeed:Number=NaN, angle:Number=NaN, speed:Number=NaN){
super(x, y, xspeed, yspeed, angle, speed);
glow();
}
override function hitPlayer(){
if (hitbox.hitTestPoint(player.x, player.y, true)){
player.hit();
kill();
};
}
}
}//package bullets
Section 43
//SmallRedBullet (bullets.SmallRedBullet)
package bullets {
import flash.display.*;
public class SmallRedBullet extends Bullet {
public var hitbox:MovieClip;
public function SmallRedBullet(x:Number, y:Number, xspeed:Number=NaN, yspeed:Number=NaN, angle:Number=NaN, speed:Number=NaN){
super(x, y, xspeed, yspeed, angle, speed);
glow();
}
override function hitPlayer(){
if (hitbox.hitTestPoint(player.x, player.y, true)){
player.hit();
kill();
};
}
}
}//package bullets
Section 44
//SpikeBullet (bullets.SpikeBullet)
package bullets {
import flash.display.*;
public class SpikeBullet extends Bullet {
public var hitbox:MovieClip;
public function SpikeBullet(x:Number, y:Number, xspeed:Number=NaN, yspeed:Number=NaN, angle:Number=NaN, speed:Number=NaN){
super(x, y, xspeed, yspeed, angle, speed);
glow();
}
override function hitPlayer(){
if (hitbox.hitTestPoint(player.x, player.y, true)){
player.hit();
kill();
};
}
}
}//package bullets
Section 45
//SporeBullet (bullets.SporeBullet)
package bullets {
import flash.display.*;
public class SporeBullet extends Bullet {
public var hitbox:MovieClip;
public function SporeBullet(x:Number, y:Number, xspeed:Number=NaN, yspeed:Number=NaN, angle:Number=NaN, speed:Number=NaN){
addFrameScript(54, frame55);
super(x, y, 0, 0);
this.scaleX = (this.scaleX * (this.scaleY = (this.scaleY * (0.5 + (Math.random() / 2)))));
this.x = (this.x + ((Math.random() * 30) - 15));
this.y = (this.y + ((Math.random() * 30) - 15));
}
override function hitPlayer(){
if (((hitbox) && (hitbox.hitTestPoint(player.x, player.y, true)))){
player.hit();
kill();
};
}
function frame55(){
stop();
if (this){
kill();
};
}
}
}//package bullets
Section 46
//ThunderBall (bullets.ThunderBall)
package bullets {
import flash.display.*;
public class ThunderBall extends Bullet {
public var hitbox:MovieClip;
var bounc:int;// = 1
public function ThunderBall(x:Number, y:Number, angle:Number, speed:Number){
bounc = 1;
super(x, y, NaN, NaN, angle, speed);
glow();
size = 50;
bounc = 1;
small = false;
}
override function hitPlayer(){
if (hitbox.hitTestPoint(player.x, player.y, true)){
player.hit();
kill();
};
}
override function special(){
if (bounc > 0){
if (y < -40){
y = 640;
bounc--;
};
if (y > 640){
y = -40;
bounc--;
};
if (x < -40){
x = 540;
bounc--;
};
if (x > 540){
x = -40;
bounc--;
};
};
}
}
}//package bullets
Section 47
//WaveBullet (bullets.WaveBullet)
package bullets {
import flash.display.*;
public class WaveBullet extends Bullet {
public var hitbox:MovieClip;
public function WaveBullet(x:Number, y:Number, xspeed:Number=NaN, yspeed:Number=NaN, angle:Number=NaN, speed:Number=NaN){
super(x, y, xspeed, yspeed, angle, speed);
glow();
}
override function hitPlayer(){
if (hitbox.hitTestPoint(player.x, player.y, true)){
player.hit();
kill();
};
}
}
}//package bullets
Section 48
//WaveBullet2 (bullets.WaveBullet2)
package bullets {
import flash.display.*;
public class WaveBullet2 extends Bullet {
public var hitbox:MovieClip;
public function WaveBullet2(x:Number, y:Number, xspeed:Number=NaN, yspeed:Number=NaN, angle:Number=NaN, speed:Number=NaN){
super(x, y, xspeed, yspeed, angle, speed);
glow();
}
override function hitPlayer(){
if (hitbox.hitTestPoint(player.x, player.y, true)){
player.hit();
kill();
};
}
}
}//package bullets
Section 49
//WhiteBullet (bullets.WhiteBullet)
package bullets {
import flash.display.*;
public class WhiteBullet extends Bullet {
public var hitbox:MovieClip;
public function WhiteBullet(x:Number, y:Number, xspeed:Number=NaN, yspeed:Number=NaN, angle:Number=NaN, speed:Number=NaN){
super(x, y, xspeed, yspeed, angle, speed);
glow();
}
override function hitPlayer(){
if (hitbox.hitTestPoint(player.x, player.y, true)){
player.hit();
kill();
};
}
}
}//package bullets
Section 50
//YellowBall (bullets.YellowBall)
package bullets {
import flash.display.*;
public class YellowBall extends Bullet {
public var hitbox:MovieClip;
var speed:Number;
var bin:Boolean;
var reps:Number;
var time:Number;// = 60
var angle:Number;// = 0
public function YellowBall(x:Number, y:Number, xspeed:Number=NaN, yspeed:Number=NaN, angle:Number=NaN, speed:Number=NaN, reps:Number=3, bin:Boolean=false){
time = 60;
angle = 0;
addFrameScript(4, frame5, 14, frame15);
super(x, y, xspeed, yspeed, angle, speed);
this.angle = angle;
size = 50;
this.speed = speed;
this.reps = reps;
this.bin = bin;
this.scaleX = (this.scaleX * (this.scaleY = (this.scaleY * (0.7 + (0.2 * reps)))));
this.x = (this.x + ((Math.random() * 30) - 15));
this.y = (this.y + ((Math.random() * 30) - 15));
}
override function hitPlayer(){
if (((hitbox) && (hitbox.hitTestPoint(player.x, player.y, true)))){
player.hit();
};
}
function frame5(){
stop();
}
override function special(){
var c:Number;
xspeed = (xspeed * 0.9);
yspeed = (yspeed * 0.9);
time--;
if (time == 0){
play();
if (reps != 0){
c = getAngle(x, y);
parent.addChild(new YellowBall(x, y, NaN, NaN, c, speed, (reps - 1), bin));
if (bin){
parent.addChild(new YellowBall(x, y, NaN, NaN, (c - 30), speed, (reps - 1), bin));
parent.addChild(new YellowBall(x, y, NaN, NaN, (c + 30), speed, (reps - 1), bin));
};
};
};
}
function frame15(){
if (this){
kill();
};
}
}
}//package bullets
Section 51
//YellowBullet (bullets.YellowBullet)
package bullets {
import flash.display.*;
public class YellowBullet extends Bullet {
public var hitbox:MovieClip;
public function YellowBullet(x:Number, y:Number, xspeed:Number=NaN, yspeed:Number=NaN, angle:Number=NaN, speed:Number=NaN){
super(x, y, xspeed, yspeed, angle, speed);
glow();
}
override function hitPlayer(){
if (hitbox.hitTestPoint(player.x, player.y, true)){
player.hit();
kill();
};
}
}
}//package bullets
Section 52
//YellowBullet2 (bullets.YellowBullet2)
package bullets {
import flash.display.*;
public class YellowBullet2 extends Bullet {
public var hitbox:MovieClip;
public function YellowBullet2(x:Number, y:Number, xspeed:Number=NaN, yspeed:Number=NaN, angle:Number=NaN, speed:Number=NaN){
super(x, y, xspeed, yspeed, angle, speed);
glow();
}
override function hitPlayer(){
if (hitbox.hitTestPoint(player.x, player.y, true)){
player.hit();
kill();
};
}
}
}//package bullets
Section 53
//YellowBullet3 (bullets.YellowBullet3)
package bullets {
public class YellowBullet3 extends YellowBullet {
var time2:int;
var speed:Number;
var loops:int;
var time:int;
var angle:Number;
var ang:Number;
public function YellowBullet3(x:Number, y:Number, xspeed:Number=NaN, yspeed:Number=NaN, angle:Number=NaN, speed:Number=NaN, loops:int=5, ang:Number=10, time:int=30){
super(x, y, xspeed, yspeed, angle, speed);
this.loops = loops;
this.ang = ((ang + (Math.random() * 10)) - 5);
this.time = time;
this.time2 = time;
this.speed = speed;
this.angle = angle;
glow();
}
private function duplicate(){
parent.addChild(new YellowBullet3(x, y, NaN, NaN, (angle + ang), this.speed, (loops - 1), ang, time2));
parent.addChild(new YellowBullet3(x, y, NaN, NaN, (angle - ang), this.speed, (loops - 1), ang, time2));
}
override function hitPlayer(){
if (hitbox.hitTestPoint(player.x, player.y, true)){
player.hit();
kill();
};
}
override function special(){
time--;
if ((((time == 0)) && ((loops > 0)))){
duplicate();
death();
};
}
}
}//package bullets
Section 54
//AdLoader (CPMStar.AdLoader)
package CPMStar {
import flash.events.*;
import flash.display.*;
import flash.net.*;
import flash.system.*;
public class AdLoader extends Sprite {
private var contentspotid:String;
private var cpmstarLoader:Loader;
public function AdLoader(contentspotid:String){
super();
this.contentspotid = contentspotid;
addEventListener(Event.ADDED, addedHandler);
}
private function addedHandler(event:Event):void{
var cpmstarViewSWFUrl:String;
var container:DisplayObjectContainer;
removeEventListener(Event.ADDED, addedHandler);
Security.allowDomain("server.cpmstar.com");
cpmstarViewSWFUrl = "http://server.cpmstar.com/adviewas3.swf";
container = parent;
cpmstarLoader = new Loader();
cpmstarLoader.contentLoaderInfo.addEventListener(Event.INIT, dispatchHandler);
cpmstarLoader.contentLoaderInfo.addEventListener(Event.COMPLETE, dispatchHandler);
cpmstarLoader.load(new URLRequest(((cpmstarViewSWFUrl + "?contentspotid=") + contentspotid)));
addChild(cpmstarLoader);
}
private function dispatchHandler(event:Event):void{
dispatchEvent(event);
}
}
}//package CPMStar
Section 55
//Barrier (drops.Barrier)
package drops {
import levels.*;
public class Barrier extends Drop {
public var value:Number;
public function Barrier(x:Number, y:Number){
addFrameScript(0, frame1, 14, frame15);
super(x, y, Infinity, NaN);
}
function frame15(){
kill();
}
function frame1(){
stop();
}
override public function getItem(){
(root as Main).makeSound("shield", "i");
gotoAndPlay("die");
(parent as Level).player.getShield();
}
}
}//package drops
Section 56
//Buff (drops.Buff)
package drops {
import levels.*;
public class Buff extends Drop {
public function Buff(x:Number, y:Number){
addFrameScript(0, frame1, 14, frame15);
super(x, y, Infinity, NaN);
}
function frame15(){
kill();
}
function frame1(){
stop();
}
override public function getItem(){
(root as Main).makeSound("buff", "i");
gotoAndPlay("die");
(parent as Level).player.getBuff();
}
}
}//package drops
Section 57
//Drop (drops.Drop)
package drops {
import levels.*;
import flash.display.*;
import players.*;
public class Drop extends MovieClip {
public var dead:Boolean;// = false
public var yspeed:Number;// = 2
public var taken:Boolean;// = false
public var xspeed:Number;// = 0
var xness:Number;// = 1
public function Drop(x:Number, y:Number, angle:Number=INF, speed:Number=NaN){
xspeed = 0;
yspeed = 2;
taken = false;
dead = false;
xness = 1;
super();
if (angle != Infinity){
angle = (angle * (Math.PI / 180));
this.xspeed = (Math.cos(angle) * speed);
this.yspeed = ((Math.random() * 5) + 1);
};
this.x = x;
this.y = y;
Global.vars.dropArray.push(this);
cacheAsBitmap = true;
}
function hitStuff(){
if ((((parent as Level).player.hitTestPoint(this.x, this.y)) && (!(taken)))){
cacheAsBitmap = false;
taken = true;
getItem();
yspeed = 0;
xspeed = 0;
};
}
public function kill(){
dead = true;
taken = true;
Global.vars.dropArray.splice(Global.vars.dropArray.indexOf(this), 1);
stop();
parent.removeChild(this);
}
public function getItem(){
}
public function onFrame(){
if (!taken){
x = (x + xspeed);
y = (y + yspeed);
};
yspeed = (yspeed + 0.05);
xness = ((parent as Level).player.x - this.x);
if ((((xness > -50)) && ((xness <= 0)))){
xness = -200;
};
if ((((xness < 50)) && ((xness > 0)))){
xness = 200;
};
if (this.y < (parent as Level).player.y){
xspeed = (xspeed + (((800 * (parent as Level).player.magnet) / xness) / (((parent as Level).player.y - this.y) + 20)));
xspeed = (xspeed * 0.92);
} else {
xspeed = (xspeed * 0.96);
};
if (y > ((parent as Level).ylimit + 30)){
kill();
} else {
hitStuff();
};
}
}
}//package drops
Section 58
//Heart (drops.Heart)
package drops {
import levels.*;
public class Heart extends Drop {
public var value:Number;
public function Heart(x:Number, y:Number){
addFrameScript(0, frame1, 14, frame15);
super(x, y, Infinity, NaN);
}
function frame15(){
kill();
}
function frame1(){
stop();
}
override public function getItem(){
(root as Main).makeSound("heart", "i");
gotoAndPlay("die");
(parent as Level).player.getHeart();
}
}
}//package drops
Section 59
//Money (drops.Money)
package drops {
import levels.*;
public class Money extends Drop {
public var value:Number;
public function Money(x:Number, y:Number, type:Number, angle:Number=INF, speed:Number=NaN){
addFrameScript(17, frame18);
super(x, y, angle, speed);
if (type == 1){
value = 1;
gotoAndStop(1);
};
if (type == 2){
value = 2;
gotoAndStop(2);
};
if (type == 3){
value = 5;
gotoAndStop(3);
};
if (type == 4){
value = 10;
gotoAndStop(4);
};
if (type == 5){
value = 20;
gotoAndStop(5);
};
if (type == 6){
value = 30;
gotoAndStop(6);
};
if (type == 7){
value = 50;
gotoAndStop(7);
};
this.alpha = 0.55;
}
function frame18(){
kill();
}
override public function getItem(){
(root as Main).makeSound("money", "i");
gotoAndPlay("die");
(parent as Level).addMoney(value);
}
}
}//package drops
Section 60
//BigBrick (foes.BigBrick)
package foes {
public class BigBrick extends Foe {
var decel:Number;
public function BigBrick(x:Number, y:Number, xspeed:Number, yspeed:Number, motion:Number, type:Number){
addFrameScript(0, frame1, 5, frame6);
super(x, y, xspeed, yspeed, motion);
this.type = type;
setHP(Infinity);
score = 0;
money = 0;
dropRate = 0;
dropChance = 0;
cutoff = 100;
}
function frame6(){
if (!dead){
gotoAndStop(1);
};
}
function frame1(){
stop();
}
}
}//package foes
Section 61
//BigBush (foes.BigBush)
package foes {
import bullets.*;
public class BigBush extends Foe {
var decel:Number;
public function BigBush(x:Number, y:Number, xspeed:Number, yspeed:Number, motion:Number, type:Number){
addFrameScript(0, frame1, 1, frame2, 4, frame5, 6, frame7, 20, frame21);
super(x, y, xspeed, yspeed, motion);
this.delay = type;
setHP(20);
score = 200;
money = 2;
dropRate = 1;
dropChance = 0.1;
}
function frame5(){
if (!dead){
gotoAndStop(1);
};
}
function frame7(){
(root as Main).makeSound("bush2", "f");
}
function frame1(){
stop();
}
function frame2(){
(root as Main).makeSound("bush", "f");
}
function frame21(){
if (this){
kill();
};
}
override function special():Boolean{
if ((t % delay) == 0){
parent.addChild(new LeafBullet(x, y, NaN, NaN, (Math.random() * 360), 3));
};
return (false);
}
}
}//package foes
Section 62
//BigLog (foes.BigLog)
package foes {
import levels.*;
public class BigLog extends Foe {
var b:Number;// = 3
public function BigLog(x:Number, y:Number, xspeed:Number, yspeed:Number, motion:Number, type:Number){
b = 3;
addFrameScript(0, frame1, 1, frame2, 4, frame5, 7, frame8, 11, frame12);
super(x, y, xspeed, yspeed, motion);
this.delay = type;
setHP(12);
score = 100;
money = 2;
dropRate = 0.7;
deathSpin = false;
dropChance = 0;
}
function frame12(){
if (this){
kill();
};
}
function frame5(){
if (!dead){
gotoAndStop(1);
};
}
function frame1(){
stop();
}
override public function death(){
(parent as Level).addFoe(new LeftLog(x, y, -1, yspeed));
(parent as Level).addFoe(new RightLog(x, y, 1, yspeed));
}
function frame2(){
(root as Main).makeSound("log", "f");
}
function frame8(){
(root as Main).makeSound("log2", "f");
}
}
}//package foes
Section 63
//BigRock (foes.BigRock)
package foes {
import levels.*;
public class BigRock extends Foe {
var b:Number;// = 3
public function BigRock(x:Number, y:Number, xspeed:Number, yspeed:Number, motion:Number, type:Number){
b = 3;
addFrameScript(0, frame1, 1, frame2, 4, frame5, 7, frame8, 11, frame12);
super(x, y, xspeed, yspeed, motion);
this.delay = type;
setHP(40);
score = 200;
money = 3;
dropRate = 0.8;
dropChance = 0.1;
deathSpin = false;
}
function frame12(){
if (this){
kill();
};
}
function frame5(){
if (!dead){
gotoAndStop(1);
};
}
function frame1(){
stop();
}
override public function death(){
(parent as Level).addFoe(new MediumRock(((x + (Math.random() * 50)) - 25), ((y + (Math.random() * 50)) - 25), ((Math.random() * 6) - 3), ((Math.random() * 4) + yspeed), 0, 0));
(parent as Level).addFoe(new SmallRock(((x + (Math.random() * 20)) - 10), ((y + (Math.random() * 10)) - 5), (Math.random() * 3), ((Math.random() * 4) + yspeed), 0, 0));
(parent as Level).addFoe(new SmallRock(((x + (Math.random() * 40)) - 20), ((y + (Math.random() * 40)) - 20), ((Math.random() * 6) - 3), ((Math.random() * 4) + yspeed), 0, 0));
(parent as Level).addFoe(new TinyRock(((x + (Math.random() * 40)) - 20), ((y + (Math.random() * 40)) - 20), ((Math.random() * 6) - 3), ((Math.random() * 4) + yspeed), 0, 0));
}
function frame2(){
(root as Main).makeSound("rock3", "f");
}
function frame8(){
(root as Main).makeSound("rock2", "f");
}
}
}//package foes
Section 64
//BigShrub (foes.BigShrub)
package foes {
import bullets.*;
public class BigShrub extends Foe {
var decel:Number;
var p:Number;// = 0
var q:Number;// = 0
public function BigShrub(x:Number, y:Number, xspeed:Number, yspeed:Number, motion:Number, type:Number){
p = 0;
q = 0;
addFrameScript(0, frame1, 1, frame2, 6, frame7, 7, frame8, 21, frame22);
super(x, y, xspeed, yspeed, motion);
this.delay = type;
setHP(1100);
score = 4000;
money = 4;
dropRate = 8;
cutoff = 100;
}
function frame7(){
if (!dead){
gotoAndStop(1);
};
}
function frame22(){
if (this){
kill();
};
}
function frame1(){
stop();
}
function frame2(){
(root as Main).makeSound("bush", "f");
}
function frame8(){
(root as Main).makeSound("bush2", "f");
}
override function special():Boolean{
parent.addChild(new FlameBullet(x, (y + 10), NaN, NaN, p, 4));
parent.addChild(new FlameBullet(x, (y + 10), NaN, NaN, -(p), 4));
p = (p + q);
q = (q + 0.1);
if ((t % 3) == 0){
parent.addChild(new FlameBullet(x, (y + 10), NaN, NaN, ((getAngle(x, y) + (Math.random() * 30)) - 15), 5));
};
return (false);
}
}
}//package foes
Section 65
//BigSlime (foes.BigSlime)
package foes {
import bullets.*;
public class BigSlime extends Foe {
public function BigSlime(x:Number, y:Number, xspeed:Number, yspeed:Number, motion:Number, type:Number){
addFrameScript(0, frame1, 1, frame2, 4, frame5, 6, frame7, 17, frame18);
super(x, y, xspeed, yspeed, motion);
this.type = type;
setHP(900);
score = 2500;
money = 4;
dropRate = 8;
cutoff = 100;
}
function frame18(){
if (this){
kill();
};
}
function frame5(){
if (!dead){
gotoAndStop(1);
};
}
function frame7(){
(root as Main).makeSound("slime2", "f");
}
function frame1(){
stop();
}
override public function death(){
var a:Number;
a = 0;
while (a < 60) {
parent.addChild(new SmallRedBullet(x, (y + 40), NaN, NaN, (Math.random() * 360), (3 + (Math.random() * 3))));
a++;
};
}
function frame2(){
(root as Main).makeSound("slime", "f");
}
override function special():Boolean{
if ((t % delay) < 6){
parent.addChild(new SmallRedBullet(x, (y + 40), NaN, NaN, ((getAngle(x, y) + (Math.random() * 90)) - 45), (2 + (t % delay))));
parent.addChild(new SmallRedBullet(x, (y + 40), NaN, NaN, ((getAngle(x, y) + (Math.random() * 90)) - 45), (2 + ((t % delay) / 2))));
};
return (false);
}
}
}//package foes
Section 66
//Bird (foes.Bird)
package foes {
import bullets.*;
public class Bird extends Foe {
var decel:Number;
public function Bird(x:Number, y:Number, xspeed:Number, yspeed:Number, motion:Number, type:Number){
addFrameScript(0, frame1, 1, frame2, 5, frame6, 6, frame7, 20, frame21);
super(x, y, xspeed, yspeed, motion);
this.type = type;
setHP(55);
score = 300;
money = 3;
dropRate = 5;
dropChance = 0.05;
}
function frame6(){
if (!dead){
gotoAndStop(1);
};
}
function frame7(){
(root as Main).makeSound("bird", "f");
}
function frame1(){
stop();
}
function frame2(){
(root as Main).makeSound("shroom", "f");
}
function frame21(){
if (this){
kill();
};
}
override function special():Boolean{
if ((t % type) == 0){
parent.addChild(new YellowBullet2(x, (y + 10), NaN, NaN, ((getAngle(x, y) + (Math.random() * 60)) - 30), 5));
};
return (false);
}
}
}//package foes
Section 67
//BlueJelly (foes.BlueJelly)
package foes {
import bullets.*;
public class BlueJelly extends Foe {
var decel:Number;
public function BlueJelly(x:Number, y:Number, xspeed:Number, yspeed:Number, motion:Number, type:Number){
addFrameScript(0, frame1, 1, frame2, 4, frame5, 6, frame7, 17, frame18);
super(x, y, xspeed, yspeed, motion);
this.type = type;
setHP(14);
score = 150;
money = 3;
dropRate = 0.5;
dropChance = 0.02;
}
function frame18(){
if (this){
kill();
};
}
function frame5(){
if (!dead){
gotoAndStop(1);
};
}
function frame7(){
(root as Main).makeSound("slime2", "f");
}
function frame1(){
stop();
}
function frame2(){
(root as Main).makeSound("slime", "f");
}
override function special():Boolean{
if ((t % type) < 3){
parent.addChild(new BlueBullet(x, y, NaN, NaN, ((getAngle(x, y) + (Math.random() * 40)) - 20), (4 + Math.random())));
};
return (false);
}
}
}//package foes
Section 68
//BossBot (foes.BossBot)
package foes {
import levels.*;
import bullets.*;
public class BossBot extends Foe {
var decel:Number;
var halt:Boolean;// = true
var b:Number;// = 1
var m:Number;// = 1
var p:Number;// = 0
var o:Number;// = 0
public function BossBot(x:Number, y:Number, xspeed:Number, yspeed:Number, motion:Number, type:Number){
p = 0;
o = 0;
b = 1;
m = 1;
halt = true;
addFrameScript(0, frame1, 1, frame2, 6, frame7, 7, frame8, 32, frame33);
super(x, y, xspeed, yspeed, motion);
this.type = type;
setHP(5000);
this.boom = true;
score = 40000;
money = 5;
dropRate = 20;
dropChance = 1;
cutoff = 150;
deathSpin = false;
}
function frame7(){
if (!dead){
gotoAndStop(1);
};
}
function frame1(){
stop();
}
override public function death(){
(parent as Level).addFoe(new LazorBot(x, y, 8, 0, 2, 20));
(parent as Level).addFoe(new LazorBot(x, y, 5, 0, 2, 20));
(parent as Level).addFoe(new LazorBot(x, y, -8, 0, 2, 20));
(parent as Level).addFoe(new LazorBot(x, y, -5, 0, 2, 20));
}
function frame2(){
(root as Main).makeSound("metal", "f");
}
function frame33(){
if (this){
kill();
};
}
function frame8(){
(root as Main).makeSound("explode", "f");
}
override function special():Boolean{
if ((t % 30) == 0){
(parent as Level).addFoe(new Missile(((Math.random() * 450) + 25), -48, 0, 6));
};
if ((t % 6) == 0){
parent.addChild(new RedLazor((x + 0), (y - 30), NaN, NaN, getAngle(x, y), 5));
parent.addChild(new RedLazor((x + 0), (y + 55), NaN, NaN, getAngle(x, y), 5));
parent.addChild(new RedLazor((x - 40), (y + 15), NaN, NaN, getAngle(x, y), 5));
parent.addChild(new RedLazor((x + 40), (y + 15), NaN, NaN, getAngle(x, y), 5));
};
return (false);
}
}
}//package foes
Section 69
//BossBush (foes.BossBush)
package foes {
import bullets.*;
public class BossBush extends Foe {
var decel:Number;
var p:Number;// = 0
public function BossBush(x:Number, y:Number, xspeed:Number, yspeed:Number, motion:Number, type:Number){
p = 0;
addFrameScript(0, frame1, 1, frame2, 4, frame5, 7, frame8, 21, frame22);
super(x, y, xspeed, yspeed, motion);
this.delay = type;
setHP(300);
score = 5000;
money = 3;
dropRate = 10;
}
function frame5(){
if (!dead){
gotoAndStop(1);
};
}
function frame22(){
if (this){
kill();
};
}
function frame1(){
stop();
}
function frame2(){
(root as Main).makeSound("bush", "f");
}
function frame8(){
(root as Main).makeSound("bush2", "f");
}
override function special():Boolean{
parent.addChild(new LeafBullet((x + 50), (y - 80), NaN, NaN, p, 4));
parent.addChild(new LeafBullet((x - 50), (y - 80), NaN, NaN, -(p), 4));
p = (p + 7);
if ((t % 30) == 0){
parent.addChild(new LeafBullet(((x + (Math.random() * 80)) - 40), ((y + (Math.random() * 80)) - 40), NaN, NaN, ((getAngle(x, y) + (Math.random() * 10)) - 5), 6));
};
return (false);
}
}
}//package foes
Section 70
//Bush (foes.Bush)
package foes {
import bullets.*;
public class Bush extends Foe {
var decel:Number;
public function Bush(x:Number, y:Number, xspeed:Number, yspeed:Number, motion:Number, type:Number){
addFrameScript(0, frame1, 1, frame2, 4, frame5, 6, frame7, 17, frame18);
super(x, y, xspeed, yspeed, motion);
this.type = type;
setHP(3);
score = 50;
money = 1;
dropRate = 0.6;
dropChance = 0.04;
}
function frame18(){
if (this){
kill();
};
}
function frame5(){
if (!dead){
gotoAndStop(1);
};
}
function frame7(){
(root as Main).makeSound("bush2", "f");
}
function frame1(){
stop();
}
function frame2(){
(root as Main).makeSound("bush", "f");
}
override function special():Boolean{
if ((t % type) == 0){
parent.addChild(new LeafBullet(x, y, NaN, NaN, getAngle(x, y), 3));
};
return (false);
}
}
}//package foes
Section 71
//Butterfly (foes.Butterfly)
package foes {
import bullets.*;
public class Butterfly extends Foe {
var decel:Number;
public function Butterfly(x:Number, y:Number, xspeed:Number, yspeed:Number, motion:Number, type:Number){
addFrameScript(0, frame1, 1, frame2, 5, frame6, 6, frame7, 20, frame21);
super(x, y, xspeed, yspeed, motion);
this.type = type;
setHP(15);
score = 150;
money = 3;
dropRate = 1;
}
function frame6(){
if (!dead){
gotoAndStop(1);
};
}
function frame7(){
(root as Main).makeSound("bug2", "f");
}
function frame1(){
stop();
}
function frame2(){
(root as Main).makeSound("bug", "f");
}
function frame21(){
if (this){
kill();
};
}
override function special():Boolean{
if ((t % type) == 0){
parent.addChild(new PurpleBall(x, y, NaN, NaN, getAngle(x, y), 5));
};
return (false);
}
}
}//package foes
Section 72
//Cactus (foes.Cactus)
package foes {
import bullets.*;
public class Cactus extends Foe {
var decel:Number;
public function Cactus(x:Number, y:Number, xspeed:Number, yspeed:Number, motion:Number, type:Number){
addFrameScript(0, frame1, 1, frame2, 4, frame5, 7, frame8, 17, frame18);
super(x, y, xspeed, yspeed, motion);
this.type = type;
setHP(120);
score = 300;
money = 5;
dropRate = 1;
}
function frame18(){
if (this){
kill();
};
}
function frame5(){
if (!dead){
gotoAndStop(1);
};
}
function frame1(){
stop();
}
override public function death(){
var a:int;
a = 2;
while (a > 0) {
parent.addChild(new SpikeBullet(x, y, NaN, NaN, (Math.random() * 360), (3 + (Math.random() * 3))));
a--;
};
a = 6;
while (a > 0) {
parent.addChild(new PinkBullet(x, y, 0, ((Math.random() * 3) + 1)));
a--;
};
}
function frame2(){
(root as Main).makeSound("log", "f");
}
function frame8(){
(root as Main).makeSound("log2", "f");
}
override function special():Boolean{
if ((t % delay) == 0){
parent.addChild(new SpikeBullet(x, y, NaN, NaN, (Math.random() * 360), 6));
};
return (false);
}
}
}//package foes
Section 73
//CatRam (foes.CatRam)
package foes {
import levels.*;
import bullets.*;
public class CatRam extends Foe {
public function CatRam(x:Number, y:Number, xspeed:Number, yspeed:Number, motion:Number, type:Number){
addFrameScript(0, frame1, 1, frame2, 2, frame3, 5, frame6, 7, frame8, 35, frame36);
super(x, y, xspeed, yspeed, motion);
this.type = type;
setHP(33);
score = 100;
money = 3;
dropRate = 1;
deathSpin = false;
}
function frame3(){
(root as Main).makeSound("fort", "f");
}
function frame6(){
if (!dead){
gotoAndStop(1);
};
}
function frame1(){
kitten = (Math.floor((Math.random() * 6)) + 1);
}
override public function death(){
(parent as Level).addFoe(new Kitten(x, y, ((xspeed + (Math.random() * 4)) - 2), yspeed, 0, 0));
(parent as Level).addFoe(new Kitten(x, y, ((xspeed + (Math.random() * 4)) - 2), yspeed, 0, 0));
(parent as Level).addFoe(new Kitten(x, y, xspeed, (yspeed + 1), 0, 0));
}
function frame2(){
stop();
}
function frame36(){
if (this){
kill();
};
}
function frame8(){
(root as Main).makeSound("explode", "f");
}
override function special():Boolean{
if ((t % type) == 0){
parent.addChild(new SmallRedBullet(x, y, NaN, NaN, getAngle(x, y), 5));
parent.addChild(new SmallRedBullet(x, y, NaN, NaN, (getAngle(x, y) + 10), 5));
parent.addChild(new SmallRedBullet(x, y, NaN, NaN, (getAngle(x, y) - 10), 5));
};
return (false);
}
}
}//package foes
Section 74
//Coral (foes.Coral)
package foes {
import bullets.*;
public class Coral extends Foe {
var decel:Number;
var p:Number;// = 0
public function Coral(x:Number, y:Number, xspeed:Number, yspeed:Number, motion:Number, type:Number){
p = 0;
addFrameScript(0, frame1, 1, frame2, 6, frame7, 7, frame8, 20, frame21);
super(x, y, xspeed, yspeed, motion);
this.delay = type;
setHP(1200);
score = 10000;
money = 5;
dropRate = 10;
cutoff = 100;
}
function frame7(){
if (!dead){
gotoAndStop(1);
};
}
function frame1(){
stop();
}
function frame2(){
(root as Main).makeSound("coral", "f");
}
function frame8(){
(root as Main).makeSound("coral2", "f");
}
function frame21(){
if (this){
kill();
};
}
override function special():Boolean{
if ((t % delay) == 0){
parent.addChild(new YellowBall(x, y, NaN, NaN, ((getAngle(x, y) + (Math.random() * 20)) - 10), 15, 4, true));
};
return (false);
}
}
}//package foes
Section 75
//CrossBomb (foes.CrossBomb)
package foes {
import bullets.*;
public class CrossBomb extends Foe {
public function CrossBomb(a:Number, b:Number, c:Number, d:Number){
addFrameScript(0, frame1, 1, frame2, 6, frame7, 7, frame8, 10, frame11);
super(a, b, c, d);
setHP(60);
this.boom = true;
score = 0;
money = 0;
dropRate = 0;
dropChance = 0;
}
function frame7(){
if (!dead){
gotoAndStop(1);
};
}
function frame1(){
stop();
}
override public function death(){
var a:Number;
a = 0;
while (a < 7) {
parent.addChild(new YellowBullet(x, y, NaN, NaN, ((0 + (Math.random() * 20)) - 10), (3 + (Math.random() * 5))));
parent.addChild(new YellowBullet(x, y, NaN, NaN, ((90 + (Math.random() * 20)) - 10), (3 + (Math.random() * 5))));
parent.addChild(new YellowBullet(x, y, NaN, NaN, ((180 + (Math.random() * 20)) - 10), (3 + (Math.random() * 5))));
parent.addChild(new YellowBullet(x, y, NaN, NaN, ((270 + (Math.random() * 20)) - 10), (3 + (Math.random() * 5))));
a++;
};
}
function frame11(){
if (this){
kill();
};
}
function frame2(){
(root as Main).makeSound("metal", "f");
}
function frame8(){
(root as Main).makeSound("explode", "f");
}
override function special():Boolean{
if (this.y > player.y){
return (true);
};
return (false);
}
}
}//package foes
Section 76
//DeadCat (foes.DeadCat)
package foes {
public class DeadCat extends Foe {
public function DeadCat(x:Number, y:Number, xspeed:Number, yspeed:Number, motion:Number, type:Number){
addFrameScript(0, frame1, 1, frame2, 4, frame5, 6, frame7, 20, frame21);
super(x, y, xspeed, yspeed, motion);
this.type = type;
setHP(15);
score = 100;
money = 4;
dropRate = 0.7;
cutoff = 100;
}
function frame5(){
if (!dead){
gotoAndStop(1);
};
}
function frame7(){
(root as Main).makeSound("eye", "f");
}
function frame1(){
stop();
}
function frame2(){
(root as Main).makeSound("eye", "f");
}
function frame21(){
if (this){
kill();
};
}
}
}//package foes
Section 77
//Demon (foes.Demon)
package foes {
import bullets.*;
public class Demon extends Foe {
public function Demon(x:Number, y:Number, xspeed:Number, yspeed:Number, motion:Number, type:Number){
addFrameScript(0, frame1, 1, frame2, 5, frame6, 6, frame7, 31, frame32);
super(x, y, xspeed, yspeed, motion);
this.type = type;
setHP(550);
score = 1000;
money = 6;
dropRate = 4;
dropChance = 0.04;
cutoff = 100;
deathSpin = false;
}
function frame6(){
if (!dead){
gotoAndStop(1);
};
}
function frame7(){
(root as Main).makeSound("demon2", "f");
}
function frame1(){
stop();
}
function frame2(){
(root as Main).makeSound("demon", "f");
}
function frame32(){
if (this){
kill();
};
}
override function special():Boolean{
if (((t % type) * 2) == 0){
parent.addChild(new OrangeBullet((x - 20), (y + 30), NaN, NaN, ((90 + (Math.random() * 30)) - 15), 3));
parent.addChild(new OrangeBullet((x - 20), (y + 30), NaN, NaN, ((90 + (Math.random() * 30)) - 15), 3));
parent.addChild(new DemonBullet((x - 20), (y + 30), NaN, NaN, ((90 + (Math.random() * 30)) - 15), 4));
};
if (((t % type) * 2) == type){
parent.addChild(new OrangeBullet((x + 20), (y + 30), NaN, NaN, ((90 + (Math.random() * 30)) - 15), 3));
parent.addChild(new OrangeBullet((x + 20), (y + 30), NaN, NaN, ((90 + (Math.random() * 30)) - 15), 3));
parent.addChild(new DemonBullet((x + 20), (y + 30), NaN, NaN, ((90 + (Math.random() * 30)) - 15), 4));
};
return (false);
}
}
}//package foes
Section 78
//DoubleBrick (foes.DoubleBrick)
package foes {
public class DoubleBrick extends Foe {
var decel:Number;
public function DoubleBrick(x:Number, y:Number, xspeed:Number, yspeed:Number, motion:Number, type:Number){
addFrameScript(0, frame1, 5, frame6);
super(x, y, xspeed, yspeed, motion);
this.type = type;
setHP(Infinity);
score = 0;
money = 0;
dropRate = 0;
dropChance = 0;
cutoff = 100;
}
function frame6(){
if (!dead){
gotoAndStop(1);
};
}
function frame1(){
stop();
}
}
}//package foes
Section 79
//EyeBall (foes.EyeBall)
package foes {
import bullets.*;
public class EyeBall extends Foe {
var decel:Number;
public function EyeBall(x:Number, y:Number, xspeed:Number, yspeed:Number, motion:Number, type:Number){
addFrameScript(0, frame1, 1, frame2, 4, frame5, 6, frame7, 15, frame16);
super(x, y, xspeed, yspeed, motion);
this.type = type;
setHP(20);
score = 200;
money = 4;
dropRate = 0.5;
dropChance = 0.02;
}
function frame16(){
if (this){
kill();
};
}
function frame5(){
if (!dead){
gotoAndStop(1);
};
}
function frame7(){
(root as Main).makeSound("eye2", "f");
}
function frame1(){
stop();
}
function frame2(){
(root as Main).makeSound("eye", "f");
}
override function special():Boolean{
if ((t % type) < 3){
parent.addChild(new OrangeLazor(x, y, NaN, NaN, getAngle(x, y), (5 + (t % type))));
};
return (false);
}
}
}//package foes
Section 80
//EyeBit (foes.EyeBit)
package foes {
import bullets.*;
public class EyeBit extends Foe {
var b:Number;
public function EyeBit(x:Number, y:Number, xspeed:Number, yspeed:Number, motion:Number, type:Number){
addFrameScript(0, frame1, 1, frame2, 3, frame4, 6, frame7, 14, frame15);
super(x, y, xspeed, yspeed, motion);
this.type = type;
setHP(40);
score = 0;
money = 3;
dropRate = 2;
}
function frame15(){
if (this){
kill();
};
}
function frame4(){
if (!dead){
gotoAndStop(1);
};
}
function frame7(){
(root as Main).makeSound("rock3", "f");
}
function frame1(){
stop();
}
override public function death(){
var a:int;
a = 8;
while (a > 0) {
parent.addChild(new OrangeBullet(x, y, NaN, NaN, (Math.random() * 360), (3 + (Math.random() * 3))));
a--;
};
}
function frame2(){
(root as Main).makeSound("rock4", "f");
}
override function special():Boolean{
return (false);
}
}
}//package foes
Section 81
//EyeGuy (foes.EyeGuy)
package foes {
import levels.*;
import bullets.*;
public class EyeGuy extends Foe {
var b:Number;
public function EyeGuy(x:Number, y:Number, xspeed:Number, yspeed:Number, motion:Number, type:Number){
addFrameScript(0, frame1, 1, frame2, 4, frame5, 6, frame7, 14, frame15);
super(x, y, xspeed, yspeed, motion);
this.type = type;
setHP(240);
score = 600;
money = 5;
dropRate = 2;
cutoff = 100;
}
function frame15(){
if (this){
kill();
};
}
function frame5(){
if (!dead){
gotoAndStop(1);
};
}
function frame7(){
(root as Main).makeSound("rock2", "f");
}
function frame1(){
stop();
}
override public function death(){
(parent as Level).addFoe(new EyeBit((x + 50), y, (xspeed + (Math.random() * 2)), ((yspeed + 2) + (Math.random() * 4)), 0, 0));
(parent as Level).addFoe(new EyeBit((x - 50), y, (xspeed - (Math.random() * 2)), ((yspeed + 2) + (Math.random() * 4)), 0, 0));
(parent as Level).addFoe(new EyeBit(x, (y + 50), ((xspeed + (Math.random() * 4)) - 2), ((yspeed + 2) + (Math.random() * 2)), 0, 0));
(parent as Level).addFoe(new EyeBit(x, (y - 50), ((xspeed + (Math.random() * 4)) - 2), (yspeed + (Math.random() * 2)), 0, 0));
}
function frame2(){
(root as Main).makeSound("rock3", "f");
}
override function special():Boolean{
if ((t % 4) == 0){
parent.addChild(new OrangeBullet(x, y, NaN, NaN, ((getAngle(x, y) + (Math.random() * 90)) - 45), 5));
};
return (false);
}
}
}//package foes
Section 82
//FaceBot (foes.FaceBot)
package foes {
import bullets.*;
public class FaceBot extends Foe {
public function FaceBot(x:Number, y:Number, xspeed:Number, yspeed:Number, motion:Number, type:Number){
addFrameScript(0, frame1, 1, frame2, 6, frame7, 7, frame8, 32, frame33);
super(x, y, xspeed, yspeed, motion);
this.type = type;
setHP(900);
score = 2500;
money = 7;
dropRate = 3;
dropChance = 0.1;
cutoff = 100;
deathSpin = false;
}
function frame7(){
if (!dead){
gotoAndStop(1);
};
}
function frame1(){
stop();
}
function frame2(){
(root as Main).makeSound("metal", "f");
}
function frame33(){
if (this){
kill();
};
}
function frame8(){
(root as Main).makeSound("explode", "f");
}
override function special():Boolean{
if ((t % type) < 30){
parent.addChild(new RedBullet((x + 20), (y + 20), NaN, NaN, getAngle((x + 20), (y + 20)), (4 + ((t % type) / 2))));
parent.addChild(new RedBullet((x - 20), (y + 20), NaN, NaN, getAngle((x - 20), (y + 20)), (4 + ((t % type) / 2))));
};
return (false);
}
}
}//package foes
Section 83
//FireGuy (foes.FireGuy)
package foes {
import bullets.*;
public class FireGuy extends Foe {
var decel:Number;
var p:Number;// = 0
public function FireGuy(x:Number, y:Number, xspeed:Number, yspeed:Number, motion:Number, type:Number){
p = 0;
addFrameScript(0, frame1, 1, frame2, 4, frame5, 6, frame7, 17, frame18);
super(x, y, xspeed, yspeed, motion);
this.type = type;
setHP(110);
score = 300;
money = 3;
dropRate = 3;
dropChance = 0.03;
}
function frame18(){
if (this){
kill();
};
}
function frame5(){
if (!dead){
gotoAndStop(1);
};
}
function frame7(){
(root as Main).makeSound("flame2", "f");
}
function frame1(){
stop();
}
function frame2(){
(root as Main).makeSound("flame", "f");
}
override function special():Boolean{
if ((t % type) == 0){
p = (p + 4);
parent.addChild(new WaveBullet(x, y, NaN, NaN, ((getAngle(x, y) + p) - 20), 4));
if (p > 40){
p = 0;
};
};
return (false);
}
}
}//package foes
Section 84
//FlameGuy (foes.FlameGuy)
package foes {
import bullets.*;
public class FlameGuy extends Foe {
var decel:Number;
var p:Number;// = 0
public function FlameGuy(x:Number, y:Number, xspeed:Number, yspeed:Number, motion:Number, type:Number){
p = 0;
addFrameScript(0, frame1, 1, frame2, 4, frame5, 6, frame7, 17, frame18);
super(x, y, xspeed, yspeed, motion);
this.type = type;
setHP(100);
score = 300;
money = 3;
dropRate = 3;
dropChance = 0.03;
}
function frame18(){
if (this){
kill();
};
}
function frame5(){
if (!dead){
gotoAndStop(1);
};
}
function frame7(){
(root as Main).makeSound("flame2", "f");
}
function frame1(){
stop();
}
function frame2(){
(root as Main).makeSound("flame", "f");
}
override function special():Boolean{
if ((t % type) == 0){
p = (p + 15);
parent.addChild(new WaveBullet2(x, y, NaN, NaN, p, 3));
};
return (false);
}
}
}//package foes
Section 85
//Foe (foes.Foe)
package foes {
import levels.*;
import flash.display.*;
import drops.*;
import players.*;
import bullets.*;
import misc.*;
public class Foe extends MovieClip {
public var HP:Number;
public var boom:Boolean;// = false
public var dropChance:Number;// = 0.05
public var shoot:Boolean;// = true
public var cutoff:Number;// = 50
public var deathSpinR:Number;
public var ydecel:Number;// = 0
public var by:Number;
public var dead2:Boolean;// = false
public var dead:Boolean;// = false
public var boss:Boolean;// = false
public var yspeed:Number;
public var dropRate:Number;// = 0.4
public var bx:Number;
public var maxHP:Number;
public var delay:Number;// = 10
public var waitFlag:Boolean;// = false
public var s:Number;// = 0
public var score:Number;
public var type:Number;
public var kitten:int;// = 3
public var t:Number;// = 0
public var superArmor:Number;// = 0
public var xdecel:Number;// = 0
public var motion:Number;// = 0
public var xspeed:Number;
public var deathSpin:Boolean;// = true
public var player:Player;
public var money:int;// = 1
public var drop:String;// = ""
public function Foe(a:Number, b:Number, c:Number, d:Number, motion:Number=0){
boom = false;
s = 0;
dead = false;
dead2 = false;
shoot = true;
waitFlag = false;
money = 1;
dropRate = 0.4;
motion = 0;
deathSpin = true;
t = 0;
delay = 10;
cutoff = 50;
drop = "";
xdecel = 0;
ydecel = 0;
kitten = 3;
boss = false;
dropChance = 0.05;
superArmor = 0;
super();
x = a;
y = b;
xspeed = c;
yspeed = d;
this.motion = motion;
deathSpinR = ((Math.random() * 50) - 25);
money = Math.floor(((Math.random() * 3) + 1));
Global.vars.foes++;
if ((((motion == 2)) && ((xspeed > 0)))){
xdecel = 0.2;
};
if ((((motion == 2)) && ((xspeed < 0)))){
xdecel = -0.2;
};
if ((((motion == 4)) && ((yspeed > 0)))){
ydecel = 0.2;
};
if ((((motion == 4)) && ((yspeed < 0)))){
ydecel = -0.2;
};
}
function extraHeart(){
if (((!((parent as Level).level.survival)) && (Global.vars.options[13]))){
parent.addChild(new Heart(x, y));
};
}
public function getAngle(x:Number, y:Number):Number{
var n:Number;
n = ((Math.atan(((y - player.y) / (x - player.x))) / Math.PI) * 180);
if (x >= player.x){
return ((n + 180));
};
return (n);
}
function specialHit(){
}
function nextPattern(drops:int, combo:int){
var d:uint;
(parent as Level).addScore((score / 4), x, y);
(parent as Level).addCombo(combo);
d = 0;
while (d < drops) {
(parent as Level).addItem(new Money(x, y, money, (Math.random() * 360), (Math.random() * 9)));
d++;
};
t = 0;
superArmor = 60;
}
public function timeOut(){
dead = true;
deathSpin = false;
gotoAndPlay("die");
death();
xspeed = 0;
yspeed = 0;
(parent as Level).addChild(new ScoreLabel(-1, 0, x, y));
}
function hitPlayer(){
if (((((this.hitTestPoint(player.x, player.y, true)) && ((player.superArmor == 0)))) && (!(player.dead)))){
player.hit();
this.hit(15);
};
}
public function kill(){
dead = true;
dead2 = true;
stop();
if (waitFlag){
(parent as Level).wait--;
};
(parent as Level).foeList.splice((parent as Level).foeList.indexOf(this), 1);
parent.removeChild(this);
}
public function die(){
var h:int;
var d:uint;
var u:int;
(parent as Level).bottomBar.bossHP.visible = false;
dead = true;
if (score != 0){
(parent as Level).addScore(score, x, y);
(parent as Level).addCombo(1);
(parent as Level).foesKilled = ((parent as Level).foesKilled + 1);
(parent as Level).comboCounter = 60;
(parent as Level).updateBars();
if ((((parent as Level).level.survival) && ((Math.random() > 0.6)))){
} else {
if (dropRate > 1){
d = 0;
while (d < dropRate) {
(parent as Level).addItem(new Money(x, y, money, (Math.random() * 360), (Math.random() * 9)));
d++;
};
} else {
if (Math.random() < dropRate){
(parent as Level).addItem(new Money(x, y, money, 0, 2));
};
};
};
h = 1;
if (((!((parent as Level).level.survival)) && (Global.vars.options[13]))){
h = 1.6;
};
if (drop == "heart"){
(parent as Level).addItem(new Heart(x, y));
} else {
if (drop == "shield"){
(parent as Level).addItem(new Barrier(x, y));
} else {
if (drop == "buff"){
(parent as Level).addItem(new Buff(x, y));
} else {
if (Math.random() < (dropChance * h)){
u = Math.floor((Math.random() * 3));
if (!(parent as Level).level.survival){
if (u == 0){
(parent as Level).addItem(new Heart(x, y));
};
};
if (u == 1){
(parent as Level).addItem(new Barrier(x, y));
};
if (u == 2){
(parent as Level).addItem(new Buff(x, y));
};
};
};
};
};
};
gotoAndPlay("die");
death();
xspeed = 0;
yspeed = 0;
}
public function hit(damage:Number){
HP = (HP - damage);
if (((!((parent as Level).level.survival)) && (Global.vars.options[15]))){
HP = (HP - (damage / 2));
};
specialHit();
if (!dead){
if (HP <= 0){
die();
} else {
play();
};
};
}
function special():Boolean{
return (false);
}
public function death(){
}
public function move(){
if (boss){
if (!dead){
(parent as Level).bottomBar.bossHP.visible = true;
(parent as Level).bottomBar.bossHP.gotoAndStop(Math.floor((((HP / maxHP) * 100) + 2)));
};
superArmor--;
if (superArmor > 0){
visible = !(visible);
} else {
visible = true;
};
};
x = (x + xspeed);
y = (y + yspeed);
t++;
if (motion == 1){
xspeed = (xspeed * 0.92);
};
if (motion == 3){
yspeed = (yspeed * 0.92);
};
xspeed = (xspeed - xdecel);
yspeed = (yspeed - ydecel);
if (!dead){
if (special()){
die();
} else {
if ((((x > ((parent as Level).xlimit + cutoff))) || ((x < -(cutoff))))){
kill();
} else {
if ((((y > ((parent as Level).ylimit + cutoff))) || ((y < -(cutoff))))){
kill();
} else {
hitPlayer();
};
};
};
} else {
if (deathSpin){
xspeed = 0;
yspeed = -7;
rotation = (rotation + deathSpinR);
};
};
}
public function setHP(h:Number){
HP = h;
maxHP = h;
}
}
}//package foes
Section 86
//FoeBar (foes.FoeBar)
package foes {
import flash.display.*;
public dynamic class FoeBar extends MovieClip {
public function FoeBar(){
super();
addFrameScript(0, frame1);
}
function frame1(){
gotoAndStop(100);
}
}
}//package foes
Section 87
//Ghost (foes.Ghost)
package foes {
import bullets.*;
public class Ghost extends Foe {
var decel:Number;
var p:int;// = 0
public function Ghost(x:Number, y:Number, xspeed:Number, yspeed:Number, motion:Number, type:Number){
p = 0;
addFrameScript(0, frame1, 1, frame2, 4, frame5, 7, frame8, 17, frame18);
super(x, y, xspeed, yspeed, motion);
this.type = type;
setHP(300);
score = 1000;
money = 7;
dropRate = 1;
dropChance = 0.1;
cutoff = 80;
deathSpin = false;
}
function frame18(){
if (this){
kill();
};
}
function frame5(){
if (!dead){
gotoAndStop(1);
};
}
function frame1(){
stop();
}
function frame2(){
(root as Main).makeSound("log", "f");
}
function frame8(){
(root as Main).makeSound("log2", "f");
}
override function special():Boolean{
var b:Number;
if ((t % type) == 0){
b = 0;
while (b < 360) {
parent.addChild(new WaveBullet(x, y, NaN, NaN, b, 3));
b = (b + 15);
};
};
if ((t % type) == 1){
b = 7.5;
while (b < 360) {
parent.addChild(new WaveBullet(x, y, NaN, NaN, b, 3));
b = (b + 15);
};
};
if ((t % 13) == 0){
parent.addChild(new WaveBullet2(x, y, NaN, NaN, getAngle(x, y), 4));
};
return (false);
}
}
}//package foes
Section 88
//GiantCrab (foes.GiantCrab)
package foes {
import drops.*;
import bullets.*;
public class GiantCrab extends Foe {
var inc:Number;// = 1
var decel:Number;
var halt:Boolean;// = true
var b:Number;// = 1
var m:Number;// = 1
var p:Number;// = 0
var o:Number;// = 0
var w:Number;// = 0
var r:Number;// = 0
var bx2:Number;
var mode2:Number;// = 0
var mode:Number;// = 0
public function GiantCrab(x:Number, y:Number, xspeed:Number, yspeed:Number, motion:Number, type:Number){
p = 0;
o = 0;
b = 1;
m = 1;
halt = true;
mode = 0;
mode2 = 0;
w = 0;
inc = 1;
r = 0;
addFrameScript(0, frame1, 1, frame2, 4, frame5, 8, frame9, 14, frame15, 22, frame23, 52, frame53);
super(x, y, xspeed, yspeed, motion);
this.type = type;
setHP(10000);
score = 40000;
money = 5;
dropRate = 30;
cutoff = 200;
deathSpin = false;
boss = true;
}
function frame15(){
(root as Main).makeSound("explode", "f");
}
function frame5(){
if (!dead){
gotoAndStop(1);
};
}
function frame23(){
(root as Main).makeSound("explode", "f");
}
function frame1(){
stop();
}
function frame2(){
(root as Main).makeSound("fort", "f");
}
function frame9(){
(root as Main).makeSound("explode", "f");
}
override function special():Boolean{
var b:int;
by = (y + 50);
bx = (x - 120);
bx2 = (x + 120);
w++;
r = (r + 0.02);
if ((((mode == 1)) && ((w > 30)))){
b = 0;
while (b < 5) {
parent.addChild(new BubbleBullet2(x, y, NaN, NaN, (Math.random() * 360), 5));
b++;
};
} else {
if ((((mode == 2)) && ((w > 50)))){
parent.addChild(new BubbleBullet2(x, y, NaN, NaN, (Math.random() * 360), 2));
if ((t % 20) == 0){
b = 0;
while (b < 360) {
parent.addChild(new BubbleBullet(x, y, NaN, NaN, (b + (Math.random() * 15)), 3));
b = (b + 15);
};
};
} else {
if ((((mode == 3)) && ((w > 70)))){
if ((t % 60) < 30){
b = 0;
while (b < 4) {
parent.addChild(new BubbleBullet2(x, y, NaN, NaN, ((getAngle(x, y) + (Math.random() * 30)) - 15), (7 + (Math.random() * 3))));
b++;
};
};
} else {
if ((((mode == 4)) && ((w > 50)))){
if ((t % 4) == 0){
parent.addChild(new BubbleBullet(x, y, NaN, NaN, (Math.random() * 360), 3));
};
if ((t % 3) == 0){
p = (p + inc);
b = 0;
while (b < 18) {
parent.addChild(new BubbleBullet2(x, y, NaN, NaN, ((b * 20) + p), 6));
if (p == 0){
inc = 2;
};
if (p == 70){
inc = -2;
};
b++;
};
};
} else {
if ((((mode == 5)) && ((w > 50)))){
if ((t % 50) == 0){
parent.addChild(new BubbleBall(150, 150, NaN, NaN, getAngle(x, y), 3));
parent.addChild(new BubbleBall(350, 150, NaN, NaN, getAngle(x, y), 3));
};
} else {
if ((((mode == 6)) && ((w > 100)))){
if ((t % 7) == 0){
b = 0;
while (b < 10) {
parent.addChild(new BubbleBullet2(x, y, NaN, NaN, (((t * 2) + (r * 2)) + 4), (2 + b)));
parent.addChild(new BubbleBullet2(x, y, NaN, NaN, ((((t * 2) + (r * 2)) + 180) + 4), (2 + b)));
b = (b + 1);
};
};
if ((t % 8) == 0){
b = 0;
while (b < 8) {
parent.addChild(new BlueWave(x, y, NaN, NaN, ((t * 3) + r), (1 + b)));
parent.addChild(new BlueWave(x, y, NaN, NaN, (((t * 3) + 180) + r), (1 + b)));
b = (b + 1);
};
};
if ((t % 50) == 30){
b = 0;
while (b < 3) {
parent.addChild(new GodBall(x, y, ((t * 3) + r), (3 + (b * 2))));
parent.addChild(new GodBall(x, y, (((t * 3) + 180) + r), (3 + (b * 2))));
b = (b + 1);
};
};
};
};
};
};
};
};
if (HP > ((maxHP * 5) / 6)){
if (mode != 1){
mode = 1;
w = 0;
superArmor = 0;
extraHeart();
};
} else {
if (HP > ((maxHP * 4) / 6)){
if (mode != 2){
mode = 2;
w = 0;
superArmor = 60;
parent.addChild(new Heart(x, y));
};
} else {
if (HP > ((maxHP * 3) / 6)){
if (mode != 3){
mode = 3;
w = 0;
p = 0;
superArmor = 60;
extraHeart();
};
} else {
if (HP > ((maxHP * 2) / 6)){
if (mode != 4){
mode = 4;
w = 0;
superArmor = 60;
parent.addChild(new Heart(x, y));
};
} else {
if (HP > ((maxHP * 1) / 6)){
if (mode != 5){
mode = 5;
w = 0;
superArmor = 60;
extraHeart();
};
} else {
if (HP <= ((maxHP * 1) / 6)){
if (mode != 6){
mode = 6;
w = 0;
superArmor = 60;
};
};
};
};
};
};
};
return (false);
}
function frame53(){
if (this){
kill();
};
}
}
}//package foes
Section 89
//GiantCrab2 (foes.GiantCrab2)
package foes {
import drops.*;
import bullets.*;
public class GiantCrab2 extends GiantCrab {
var ball1:Bullet;
var ball2:Bullet;
var aa:int;
var ss:Number;// = 0
var sb:Boolean;// = true
var u:Number;// = 0
var si:Number;// = 0
var v:Number;// = 0
var xx:int;
var yy:int;
public function GiantCrab2(x:Number, y:Number, xspeed:Number, yspeed:Number, motion:Number, type:Number){
u = 0;
v = 0;
ss = 0;
si = 0;
sb = true;
super(x, y, xspeed, yspeed, motion, type);
setHP(21000);
score = 200000;
money = 5;
dropRate = 25;
}
override function special():Boolean{
var b:int;
by = (y + 50);
bx = (x - 120);
bx2 = (x + 120);
w++;
u = (u + 0.02);
if ((((mode == 1)) && ((w > 30)))){
if ((t % 30) == 0){
b = 0;
while (b < 360) {
parent.addChild(new GodBullet3(x, y, (b + u), 2.5));
b = (b + 10);
};
};
if ((t % 30) == 10){
b = 0;
while (b < 360) {
parent.addChild(new GodBullet3(x, y, ((b + 5) + u), 3.5));
b = (b + 10);
};
};
if ((t % 30) == 20){
b = 0;
while (b < 10) {
parent.addChild(new BubbleBullet2(x, y, NaN, NaN, (t / 2), (2 + b)));
parent.addChild(new BubbleBullet2(x, y, NaN, NaN, ((t / 2) + 120), (2 + b)));
parent.addChild(new BubbleBullet2(x, y, NaN, NaN, ((t / 2) - 120), (2 + b)));
b = (b + 1);
};
};
} else {
if ((((mode == 2)) && ((w > 100)))){
if ((t % 160) == 0){
b = 0;
while (b <= 600) {
parent.addChild(new BubbleBullet2(505, b, NaN, NaN, ((180 - 50) + (b / 6)), 2));
parent.addChild(new BubbleBullet2(-5, b, NaN, NaN, ((0 + 50) - (b / 6)), 2));
b = (b + 60);
};
b = 0;
while (b <= 500) {
parent.addChild(new BubbleBullet2(b, -5, NaN, NaN, ((90 - 50) + (b / 5)), 2));
parent.addChild(new BubbleBullet2(b, 605, NaN, NaN, ((-90 + 50) - (b / 5)), 2));
b = (b + 50);
};
};
if ((t % 160) == 80){
b = 0;
while (b <= 600) {
parent.addChild(new BubbleBullet(505, b, NaN, NaN, ((180 - 100) + (b / 3)), 2));
parent.addChild(new BubbleBullet(-5, b, NaN, NaN, ((0 + 100) - (b / 3)), 2));
b = (b + 60);
};
b = 0;
while (b <= 500) {
parent.addChild(new BubbleBullet(b, -5, NaN, NaN, ((90 - 100) + (b / 2.5)), 2));
parent.addChild(new BubbleBullet(b, 605, NaN, NaN, ((-90 + 100) - (b / 2.5)), 2));
b = (b + 50);
};
};
} else {
if ((((mode == 3)) && ((w > 120)))){
if ((t % 60) == 0){
b = 0;
while (b <= 6) {
parent.addChild(new BlueWave(x, y, NaN, NaN, getAngle(x, y), (3 + b)));
b = (b + 1);
};
};
if ((t % 5) == 0){
b = 50;
while (b <= 450) {
parent.addChild(new GodBullet(b, 605, (-100 + (Math.random() * 20)), 2));
b = (b + 100);
};
};
} else {
if ((((mode == 4)) && ((w > 120)))){
parent.addChild(new BubbleBullet2(x, y, NaN, NaN, (Math.sin((t / 20)) * 270), 4));
parent.addChild(new BubbleBullet2(x, y, NaN, NaN, (180 - (Math.sin((t / 20)) * 270)), 4));
parent.addChild(new BlueBullet(x, y, NaN, NaN, (Math.sin((t / 10)) * 270), 3));
parent.addChild(new BlueBullet(x, y, NaN, NaN, (180 - (Math.sin((t / 10)) * 270)), 3));
} else {
if ((((mode == 5)) && ((w > 120)))){
if ((t % 90) < 6){
xx = ((x - 150) + (Math.random() * 300));
yy = ((y - 75) + (Math.random() * 150));
aa = (Math.random() * 90);
b = 0;
while (b < 5) {
parent.addChild(new BubbleBullet2(xx, yy, NaN, NaN, (((getAngle(xx, yy) - 15) + (Math.random() * 30)) + aa), (4 + (Math.random() * 2))));
parent.addChild(new BubbleBullet2(xx, yy, NaN, NaN, ((((getAngle(xx, yy) + 90) - 15) + (Math.random() * 30)) + aa), (4 + (Math.random() * 2))));
parent.addChild(new BubbleBullet2(xx, yy, NaN, NaN, ((((getAngle(xx, yy) + 180) - 15) + (Math.random() * 30)) + aa), (4 + (Math.random() * 2))));
parent.addChild(new BubbleBullet2(xx, yy, NaN, NaN, ((((getAngle(xx, yy) + 270) - 15) + (Math.random() * 30)) + aa), (4 + (Math.random() * 2))));
b++;
};
};
if (((((t % 90) < 35)) && (((t % 90) >= 30)))){
xx = ((x - 150) + (Math.random() * 300));
yy = ((y - 75) + (Math.random() * 150));
aa = (Math.random() * 90);
b = 0;
while (b < 5) {
parent.addChild(new BlueWave(xx, yy, NaN, NaN, (((getAngle(xx, yy) - 7) + (Math.random() * 14)) + aa), (6 + (Math.random() * 2))));
parent.addChild(new BlueWave(xx, yy, NaN, NaN, ((((getAngle(xx, yy) + 90) - 7) + (Math.random() * 14)) + aa), (6 + (Math.random() * 2))));
parent.addChild(new BlueWave(xx, yy, NaN, NaN, ((((getAngle(xx, yy) + 180) - 7) + (Math.random() * 14)) + aa), (6 + (Math.random() * 2))));
parent.addChild(new BlueWave(xx, yy, NaN, NaN, ((((getAngle(xx, yy) + 270) - 7) + (Math.random() * 14)) + aa), (6 + (Math.random() * 2))));
b++;
};
};
if (((((t % 90) < 67)) && (((t % 90) >= 60)))){
xx = ((x - 150) + (Math.random() * 300));
yy = ((y - 75) + (Math.random() * 150));
aa = (Math.random() * 90);
b = 0;
while (b < 5) {
parent.addChild(new GodBullet(xx, yy, (((getAngle(xx, yy) - 25) + (Math.random() * 50)) + aa), (2 + (Math.random() * 1))));
parent.addChild(new GodBullet(xx, yy, ((((getAngle(xx, yy) + 90) - 25) + (Math.random() * 50)) + aa), (2 + (Math.random() * 1))));
parent.addChild(new GodBullet(xx, yy, ((((getAngle(xx, yy) + 180) - 25) + (Math.random() * 50)) + aa), (2 + (Math.random() * 1))));
parent.addChild(new GodBullet(xx, yy, ((((getAngle(xx, yy) + 270) - 25) + (Math.random() * 50)) + aa), (2 + (Math.random() * 1))));
b++;
};
};
} else {
if ((((mode == 6)) && ((w > 80)))){
if ((((ball1 == undefined)) || (ball1.dead))){
ball1 = new BubbleBall2(-100, -100, 0, 200);
ball2 = new BubbleBall2(-100, -100, 180, 200);
parent.addChild(ball1);
parent.addChild(ball2);
};
} else {
if ((((mode == 7)) && ((w > 80)))){
if ((t % 5) != 0){
parent.addChild(new BubbleBullet(x, y, NaN, NaN, ((t * 5) % 360), 3));
};
if ((t % 5) != 1){
parent.addChild(new BubbleBullet(x, y, NaN, NaN, (((t * 5) % 360) + 90), 3));
};
if ((t % 5) != 2){
parent.addChild(new BubbleBullet(x, y, NaN, NaN, (((t * 5) % 360) + 180), 3));
};
if ((t % 5) != 3){
parent.addChild(new BubbleBullet(x, y, NaN, NaN, (((t * 5) % 360) + 270), 3));
};
} else {
if ((((mode == 8)) && ((w > 80)))){
if ((((ball1 == undefined)) || (ball1.dead))){
ball1 = new BubbleBall3(-100, -100, 0, 200);
ball2 = new BubbleBall3(-100, -100, 1, 200);
parent.addChild(ball1);
parent.addChild(ball2);
};
} else {
if ((((mode == 9)) && ((w > 80)))){
if ((t % 2) == 0){
if (sb){
si = (si + 0.3);
ss = (ss + si);
if (si > 20){
sb = !(sb);
};
};
if (!sb){
si = (si - 0.3);
ss = (ss + si);
if (si < -20){
sb = !(sb);
};
};
b = 0;
while (b < 360) {
parent.addChild(new GodBullet(x, y, (b + ss), 4));
b = (b + 60);
};
b = 10;
while (b < 360) {
parent.addChild(new BlueWave(x, y, NaN, NaN, (b - ss), 2));
b = (b + 120);
};
};
};
};
};
};
};
};
};
};
};
if (HP > ((maxHP * 8) / 9)){
if (mode != 1){
mode = 1;
superArmor = 0;
};
} else {
if (HP > ((maxHP * 7) / 9)){
if (mode != 2){
mode = 2;
nextPattern(5, 30);
w = 0;
};
} else {
if (HP > ((maxHP * 6) / 9)){
if (mode != 3){
mode = 3;
nextPattern(7, 30);
w = 0;
extraHeart();
};
} else {
if (HP > ((maxHP * 5) / 9)){
if (mode != 4){
mode = 4;
nextPattern(9, 30);
w = 0;
parent.addChild(new Heart(x, y));
};
} else {
if (HP > ((maxHP * 4) / 9)){
if (mode != 5){
mode = 5;
nextPattern(10, 30);
w = 0;
extraHeart();
};
} else {
if (HP > ((maxHP * 3) / 9)){
if (mode != 6){
mode = 6;
nextPattern(11, 30);
w = 0;
parent.addChild(new Heart(x, y));
};
} else {
if (HP > ((maxHP * 2) / 9)){
if (mode != 7){
mode = 7;
nextPattern(13, 30);
w = 0;
ball1.kill();
ball2.kill();
extraHeart();
};
} else {
if (HP > ((maxHP * 1) / 9)){
if (mode != 8){
mode = 8;
nextPattern(15, 30);
w = 0;
parent.addChild(new Heart(x, y));
};
} else {
if (HP < ((maxHP * 1) / 9)){
if (mode != 9){
mode = 9;
nextPattern(18, 30);
w = 0;
ball1.kill();
ball2.kill();
};
};
};
};
};
};
};
};
};
};
return (false);
}
}
}//package foes
Section 90
//Girder (foes.Girder)
package foes {
public class Girder extends Foe {
var spin:Number;
public function Girder(a:Number, b:Number, c:Number, d:Number, rotate:Number, spin:Number){
addFrameScript(0, frame1, 6, frame7, 15, frame16);
super(a, b, c, d);
this.rotation = rotate;
this.spin = spin;
setHP(90);
score = 20;
}
function frame16(){
if (this){
kill();
};
}
function frame7(){
if (!dead){
gotoAndStop(1);
};
}
function frame1(){
stop();
}
override function special():Boolean{
rotation = (rotation + spin);
return (false);
}
}
}//package foes
Section 91
//GodCat (foes.GodCat)
package foes {
import levels.*;
import drops.*;
import bullets.*;
public class GodCat extends Foe {
var inc:Number;// = 1
var ball1:OrbitBall;
var ball2:OrbitBall;
var decel:Number;
var halt:Boolean;// = true
var a:int;// = 0
var b:Number;// = 1
var m:Number;// = 1
var p:Number;// = 0
var u:Number;// = 5
var o:Number;// = 0
var w:Number;// = 0
var godBall:GodBall2;
var bx2:Number;
var mode2:Number;// = 0
var mode:Number;// = -1
public function GodCat(x:Number, y:Number, xspeed:Number, yspeed:Number, motion:Number, type:Number){
p = 0;
o = 0;
b = 1;
m = 1;
halt = true;
mode = -1;
mode2 = 0;
w = 0;
inc = 1;
a = 0;
u = 5;
addFrameScript(0, frame1, 1, frame2, 4, frame5, 8, frame9, 14, frame15, 22, frame23, 30, frame31, 37, frame38, 45, frame46, 76, frame77);
super(x, y, xspeed, yspeed, motion);
this.type = type;
setHP(45000);
score = 160000;
money = 7;
dropRate = 20;
cutoff = 200;
deathSpin = false;
boss = true;
}
function frame15(){
(root as Main).makeSound("explode", "f");
}
function frame5(){
if (!dead){
gotoAndStop(1);
};
}
function frame23(){
(root as Main).makeSound("explode", "f");
}
function frame1(){
stop();
}
function frame2(){
(root as Main).makeSound("rock3", "f");
}
function frame31(){
(root as Main).makeSound("explode", "f");
}
function frame38(){
(root as Main).makeSound("explode", "f");
}
function frame9(){
(root as Main).makeSound("explode", "f");
}
function frame46(){
(root as Main).makeSound("explode", "f");
}
override function special():Boolean{
var b:int;
var c:int;
var x2:int;
var y2:int;
w++;
if (t == 360){
t = 0;
};
if ((((mode == -1)) && ((w > 60)))){
if ((t % 11) == 0){
x2 = (((x + (Math.random() * 150)) - 75) - 30);
y2 = (((y + (Math.random() * 150)) - 75) - 30);
c = 0;
while (c < 360) {
parent.addChild(new GodBullet3(x2, y2, c, 4));
c = (c + 10);
};
b = 0;
while (b < 360) {
parent.addChild(new GodBullet2(x2, y2, b, 5));
b = (b + 20);
};
};
} else {
if ((((mode == 0)) && ((w > 50)))){
if ((t % 60) == 0){
parent.addChild(new DevilBall((x + 40), y, getAngle((x + 40), y), 5));
};
} else {
if ((((mode == 1)) && ((w > 120)))){
if ((t % 30) == 0){
b = 0;
while (b < 360) {
parent.addChild(new GodBall((x - 40), y, b, 5));
b = (b + 14);
};
};
if ((t % 30) == 15){
b = 0;
while (b < 360) {
parent.addChild(new GodBall((x - 40), y, (b + 7), 5));
b = (b + 14);
};
};
parent.addChild(new GodBullet((x - 40), y, (Math.random() * 360), 6));
} else {
if ((((mode == 2)) && ((w > 50)))){
parent.addChild(new DevilBullet2((x + 40), y, (t * 6), 5));
parent.addChild(new DevilBullet2((x + 40), y, (122 + (t * 6)), 5));
parent.addChild(new DevilBullet2((x + 40), y, (244 + (t * 6)), 5));
parent.addChild(new DevilBullet((x + 40), y, (Math.random() * 360), 6));
parent.addChild(new DevilBullet((x + 40), y, (Math.random() * 360), 6));
parent.addChild(new DevilBullet((x + 40), y, (Math.random() * 360), 6));
} else {
if ((((mode == 3)) && ((w > 60)))){
if ((t % 2) == 0){
parent.addChild(new GodDiamond((x - 40), y, (((t * u) % 360) + 6), 4.5));
parent.addChild(new GodDiamond((x - 40), y, (((t * u) % 360) + 4), 5));
parent.addChild(new GodDiamond((x - 40), y, (((t * u) % 360) + 2), 5.5));
parent.addChild(new GodDiamond((x - 40), y, (((t * u) % 360) + 0), 6));
parent.addChild(new GodDiamond((x - 40), y, (((t * u) % 360) - 2), 5.5));
parent.addChild(new GodDiamond((x - 40), y, (((t * u) % 360) - 4), 5));
parent.addChild(new GodDiamond((x - 40), y, (((t * u) % 360) - 6), 4.5));
parent.addChild(new GodBullet2((x - 40), y, ((t * u) % 360), 4.5));
parent.addChild(new GodDiamond((x - 40), y, (((t * u) % 360) + 4), 4));
parent.addChild(new GodDiamond((x - 40), y, (((t * u) % 360) + 2), 3.5));
parent.addChild(new GodDiamond((x - 40), y, (((t * u) % 360) + 0), 3));
parent.addChild(new GodDiamond((x - 40), y, (((t * u) % 360) - 2), 3.5));
parent.addChild(new GodDiamond((x - 40), y, (((t * u) % 360) - 4), 4));
parent.addChild(new GodBullet2((x - 40), y, (((t * u) % 360) + 180), 4));
parent.addChild(new GodBullet2((x - 40), y, ((((t * u) % 360) + 180) + 2), 4.5));
parent.addChild(new GodBullet2((x - 40), y, ((((t * u) % 360) + 180) + 4), 5));
u = (u + 0.03);
};
} else {
if ((((mode == 4)) && ((w > 60)))){
if ((t % 60) < 50){
parent.addChild(new DevilBullet3((x + 40), y, ((getAngle((x + 40), y) + (Math.random() * 4)) - 2), (4 + ((t % 60) / 4))));
parent.addChild(new DevilBullet3((x + 40), y, ((getAngle((x + 40), y) + (Math.random() * 8)) - 4), (4 + ((t % 60) / 4))));
};
} else {
if ((((mode == 5)) && ((w > 60)))){
parent.addChild(new GodBullet(-5, (Math.random() * 900), 0, 3));
parent.addChild(new DevilBullet(505, (Math.random() * 900), 180, 3));
} else {
if ((((mode == 6)) && ((w > 60)))){
x2 = x;
y2 = y;
parent.addChild(new GodBullet2(x2, y2, ((t * 10) % 360), 4));
parent.addChild(new DevilBullet2(x2, y2, (((t * 11) % 360) + 30), 5));
parent.addChild(new GodBullet(x2, y2, (((t * 8) % 360) + 80), 3));
parent.addChild(new DevilBullet(x2, y2, (((t * 9) % 360) + 110), 3.8));
parent.addChild(new GodBullet2(x2, y2, (((t * 10) % 360) + 180), 4));
parent.addChild(new DevilBullet2(x2, y2, ((((t * 11) % 360) + 30) + 180), 5));
parent.addChild(new GodBullet(x2, y2, ((((t * 8) % 360) + 80) + 180), 3));
parent.addChild(new DevilBullet(x2, y2, ((((t * 9) % 360) + 110) + 180), 3.8));
};
};
};
};
};
};
};
};
if (HP > ((maxHP * 7) / 8)){
if (mode != -1){
mode = -1;
w = 0;
superArmor = 0;
t = 0;
};
} else {
if (HP > ((maxHP * 6) / 8)){
if (mode != 0){
mode = 0;
w = 0;
superArmor = 60;
t = 0;
diamonds(2);
};
} else {
if (HP > ((maxHP * 5) / 8)){
if (mode != 1){
mode = 1;
w = 0;
superArmor = 60;
parent.addChild(new Heart(x, y));
t = 0;
diamonds(3);
};
} else {
if (HP > ((maxHP * 4) / 8)){
if (mode != 2){
mode = 2;
w = 0;
superArmor = 60;
ball1.play();
t = 0;
diamonds(5);
};
} else {
if (HP > ((maxHP * 3) / 8)){
if (mode != 3){
mode = 3;
w = 0;
p = 0;
superArmor = 60;
parent.addChild(new Heart(x, y));
t = 0;
diamonds(7);
};
} else {
if (HP > ((maxHP * 2) / 8)){
if (mode != 4){
mode = 4;
w = 0;
superArmor = 60;
t = 0;
diamonds(10);
};
} else {
if (HP > ((maxHP * 1) / 8)){
if (mode != 5){
mode = 5;
w = 0;
superArmor = 60;
parent.addChild(new Heart(x, y));
t = 0;
diamonds(12);
};
} else {
if (HP <= ((maxHP * 1) / 8)){
if (mode != 6){
mode = 6;
w = 0;
superArmor = 60;
t = 0;
};
};
};
};
};
};
};
};
};
return (false);
}
function frame77(){
if (this){
kill();
};
}
function diamonds(a:int){
var d:uint;
d = 0;
while (d < a) {
(parent as Level).addItem(new Money(x, y, money, (Math.random() * 360), (Math.random() * 9)));
d++;
};
}
}
}//package foes
Section 92
//GodCat2 (foes.GodCat2)
package foes {
import drops.*;
import bullets.*;
public class GodCat2 extends GodCat {
public function GodCat2(x:Number, y:Number, xspeed:Number, yspeed:Number, motion:Number, type:Number){
super(x, y, xspeed, yspeed, motion, type);
this.type = type;
setHP(70000);
score = 800000;
money = 7;
dropRate = 25;
}
override function special():Boolean{
var b:int;
var c:int;
var x2:int;
var y2:int;
w++;
u = (u + 0.02);
if (t == 360){
t = 0;
};
if ((((mode == 0)) && ((w > 60)))){
if ((t % 50) == 0){
parent.addChild(new DualBall(x, y, ((getAngle((x + 40), y) + (Math.random() * 60)) - 39), (3 + (Math.random() * 2))));
};
} else {
if ((((mode == 1)) && ((w > 100)))){
if ((t % 22) < 4){
b = ((t % 18) * 10);
while (b < 360) {
c = 5;
while (c < 7) {
parent.addChild(new WaveBullet((x + 40), y, NaN, NaN, (b + a), c));
c = (c + 1);
};
b = (b + 40);
};
a = (a + 2);
};
if ((t % 50) < 3){
b = 5;
while (b < 15) {
parent.addChild(new RedBullet((x + 40), y, NaN, NaN, ((getAngle((x + 40), y) + (Math.random() * 10)) - 5), b));
b = (b + 2);
};
};
} else {
if ((((mode == 2)) && ((w > 80)))){
if ((t % 4) == 0){
parent.addChild(new ThunderBall((x - 40), y, ((t * 3) + (u * 3)), 3.5));
} else {
parent.addChild(new BigWhiteBullet((x - 40), y, NaN, NaN, ((t * 8) + (u * 5)), 4.5));
parent.addChild(new BigWhiteBullet((x - 40), y, NaN, NaN, (((t * 8) + (u * 5)) + 180), 4.5));
};
} else {
if ((((mode == 3)) && ((w > 100)))){
if ((t % 120) < 30){
parent.addChild(new RedBullet(-5, ((t % 120) * 20), NaN, NaN, ((Math.random() * 180) - 90), 3));
parent.addChild(new WhiteBullet(-5, ((t % 120) * 20), NaN, NaN, ((Math.random() * 180) - 90), 2));
} else {
if ((t % 120) < 60){
x2 = (((t % 120) - 30) * 17);
parent.addChild(new RedBullet(x2, 605, NaN, NaN, (-(Math.random()) * 180), 3));
parent.addChild(new WhiteBullet(x2, 605, NaN, NaN, (-(Math.random()) * 180), 2));
} else {
if ((t % 120) < 90){
y2 = (600 - (((t % 120) - 60) * 20));
parent.addChild(new RedBullet(505, y2, NaN, NaN, ((Math.random() * 180) + 90), 3));
parent.addChild(new WhiteBullet(505, y2, NaN, NaN, ((Math.random() * 180) + 90), 2));
} else {
x2 = (500 - (((t % 120) - 90) * 17));
parent.addChild(new RedBullet(x2, -5, NaN, NaN, (Math.random() * 180), 3));
parent.addChild(new WhiteBullet(x2, -5, NaN, NaN, (Math.random() * 180), 2));
};
};
};
} else {
if ((((mode == 4)) && ((w > 80)))){
if ((t % 8) == 0){
parent.addChild(new BubbleBall((x - 40), y, NaN, NaN, ((t * 3) + (u * 3)), 3.5));
};
} else {
if ((((mode == 5)) && ((w > 150)))){
if ((t % 4) == 0){
b = 0;
while (b < 360) {
parent.addChild(new GodDiamond((x - 40), y, ((b - (t % 30)) + (u * 2)), 6));
parent.addChild(new GodDiamond((x - 40), y, ((b + (t % 30)) + (u * 2)), 6));
b = (b + 60);
};
};
if ((t % 4) == 2){
b = 0;
while (b < 360) {
parent.addChild(new RedDiamond((x + 40), y, NaN, NaN, ((b - (t % 30)) + u), 3));
parent.addChild(new RedDiamond((x + 40), y, NaN, NaN, ((b + (t % 30)) + u), 3));
b = (b + 60);
};
};
} else {
if ((((mode == 9)) && ((w > 80)))){
parent.addChild(new GodDiamond((x - 40), y, ((getAngle((x - 40), y) + ((t % 60) * 4)) - (60 * 2)), 4));
parent.addChild(new GodDiamond((x - 40), y, ((getAngle((x - 40), y) - ((t % 60) * 4)) + (60 * 2)), 4));
parent.addChild(new GodBullet((x - 40), y, ((getAngle((x - 40), y) + ((t % 60) * 6)) - (60 * 3)), 3));
parent.addChild(new GodBullet((x - 40), y, ((getAngle((x - 40), y) - ((t % 60) * 6)) + (60 * 3)), 3));
parent.addChild(new DevilBullet2((x + 40), y, ((getAngle((x + 40), y) + ((t % 40) * 4)) - (40 * 2)), 5));
parent.addChild(new DevilBullet2((x + 40), y, ((getAngle((x + 40), y) - ((t % 40) * 4)) + (40 * 2)), 5));
parent.addChild(new DevilBullet((x + 40), y, ((getAngle((x + 40), y) + ((t % 40) * 6)) - (40 * 3)), 2.5));
parent.addChild(new DevilBullet((x + 40), y, ((getAngle((x + 40), y) - ((t % 40) * 6)) + (40 * 3)), 2.5));
} else {
if ((((mode == 10)) && ((w > 80)))){
if ((t % 2)){
if ((t % 120) < 10){
b = 0;
while (b < 360) {
parent.addChild(new WhiteBullet((x - 40), y, NaN, NaN, (b + u), ((t % 120) + 2)));
b = (b + 60);
};
};
if (((((t % 120) < 34)) && (((t % 120) >= 20)))){
b = 0;
while (b < 360) {
parent.addChild(new ThunderBall((x - 40), y, (b + u), ((t % 120) - 16)));
parent.addChild(new BigWhiteBullet((x - 40), y, NaN, NaN, (Math.random() * 360), ((((t % 120) - 20) + 6) / 2)));
parent.addChild(new BigWhiteBullet((x - 40), y, NaN, NaN, (Math.random() * 360), ((((t % 120) - 20) + 6) / 2)));
b = (b + 60);
};
};
if (((((t % 120) < 76)) && (((t % 120) >= 60)))){
b = 0;
while (b < 360) {
parent.addChild(new FlameBullet((x + 40), y, NaN, NaN, (b + u), (((t % 120) - 60) + 4)));
b = (b + 60);
};
};
if (((((t % 120) < 106)) && (((t % 120) >= 90)))){
b = 0;
while (b < 360) {
parent.addChild(new DemonBullet((x + 40), y, NaN, NaN, (b + u), (((t % 120) - 90) + 6)));
parent.addChild(new WaveBullet2((x + 40), y, NaN, NaN, (Math.random() * 360), ((((t % 120) - 90) + 4) / 2)));
parent.addChild(new WaveBullet2((x + 40), y, NaN, NaN, (Math.random() * 360), ((((t % 120) - 90) + 4) / 2)));
b = (b + 60);
};
};
};
} else {
if ((((mode == 11)) && ((w > 50)))){
u = (u + 0.4);
if ((t % 2) == 0){
if ((t % 120) < 50){
b = 0;
while (b < 360) {
parent.addChild(new WhiteBullet((x - 40), y, NaN, NaN, (b + u), (((t % 120) + 2) / 2)));
parent.addChild(new GodDiamond((x - 40), y, (b + u), (((t % 120) + 2) / 3)));
b = (b + 60);
};
};
if (((((t % 120) < 56)) && (((t % 120) >= 30)))){
b = 0;
while (b < 360) {
if ((t % 4) == 0){
parent.addChild(new BubbleBall((x - 40), y, NaN, NaN, (b + u), (((t % 120) - 16) / 2)));
};
parent.addChild(new BigWhiteBullet((x - 40), y, NaN, NaN, (Math.random() * 360), ((((t % 120) - 20) + 5) / 6)));
parent.addChild(new BigWhiteBullet((x - 40), y, NaN, NaN, (Math.random() * 360), ((((t % 120) - 20) + 15) / 5)));
parent.addChild(new BigWhiteBullet((x - 40), y, NaN, NaN, (Math.random() * 360), ((((t % 120) - 20) + 15) / 5)));
parent.addChild(new BigWhiteBullet((x - 40), y, NaN, NaN, (Math.random() * 360), ((((t % 120) - 20) + 10) / 5)));
b = (b + 60);
};
};
if (((((t % 120) < 102)) && (((t % 120) >= 62)))){
b = 0;
while (b < 360) {
parent.addChild(new OrangeLazor((x + 40), y, NaN, NaN, (b + u), ((((t % 120) - 60) + 2) * 0.9)));
parent.addChild(new FlameBullet((x + 40), y, NaN, NaN, (b + u), ((((t % 120) - 60) + 2) * 0.6)));
b = (b + 60);
};
};
if (((((t % 120) < 88)) && (((t % 120) >= 70)))){
b = 0;
while (b < 360) {
parent.addChild(new WaveBullet2((x + 40), y, NaN, NaN, (Math.random() * 360), (((t % 120) - 64) / 2)));
parent.addChild(new WaveBullet2((x + 40), y, NaN, NaN, (Math.random() * 360), (((t % 120) - 64) / 2)));
parent.addChild(new WaveBullet2((x + 40), y, NaN, NaN, (Math.random() * 360), (((t % 120) - 64) / 2)));
b = (b + 60);
};
};
if (((((t % 120) < 120)) && (((t % 120) >= 90)))){
b = 0;
while (b < 360) {
parent.addChild(new DemonBullet((x + 40), y, NaN, NaN, (b + u), ((((t % 120) - 90) + 6) / 1.5)));
parent.addChild(new WaveBullet2((x + 40), y, NaN, NaN, (Math.random() * 360), ((((t % 120) - 90) + 20) / 5)));
parent.addChild(new WaveBullet2((x + 40), y, NaN, NaN, (Math.random() * 360), ((((t % 120) - 90) + 15) / 5)));
b = (b + 60);
};
};
};
} else {
if ((((mode == 6)) && ((w > 100)))){
parent.addChild(new WhiteBullet((x - 40), y, NaN, NaN, (Math.random() * 360), 2.5));
parent.addChild(new BigWhiteBullet((x - 40), y, NaN, NaN, (Math.random() * 360), 4));
parent.addChild(new BigWhiteBullet((x - 40), y, NaN, NaN, (Math.random() * 360), 5.5));
parent.addChild(new GlowBall((x - 40), y, (Math.random() * 360), 5));
parent.addChild(new BubbleBullet2((x - 40), y, NaN, NaN, (Math.random() * 360), 5));
parent.addChild(new BubbleBullet2((x - 40), y, NaN, NaN, (Math.random() * 360), 6));
} else {
if ((((mode == 7)) && ((w > 100)))){
parent.addChild(new WaveBullet((x + 40), y, NaN, NaN, (Math.random() * 360), 3));
parent.addChild(new WaveBullet2((x + 40), y, NaN, NaN, (Math.random() * 360), 2.5));
parent.addChild(new RedBullet((x + 40), y, NaN, NaN, (Math.random() * 360), 5));
parent.addChild(new DevilBullet((x + 40), y, (Math.random() * 360), 4));
if ((t % 3)){
parent.addChild(new DemonBullet((x + 40), y, NaN, NaN, (Math.random() * 360), 2));
};
parent.addChild(new YellowBullet((x + 40), y, NaN, NaN, (Math.random() * 360), 4.5));
} else {
if ((((mode == 8)) && ((w > 100)))){
parent.addChild(new WhiteBullet((x - 40), y, NaN, NaN, (Math.random() * 360), 2.5));
parent.addChild(new BigWhiteBullet((x - 40), y, NaN, NaN, (Math.random() * 360), 3));
parent.addChild(new BubbleBullet2((x - 40), y, NaN, NaN, (Math.random() * 360), 4));
parent.addChild(new BubbleBullet2((x - 40), y, NaN, NaN, (Math.random() * 360), 4.5));
parent.addChild(new SmallRedBullet((x + 40), y, NaN, NaN, (Math.random() * 360), 2.5));
parent.addChild(new WaveBullet((x + 40), y, NaN, NaN, (Math.random() * 360), 3));
parent.addChild(new RedBullet((x + 40), y, NaN, NaN, (Math.random() * 360), 5));
parent.addChild(new YellowBullet((x + 40), y, NaN, NaN, (Math.random() * 360), 4.5));
};
};
};
};
};
};
};
};
};
};
};
};
if (HP > ((maxHP * 11) / 12)){
if (mode != 0){
mode = 0;
superArmor = 0;
};
} else {
if (HP > ((maxHP * 10) / 12)){
if (mode != 1){
mode = 1;
nextPattern(5, 30);
w = 0;
};
} else {
if (HP > ((maxHP * 9) / 12)){
if (mode != 2){
mode = 2;
nextPattern(5, 30);
w = 0;
};
} else {
if (HP > ((maxHP * 8) / 12)){
if (mode != 3){
mode = 3;
nextPattern(5, 30);
w = 0;
parent.addChild(new Heart(x, y));
};
} else {
if (HP > ((maxHP * 7) / 12)){
if (mode != 4){
mode = 4;
nextPattern(5, 30);
w = 0;
extraHeart();
};
} else {
if (HP > ((maxHP * 6) / 12)){
if (mode != 5){
mode = 5;
nextPattern(10, 30);
w = 0;
};
} else {
if (HP > ((maxHP * 5) / 12)){
if (mode != 6){
mode = 6;
nextPattern(15, 30);
w = 0;
parent.addChild(new Heart(x, y));
};
} else {
if (HP > ((maxHP * 4) / 12)){
if (mode != 7){
mode = 7;
nextPattern(20, 30);
w = 0;
};
} else {
if (HP > ((maxHP * 3) / 12)){
if (mode != 8){
mode = 8;
nextPattern(25, 30);
w = 0;
parent.addChild(new Heart(x, y));
};
} else {
if (HP > ((maxHP * 2) / 12)){
if (mode != 9){
mode = 9;
nextPattern(25, 30);
w = 0;
extraHeart();
};
} else {
if (HP > ((maxHP * 1) / 12)){
if (mode != 10){
mode = 10;
nextPattern(30, 30);
w = 0;
parent.addChild(new Heart(x, y));
};
} else {
if (HP < ((maxHP * 1) / 12)){
if (mode != 11){
mode = 11;
nextPattern(30, 30);
w = 0;
};
};
};
};
};
};
};
};
};
};
};
};
};
return (false);
}
}
}//package foes
Section 93
//Golem (foes.Golem)
package foes {
import bullets.*;
public class Golem extends Foe {
var decel:Number;
public function Golem(x:Number, y:Number, xspeed:Number, yspeed:Number, motion:Number, type:Number){
addFrameScript(0, frame1, 1, frame2, 5, frame6, 6, frame7, 35, frame36);
super(x, y, xspeed, yspeed, motion);
this.type = type;
setHP(1700);
score = 20000;
money = 4;
dropRate = 40;
dropChance = 0;
deathSpin = false;
cutoff = 120;
}
function frame6(){
if (!dead){
gotoAndStop(1);
};
}
function frame7(){
(root as Main).makeSound("explode", "f");
}
function frame1(){
stop();
}
function frame2(){
(root as Main).makeSound("rock3", "f");
}
function frame36(){
if (this){
kill();
};
}
override function special():Boolean{
parent.addChild(new RedDiamond(x, (y - 5), NaN, NaN, (getAngle(x, y) + ((Math.sin(t) * 360) / 8)), 5));
parent.addChild(new RedDiamond(x, (y - 5), NaN, NaN, (getAngle(x, y) - ((Math.sin(t) * 360) / 8)), 5));
parent.addChild(new SmallRedBullet(x, (y - 5), NaN, NaN, ((getAngle(x, y) - 75) + (Math.random() * 150)), 4));
return (false);
}
}
}//package foes
Section 94
//GreenJelly (foes.GreenJelly)
package foes {
import bullets.*;
public class GreenJelly extends Foe {
var decel:Number;
public function GreenJelly(x:Number, y:Number, xspeed:Number, yspeed:Number, motion:Number, type:Number){
addFrameScript(0, frame1, 1, frame2, 4, frame5, 6, frame7, 17, frame18);
super(x, y, xspeed, yspeed, motion);
this.type = type;
setHP(17);
score = 150;
money = 3;
dropRate = 0.7;
dropChance = 0.02;
}
function frame18(){
if (this){
kill();
};
}
function frame5(){
if (!dead){
gotoAndStop(1);
};
}
function frame7(){
(root as Main).makeSound("slime2", "f");
}
function frame1(){
stop();
}
function frame2(){
(root as Main).makeSound("slime", "f");
}
override function special():Boolean{
if ((t % delay) == 0){
parent.addChild(new LeafBullet(x, y, NaN, NaN, (Math.random() * 360), 3));
};
return (false);
}
}
}//package foes
Section 95
//GreenSlime (foes.GreenSlime)
package foes {
import bullets.*;
public class GreenSlime extends Foe {
public function GreenSlime(x:Number, y:Number, xspeed:Number, yspeed:Number, motion:Number, type:Number){
addFrameScript(0, frame1, 1, frame2, 4, frame5, 6, frame7, 12, frame13);
super(x, y, xspeed, yspeed, motion);
this.type = type;
setHP(5);
score = 50;
money = 1;
dropRate = 0.5;
}
function frame13(){
if (this){
kill();
};
}
function frame5(){
if (!dead){
gotoAndStop(1);
};
}
function frame7(){
(root as Main).makeSound("slime2", "f");
}
function frame1(){
stop();
}
override public function death(){
var a:Number;
a = 0;
while (a < 4) {
parent.addChild(new GreenSlimeBullet(x, y, NaN, NaN, (Math.random() * 360), 5));
a++;
};
}
function frame2(){
(root as Main).makeSound("slime", "f");
}
}
}//package foes
Section 96
//GunBot (foes.GunBot)
package foes {
import bullets.*;
public class GunBot extends Foe {
public function GunBot(x:Number, y:Number, xspeed:Number, yspeed:Number, motion:Number, type:Number){
addFrameScript(0, frame1, 1, frame2, 4, frame5, 7, frame8, 12, frame13);
super(x, y, xspeed, yspeed, motion);
this.type = type;
setHP(110);
this.boom = true;
score = 350;
money = 5;
dropRate = 1;
dropChance = 0.02;
}
function frame13(){
if (this){
kill();
};
}
function frame5(){
if (!dead){
gotoAndStop(1);
};
}
function frame1(){
stop();
}
function frame2(){
(root as Main).makeSound("metal", "f");
}
function frame8(){
(root as Main).makeSound("explode", "f");
}
override function special():Boolean{
if ((t % type) == 0){
parent.addChild(new RedBullet((x - 30), (y + 40), NaN, NaN, ((90 + (Math.random() * 6)) - 3), 7));
parent.addChild(new RedBullet((x + 30), (y + 40), NaN, NaN, ((90 + (Math.random() * 6)) - 3), 7));
};
return (false);
}
}
}//package foes
Section 97
//HomingBomb (foes.HomingBomb)
package foes {
import flash.display.*;
import bullets.*;
public class HomingBomb extends Foe {
public var zone:MovieClip;
public function HomingBomb(a:Number, b:Number, c:Number, d:Number, type:Number){
addFrameScript(0, frame1, 6, frame7, 17, frame18);
super(a, b, c, d);
setHP(14);
this.type = type;
score = 12;
if (type == 2){
score = 18;
setHP(22);
this.scaleX = (this.scaleY = 1.4);
};
if (type == 0){
score = 6;
setHP(8);
this.scaleX = (this.scaleY = 0.7);
};
this.boom = true;
}
function frame18(){
if (this){
kill();
};
}
function frame7(){
if (!dead){
gotoAndStop(1);
};
}
function frame1(){
stop();
}
override public function death(){
var a:Number;
if (type == 0){
parent.addChild(new HomingBullet(x, y, 4, 0));
parent.addChild(new HomingBullet(x, y, -4, 0));
};
if (type == 1){
parent.addChild(new HomingBullet(x, y, 3, 0));
parent.addChild(new HomingBullet(x, y, -3, 0));
parent.addChild(new HomingBullet(x, y, 0, 3));
parent.addChild(new HomingBullet(x, y, 0, -3));
};
if (type == 2){
a = 0;
while (a < 2) {
parent.addChild(new HomingBullet(x, y, (3 + a), 0));
parent.addChild(new HomingBullet(x, y, (-3 - a), 0));
parent.addChild(new HomingBullet(x, y, 0, (3 - a)));
parent.addChild(new HomingBullet(x, y, 0, (-3 - a)));
a++;
};
};
}
override function special():Boolean{
if (!zone){
return (false);
};
return (zone.hitTestPoint(player.x, player.y));
}
}
}//package foes
Section 98
//HugeBrick (foes.HugeBrick)
package foes {
public class HugeBrick extends Foe {
var decel:Number;
public function HugeBrick(x:Number, y:Number, xspeed:Number, yspeed:Number, motion:Number, type:Number){
addFrameScript(0, frame1, 5, frame6);
super(x, y, xspeed, yspeed, motion);
this.type = type;
setHP(Infinity);
score = 0;
money = 0;
dropRate = 0;
dropChance = 0;
cutoff = 200;
}
function frame6(){
if (!dead){
gotoAndStop(1);
};
}
function frame1(){
stop();
}
}
}//package foes
Section 99
//HugeRock (foes.HugeRock)
package foes {
import levels.*;
public class HugeRock extends Foe {
var b:Number;// = 3
public function HugeRock(x:Number, y:Number, xspeed:Number, yspeed:Number, motion:Number, type:Number){
b = 3;
addFrameScript(0, frame1, 1, frame2, 4, frame5, 7, frame8, 11, frame12);
super(x, y, xspeed, yspeed, motion);
this.delay = type;
setHP(90);
score = 300;
money = 4;
dropRate = 4;
dropChance = 0.25;
cutoff = 100;
deathSpin = false;
}
function frame12(){
if (this){
kill();
};
}
function frame5(){
if (!dead){
gotoAndStop(1);
};
}
function frame1(){
stop();
}
override public function death(){
(parent as Level).addFoe(new BigRock(((x + (Math.random() * 100)) - 50), ((y + (Math.random() * 60)) - 30), ((Math.random() * 6) - 3), ((Math.random() * 4) + yspeed), 0, 0));
(parent as Level).addFoe(new BigRock(((x + (Math.random() * 100)) - 50), ((y + (Math.random() * 60)) - 30), ((Math.random() * 6) - 3), ((Math.random() * 4) + yspeed), 0, 0));
(parent as Level).addFoe(new MediumRock(((x + (Math.random() * 100)) - 50), ((y + (Math.random() * 60)) - 30), ((Math.random() * 6) - 3), ((Math.random() * 4) + yspeed), 0, 0));
(parent as Level).addFoe(new SmallRock(((x + (Math.random() * 100)) - 50), ((y + (Math.random() * 60)) - 30), ((Math.random() * 6) - 3), ((Math.random() * 4) + yspeed), 0, 0));
(parent as Level).addFoe(new SmallRock(((x + (Math.random() * 100)) - 50), ((y + (Math.random() * 60)) - 30), ((Math.random() * 6) - 3), ((Math.random() * 4) + yspeed), 0, 0));
(parent as Level).addFoe(new TinyRock(((x + (Math.random() * 100)) - 50), ((y + (Math.random() * 60)) - 30), ((Math.random() * 6) - 3), ((Math.random() * 4) + yspeed), 0, 0));
(parent as Level).addFoe(new TinyRock(((x + (Math.random() * 100)) - 50), ((y + (Math.random() * 60)) - 30), ((Math.random() * 6) - 3), ((Math.random() * 4) + yspeed), 0, 0));
}
function frame2(){
(root as Main).makeSound("rock2", "f");
}
function frame8(){
(root as Main).makeSound("rock1", "f");
}
}
}//package foes
Section 100
//Hydra (foes.Hydra)
package foes {
import bullets.*;
public class Hydra extends Foe {
var left:Boolean;
var decel:Number;
var dir:Number;// = 0
var accel:Number;// = 0.2
var closed:Boolean;// = true
public function Hydra(x:Number, y:Number, left:Boolean, xspeed:Number, yspeed:Number, type:Number){
accel = 0.2;
closed = true;
dir = 0;
addFrameScript(0, frame1, 1, frame2, 2, frame3, 3, frame4, 4, frame5, 5, frame6, 6, frame7, 7, frame8, 8, frame9, 11, frame12, 12, frame13, 25, frame26);
super(x, y, xspeed, yspeed, 2);
if (left){
this.x = 600;
dir = 180;
} else {
this.x = -100;
this.scaleX = (this.scaleX * -1);
};
cutoff = 150;
this.left = left;
this.type = type;
setHP(200);
score = 800;
money = 6;
dropRate = 1;
deathSpin = false;
cutoff = 100;
}
function fire(){
var a:int;
a = 0;
while (a < 7) {
parent.addChild(new WaveBullet2(x, y, NaN, NaN, (((Math.random() * 20) - 10) + dir), ((Math.random() * 6) + 2)));
a++;
};
parent.addChild(new OrangeBullet(x, y, NaN, NaN, (((Math.random() * 20) - 10) + dir), ((Math.random() * 6) + 2)));
parent.addChild(new FlameBullet(x, y, NaN, NaN, (((Math.random() * 20) - 10) + dir), ((Math.random() * 6) + 2)));
}
function frame3(){
if (this){
fire();
};
}
function frame4(){
if (this){
fire();
};
}
function frame5(){
if (this){
fire();
};
}
function frame6(){
if (this){
fire();
};
}
function frame7(){
if (this){
fire();
};
}
function frame12(){
stop();
}
function frame13(){
(root as Main).makeSound("log2", "f");
}
function frame1(){
stop();
}
function frame2(){
if (this){
fire();
};
}
function frame8(){
if (this){
fire();
};
}
function frame9(){
if (this){
fire();
};
}
function frame26(){
if (this){
kill();
};
}
override function special():Boolean{
if (((((t % type) == 0)) && (closed))){
closed = false;
play();
};
return (false);
}
}
}//package foes
Section 101
//Kitten (foes.Kitten)
package foes {
public class Kitten extends Foe {
public function Kitten(x:Number, y:Number, xspeed:Number, yspeed:Number, motion:Number, type:Number){
addFrameScript(0, frame1, 4, frame5, 6, frame7, 17, frame18);
super(x, y, xspeed, yspeed, motion);
this.type = type;
setHP(1);
score = 30;
money = 1;
dropRate = 0.6;
}
function frame18(){
if (this){
kill();
};
}
function frame5(){
if (!dead){
gotoAndStop(1);
};
}
function frame7(){
(root as Main).makeSound("kitten", "f");
}
function frame1(){
kitten = (Math.floor((Math.random() * 6)) + 1);
stop();
}
}
}//package foes
Section 102
//LazorBot (foes.LazorBot)
package foes {
import bullets.*;
public class LazorBot extends Foe {
public function LazorBot(x:Number, y:Number, xspeed:Number, yspeed:Number, motion:Number, type:Number){
addFrameScript(0, frame1, 1, frame2, 4, frame5, 7, frame8, 12, frame13);
super(x, y, xspeed, yspeed, motion);
this.type = type;
setHP(110);
this.boom = true;
score = 350;
money = 5;
dropRate = 1;
dropChance = 0.02;
}
function frame13(){
if (this){
kill();
};
}
function frame5(){
if (!dead){
gotoAndStop(1);
};
}
function frame1(){
stop();
}
function frame2(){
(root as Main).makeSound("metal", "f");
}
function frame8(){
(root as Main).makeSound("explode", "f");
}
override function special():Boolean{
var a:int;
if ((t % type) == 0){
a = 4;
while (a > 0) {
parent.addChild(new RedLazor((x - 30), (y + 40), NaN, NaN, 90, (3 + a)));
parent.addChild(new RedLazor((x + 30), (y + 40), NaN, NaN, 90, (3 + a)));
a--;
};
};
return (false);
}
}
}//package foes
Section 103
//LeftLog (foes.LeftLog)
package foes {
public class LeftLog extends Foe {
public function LeftLog(a:Number, b:Number, c:Number, d:Number){
addFrameScript(0, frame1, 1, frame2, 4, frame5, 7, frame8, 13, frame14);
super(a, b, c, d);
setHP(6);
score = 50;
deathSpin = false;
dropChance = 0;
}
function frame14(){
if (this){
kill();
};
}
function frame5(){
if (!dead){
gotoAndStop(1);
};
}
function frame1(){
stop();
}
function frame2(){
(root as Main).makeSound("log", "f");
}
function frame8(){
(root as Main).makeSound("log2", "f");
}
}
}//package foes
Section 104
//Mage (foes.Mage)
package foes {
import bullets.*;
public class Mage extends Foe {
var decel:Number;
public function Mage(x:Number, y:Number, xspeed:Number, yspeed:Number, motion:Number, type:Number){
addFrameScript(0, frame1, 1, frame2, 4, frame5, 6, frame7, 20, frame21);
super(x, y, xspeed, yspeed, motion);
this.type = type;
setHP(32);
score = 250;
money = 4;
dropRate = 1;
dropChance = 0.02;
}
function frame5(){
if (!dead){
gotoAndStop(1);
};
}
function frame7(){
(root as Main).makeSound("eye", "f");
}
function frame1(){
stop();
}
function frame2(){
(root as Main).makeSound("eye", "f");
}
function frame21(){
if (this){
kill();
};
}
override function special():Boolean{
if ((t % type) == 0){
parent.addChild(new OrangeBomb(x, y, NaN, NaN, getAngle(x, y), 4, Math.floor(((Math.random() * 30) + 60))));
};
return (false);
}
}
}//package foes
Section 105
//MediumRock (foes.MediumRock)
package foes {
import levels.*;
public class MediumRock extends Foe {
public function MediumRock(x:Number, y:Number, xspeed:Number, yspeed:Number, motion:Number, type:Number){
addFrameScript(0, frame1, 1, frame2, 4, frame5, 7, frame8, 10, frame11);
super(x, y, xspeed, yspeed, motion);
this.delay = type;
setHP(12);
score = 100;
money = 2;
dropRate = 0.5;
dropChance = 0;
deathSpin = false;
}
function frame5(){
if (!dead){
gotoAndStop(1);
};
}
function frame1(){
stop();
}
override public function death(){
(parent as Level).addFoe(new SmallRock(((x + (Math.random() * 40)) - 20), ((y + (Math.random() * 40)) - 20), ((Math.random() * 6) - 3), ((Math.random() * 4) + yspeed), 0, 0));
(parent as Level).addFoe(new TinyRock(((x + (Math.random() * 40)) - 20), ((y + (Math.random() * 40)) - 20), ((Math.random() * 6) - 3), ((Math.random() * 4) + yspeed), 0, 0));
(parent as Level).addFoe(new SmallRock(((x + (Math.random() * 20)) - 10), ((y + (Math.random() * 20)) - 10), ((Math.random() * 6) - 3), ((Math.random() * 4) + yspeed), 0, 0));
(parent as Level).addFoe(new TinyRock(((x + (Math.random() * 20)) - 10), ((y + (Math.random() * 20)) - 10), ((Math.random() * 6) - 3), ((Math.random() * 4) + yspeed), 0, 0));
}
function frame11(){
if (this){
kill();
};
}
function frame2(){
(root as Main).makeSound("rock4", "f");
}
function frame8(){
(root as Main).makeSound("rock3", "f");
}
}
}//package foes
Section 106
//Missile (foes.Missile)
package foes {
import bullets.*;
public class Missile extends Foe {
public function Missile(a:Number, b:Number, c:Number, d:Number){
addFrameScript(0, frame1, 1, frame2, 4, frame5, 7, frame8, 17, frame18);
super(a, b, c, d);
setHP(60);
this.boom = true;
score = 0;
money = 0;
dropRate = 0;
dropChance = 0;
}
function frame18(){
if (this){
kill();
};
}
function frame5(){
if (!dead){
gotoAndStop(1);
};
}
function frame1(){
stop();
}
override public function death(){
var a:Number;
a = 2;
while (a < 7) {
parent.addChild(new OrangeBullet(x, y, NaN, NaN, ((90 + (Math.random() * 60)) - 30), (5 + (Math.random() * 4))));
a++;
};
}
function frame2(){
(root as Main).makeSound("metal", "f");
}
function frame8(){
(root as Main).makeSound("explode", "f");
}
override function special():Boolean{
if (this.y > (player.y - 200)){
return (true);
};
return (false);
}
}
}//package foes
Section 107
//Monolith (foes.Monolith)
package foes {
import bullets.*;
public class Monolith extends Foe {
public function Monolith(x:Number, y:Number, xspeed:Number, yspeed:Number, motion:Number, type:Number){
addFrameScript(0, frame1, 1, frame2, 4, frame5, 6, frame7, 35, frame36);
super(x, y, xspeed, yspeed, motion);
this.type = type;
setHP(1200);
score = 5000;
money = 7;
dropRate = 4;
dropChance = 0.1;
cutoff = 100;
deathSpin = false;
}
function frame5(){
if (!dead){
gotoAndStop(1);
};
}
function frame7(){
(root as Main).makeSound("explode", "f");
}
function frame1(){
stop();
}
function frame2(){
(root as Main).makeSound("rock3", "f");
}
function frame36(){
if (this){
kill();
};
}
override function special():Boolean{
var a:int;
var ss:Number;
if ((t % 30) == 0){
a = 0;
while (a < 360) {
parent.addChild(new RedBullet(x, y, NaN, NaN, (getAngle(x, y) + a), 5));
a = (a + 30);
};
};
if ((t % 30) == 1){
a = 10;
while (a < 360) {
parent.addChild(new RedBullet(x, y, NaN, NaN, (getAngle(x, y) + a), 5));
a = (a + 30);
};
};
if ((t % 30) == 2){
a = 20;
while (a < 360) {
parent.addChild(new RedBullet(x, y, NaN, NaN, (getAngle(x, y) + a), 5));
a = (a + 30);
};
};
if ((t % type) < 16){
ss = (2 + ((t % type) / 2));
parent.addChild(new RedDiamond(x, y, NaN, NaN, ((getAngle(x, y) + (Math.random() * 20)) - 10), (ss + (Math.random() * 2))));
parent.addChild(new RedBullet(x, y, NaN, NaN, ((getAngle(x, y) + (Math.random() * 10)) - 5), (ss + (Math.random() * 2))));
};
return (false);
}
}
}//package foes
Section 108
//Moor (foes.Moor)
package foes {
import bullets.*;
public class Moor extends Foe {
var left:Boolean;
var decel:Number;
var p:Number;// = 0
var accel:Number;// = 0.2
public function Moor(x:Number, y:Number, left:Boolean, type:Number){
accel = 0.2;
p = 0;
addFrameScript(0, frame1, 1, frame2, 4, frame5, 6, frame7, 14, frame15);
super(x, y, 0, 0, 0);
if (left){
this.x = 550;
this.scaleX = (this.scaleX * -1);
p = (p + 180);
} else {
this.x = -50;
};
cutoff = 150;
this.type = type;
this.left = left;
setHP(40);
score = 300;
money = 5;
dropRate = 1;
}
function frame15(){
if (this){
kill();
};
}
function frame5(){
if (!dead){
gotoAndStop(1);
};
}
function frame7(){
(root as Main).makeSound("fish2", "f");
}
function frame1(){
stop();
}
function frame2(){
(root as Main).makeSound("fish", "f");
}
override function special():Boolean{
p = (p + 4);
if (left){
xspeed = (xspeed - accel);
} else {
xspeed = (xspeed + accel);
};
if ((t % 2) == 0){
parent.addChild(new OrangeLazor(x, y, NaN, NaN, p, 3));
parent.addChild(new OrangeLazor(x, y, NaN, NaN, (360 - p), 3));
};
return (false);
}
}
}//package foes
Section 109
//Obelisk (foes.Obelisk)
package foes {
import bullets.*;
public class Obelisk extends Foe {
var decel:Number;
public function Obelisk(x:Number, y:Number, xspeed:Number, yspeed:Number, motion:Number, type:Number){
addFrameScript(0, frame1, 1, frame2, 4, frame5, 6, frame7, 35, frame36);
super(x, y, xspeed, yspeed, motion);
this.type = type;
setHP(330);
score = 700;
money = 4;
dropRate = 5;
dropChance = 0.2;
deathSpin = false;
cutoff = 100;
}
function frame5(){
if (!dead){
gotoAndStop(1);
};
}
function frame7(){
(root as Main).makeSound("explode", "f");
}
function frame1(){
stop();
}
function frame2(){
(root as Main).makeSound("rock3", "f");
}
function frame36(){
if (this){
kill();
};
}
override function special():Boolean{
if ((t % type) < 25){
parent.addChild(new RedDiamond(x, (y - 16), NaN, NaN, ((getAngle(x, y) + (Math.random() * 20)) - 10), (4 + ((t % type) / 2))));
parent.addChild(new RedDiamond(x, (y - 16), NaN, NaN, (((getAngle(x, y) + (Math.random() * 20)) - 10) + 180), (4 + ((t % type) / 2))));
};
return (false);
}
}
}//package foes
Section 110
//PinkJelly (foes.PinkJelly)
package foes {
import bullets.*;
public class PinkJelly extends Foe {
var decel:Number;
public function PinkJelly(x:Number, y:Number, xspeed:Number, yspeed:Number, motion:Number, type:Number){
addFrameScript(0, frame1, 1, frame2, 4, frame5, 6, frame7, 17, frame18);
super(x, y, xspeed, yspeed, motion);
this.type = type;
setHP(14);
score = 150;
money = 3;
dropRate = 0.5;
dropChance = 0.02;
}
function frame18(){
if (this){
kill();
};
}
function frame5(){
if (!dead){
gotoAndStop(1);
};
}
function frame7(){
(root as Main).makeSound("slime2", "f");
}
function frame1(){
stop();
}
function frame2(){
(root as Main).makeSound("slime", "f");
}
override function special():Boolean{
if ((t % type) == 0){
parent.addChild(new PinkBullet(x, y, 0, 3));
};
return (false);
}
}
}//package foes
Section 111
//PurpleJelly (foes.PurpleJelly)
package foes {
import bullets.*;
public class PurpleJelly extends Foe {
var decel:Number;
public function PurpleJelly(x:Number, y:Number, xspeed:Number, yspeed:Number, motion:Number, type:Number){
addFrameScript(0, frame1, 1, frame2, 5, frame6, 6, frame7, 17, frame18);
super(x, y, xspeed, yspeed, motion);
this.type = type;
setHP(14);
score = 150;
money = 3;
dropRate = 0.5;
dropChance = 0.02;
}
function frame18(){
if (this){
kill();
};
}
function frame6(){
if (!dead){
gotoAndStop(1);
};
}
function frame7(){
(root as Main).makeSound("slime2", "f");
}
function frame1(){
stop();
}
function frame2(){
(root as Main).makeSound("slime", "f");
}
override function special():Boolean{
if ((t % type) < 4){
parent.addChild(new PurpleBullet(x, y, NaN, NaN, getAngle(x, y), (6 + (t % type))));
};
return (false);
}
}
}//package foes
Section 112
//RedSlime (foes.RedSlime)
package foes {
import bullets.*;
public class RedSlime extends Foe {
public function RedSlime(x:Number, y:Number, xspeed:Number, yspeed:Number, motion:Number, type:Number){
addFrameScript(0, frame1, 1, frame2, 4, frame5, 6, frame7, 17, frame18);
super(x, y, xspeed, yspeed, motion);
this.type = type;
setHP(32);
score = 150;
money = 4;
dropRate = 0.8;
}
function frame18(){
if (this){
kill();
};
}
function frame5(){
if (!dead){
gotoAndStop(1);
};
}
function frame7(){
(root as Main).makeSound("slime2", "f");
}
function frame1(){
stop();
}
override public function death(){
var a:Number;
a = 0;
while (a < 7) {
parent.addChild(new SmallRedBullet(x, y, NaN, NaN, (Math.random() * 360), (3 + (Math.random() * 3))));
a++;
};
}
function frame2(){
(root as Main).makeSound("slime", "f");
}
}
}//package foes
Section 113
//RightLog (foes.RightLog)
package foes {
public class RightLog extends Foe {
public function RightLog(a:Number, b:Number, c:Number, d:Number){
addFrameScript(0, frame1, 1, frame2, 4, frame5, 7, frame8, 13, frame14);
super(a, b, c, d);
setHP(6);
score = 50;
deathSpin = false;
dropChance = 0;
}
function frame14(){
if (this){
kill();
};
}
function frame5(){
if (!dead){
gotoAndStop(1);
};
}
function frame1(){
stop();
}
function frame2(){
(root as Main).makeSound("log", "f");
}
function frame8(){
(root as Main).makeSound("log2", "f");
}
}
}//package foes
Section 114
//SeaBomb (foes.SeaBomb)
package foes {
import bullets.*;
public class SeaBomb extends Foe {
var b:Number;
public function SeaBomb(x:Number, y:Number, xspeed:Number, yspeed:Number, motion:Number, type:Number){
addFrameScript(0, frame1, 1, frame2, 6, frame7, 7, frame8, 17, frame18);
super(x, y, xspeed, yspeed, motion);
this.delay = type;
setHP(60);
score = 200;
money = 3;
dropRate = 5;
}
function frame18(){
if (this){
kill();
};
}
function frame7(){
if (!dead){
gotoAndStop(1);
};
}
function frame1(){
stop();
}
override public function death(){
var a:Number;
trace("BOOM");
a = 0;
while (a < delay) {
parent.addChild(new SmallRedBullet(x, y, NaN, NaN, (Math.random() * 360), 6));
parent.addChild(new SmallRedBullet(x, y, NaN, NaN, (Math.random() * 360), 4));
a++;
};
}
function frame2(){
(root as Main).makeSound("metal", "f");
}
function frame8(){
(root as Main).makeSound("explode", "f");
}
override function special():Boolean{
if (this.y > player.y){
return (true);
};
return (false);
}
}
}//package foes
Section 115
//Shark (foes.Shark)
package foes {
import bullets.*;
public class Shark extends Foe {
var left:Boolean;
var decel:Number;
var accel:Number;// = 0.2
public function Shark(x:Number, y:Number, left:Boolean, type:Number){
accel = 0.2;
addFrameScript(0, frame1, 5, frame6, 20, frame21);
super(x, y, 0, 0, 0);
if (left){
this.x = 550;
this.scaleX = (this.scaleX * -1);
} else {
this.x = -50;
};
cutoff = 150;
this.type = type;
this.left = left;
setHP(70);
score = 300;
money = 4;
dropRate = 1;
}
function frame6(){
if (!dead){
gotoAndStop(1);
};
}
function frame1(){
stop();
}
function frame21(){
if (this){
kill();
};
}
override function special():Boolean{
if (left){
xspeed = (xspeed - accel);
} else {
xspeed = (xspeed + accel);
};
if ((t % type) == 0){
parent.addChild(new BlueBullet(x, y, NaN, NaN, (Math.random() * 360), ((Math.random() * 2) + 3)));
};
return (false);
}
}
}//package foes
Section 116
//Shroom (foes.Shroom)
package foes {
import bullets.*;
public class Shroom extends Foe {
var decel:Number;
public function Shroom(x:Number, y:Number, xspeed:Number, yspeed:Number, motion:Number, type:Number){
addFrameScript(0, frame1, 1, frame2, 4, frame5, 7, frame8, 18, frame19);
super(x, y, xspeed, yspeed, motion);
this.type = type;
setHP(12);
score = 100;
money = 2;
dropRate = 2;
}
function frame5(){
if (!dead){
gotoAndStop(1);
};
}
function frame19(){
if (this){
kill();
};
}
function frame1(){
stop();
}
function frame2(){
(root as Main).makeSound("shroom", "f");
}
function frame8(){
(root as Main).makeSound("shroom2", "f");
}
override function special():Boolean{
if ((t % type) == 0){
parent.addChild(new SporeBullet(x, y, 0, 0));
};
return (false);
}
}
}//package foes
Section 117
//Shrub (foes.Shrub)
package foes {
import bullets.*;
public class Shrub extends Foe {
var decel:Number;
public function Shrub(x:Number, y:Number, xspeed:Number, yspeed:Number, motion:Number, type:Number){
addFrameScript(0, frame1, 1, frame2, 4, frame5, 6, frame7, 17, frame18);
super(x, y, xspeed, yspeed, motion);
this.type = type;
setHP(24);
score = 100;
money = 4;
dropRate = 0.7;
dropChance = 0.03;
}
function frame18(){
if (this){
kill();
};
}
function frame5(){
if (!dead){
gotoAndStop(1);
};
}
function frame7(){
(root as Main).makeSound("bush2", "f");
}
function frame1(){
stop();
}
function frame2(){
(root as Main).makeSound("bush", "f");
}
override function special():Boolean{
if ((t % type) == 0){
parent.addChild(new FlameBullet(x, y, NaN, NaN, ((getAngle(x, y) + (Math.random() * 20)) - 10), 3));
};
return (false);
}
}
}//package foes
Section 118
//SlimeKing (foes.SlimeKing)
package foes {
import drops.*;
import bullets.*;
public class SlimeKing extends Foe {
var decel:Number;
var halt:Boolean;// = true
var b:Number;// = 1
var m:Number;// = 1
var p:Number;// = 0
var u:Number;// = 0
var o:Number;// = 0
var w:Number;// = 0
var bx2:Number;
var mode2:Number;// = 0
var mode:Number;// = 0
public function SlimeKing(x:Number, y:Number, xspeed:Number, yspeed:Number, motion:Number, type:Number){
p = 0;
o = 0;
b = 1;
m = 1;
halt = true;
mode = 0;
mode2 = 0;
w = 0;
u = 0;
addFrameScript(0, frame1, 1, frame2, 4, frame5, 5, frame6, 9, frame10, 16, frame17, 21, frame22, 50, frame51);
super(x, y, xspeed, yspeed, motion);
this.type = type;
setHP(2000);
score = 20000;
money = 3;
dropRate = 25;
cutoff = 200;
deathSpin = false;
boss = true;
}
function frame10(){
(root as Main).makeSound("explode", "f");
}
function frame5(){
if (!dead){
gotoAndStop(1);
};
}
function frame6(){
(root as Main).makeSound("explode", "f");
}
function frame1(){
stop();
}
function frame2(){
(root as Main).makeSound("slime", "f");
}
function frame17(){
(root as Main).makeSound("explode", "f");
}
function frame22(){
(root as Main).makeSound("explode", "f");
}
override function special():Boolean{
var a:int;
by = (y + 50);
bx = (x - 120);
bx2 = (x + 120);
w++;
if ((((mode == 1)) && ((w > 30)))){
parent.addChild(new YellowBullet(bx, by, NaN, NaN, (Math.random() * 360), 4));
parent.addChild(new YellowBullet(bx2, by, NaN, NaN, (Math.random() * 360), 4));
} else {
if ((((mode == 2)) && ((w > 70)))){
if ((t % 32) < 16){
parent.addChild(new YellowBullet(bx, by, NaN, NaN, getAngle(bx, by), (4 + (t % 16))));
parent.addChild(new YellowBullet(bx2, by, NaN, NaN, getAngle(bx2, by), (4 + (t % 16))));
};
} else {
if ((((mode == 3)) && ((w > 50)))){
a = 0;
while (a < 2) {
parent.addChild(new YellowBullet(bx, by, NaN, NaN, (Math.random() * 360), 3));
parent.addChild(new YellowBullet(bx2, by, NaN, NaN, (Math.random() * 360), 3));
a++;
};
} else {
if ((((mode == 4)) && ((w > 50)))){
a = 0;
while (a < 2) {
parent.addChild(new YellowBullet(bx2, by, NaN, NaN, ((-90 + ((t % 100) * 8)) + (Math.random() * 3)), (4 + a)));
parent.addChild(new YellowBullet(bx, by, NaN, NaN, ((-90 - ((t % 100) * 8)) + (Math.random() * 3)), (4 + a)));
a++;
};
} else {
if ((((mode == 5)) && ((w > 50)))){
if ((t % 5) == 0){
if ((t % 40) > 19){
b = 0;
while (b < 360) {
parent.addChild(new YellowBullet2(bx, by, NaN, NaN, ((b + ((t % 20) * 4)) + u), (2 + ((t % 20) / 5))));
parent.addChild(new YellowBullet2(bx2, by, NaN, NaN, ((b + ((t % 20) * 4)) + u), (2 + ((t % 20) / 5))));
u = (u + 0.3);
b = (b + 40);
};
};
};
};
};
};
};
};
if (HP > ((maxHP * 4) / 5)){
if (mode != 1){
mode = 1;
w = 0;
superArmor = 0;
extraHeart();
};
} else {
if (HP > ((maxHP * 3) / 5)){
if (mode != 2){
mode = 2;
w = 0;
superArmor = 60;
parent.addChild(new Heart(x, y));
};
} else {
if (HP > ((maxHP * 2) / 5)){
if (mode != 3){
mode = 3;
w = 0;
superArmor = 60;
extraHeart();
};
} else {
if (HP > ((maxHP * 1) / 5)){
if (mode != 4){
mode = 4;
w = 0;
superArmor = 60;
parent.addChild(new Heart(x, y));
};
} else {
if (HP < ((maxHP * 1) / 5)){
if (mode != 5){
mode = 5;
w = 0;
superArmor = 60;
};
};
};
};
};
};
return (false);
}
function frame51(){
if (this){
kill();
};
}
}
}//package foes
Section 119
//SlimeKing2 (foes.SlimeKing2)
package foes {
import drops.*;
import bullets.*;
public class SlimeKing2 extends SlimeKing {
public function SlimeKing2(x:Number, y:Number, xspeed:Number, yspeed:Number, motion:Number, type:Number){
super(x, y, xspeed, yspeed, motion, type);
setHP(8000);
score = 100000;
money = 3;
dropRate = 25;
}
override function special():Boolean{
var a:int;
var b:int;
by = (y + 50);
bx = (x - 120);
bx2 = (x + 120);
w++;
if ((((mode == 1)) && ((w > 30)))){
if ((t % 5) == 0){
if ((t % 40) < 20){
b = 0;
while (b < 360) {
parent.addChild(new LeafBullet(bx, by, NaN, NaN, ((b + ((t % 20) * 6)) + u), (1.5 + ((t % 10) / 6))));
parent.addChild(new LeafBullet(bx2, by, NaN, NaN, ((b + ((t % 20) * 6)) + u), (1.5 + ((t % 10) / 6))));
u = (u + 0.1);
b = (b + 40);
};
};
if ((t % 40) > 19){
b = 0;
while (b < 360) {
parent.addChild(new YellowBullet2(bx, by, NaN, NaN, ((b + ((t % 20) * 4)) + u), (2 + ((t % 20) / 5))));
parent.addChild(new YellowBullet2(bx2, by, NaN, NaN, ((b + ((t % 20) * 4)) + u), (2 + ((t % 20) / 5))));
u = (u + 0.3);
b = (b + 40);
};
};
};
} else {
if ((((mode == 2)) && ((w > 140)))){
if ((t % 60) < 6){
b = 0;
while (b < 3) {
parent.addChild(new BigWhiteBullet(bx, by, NaN, NaN, ((getAngle(bx, by) + (Math.random() * 30)) - 15), (2 + ((t % 6) / 2))));
parent.addChild(new BigWhiteBullet(bx2, by, NaN, NaN, ((getAngle(bx2, by) + (Math.random() * 80)) - 40), (2 + ((t % 6) / 2))));
parent.addChild(new YellowBullet2(bx, by, NaN, NaN, ((getAngle(bx, by) + (Math.random() * 40)) - 20), (2 + ((t % 6) / 2))));
parent.addChild(new YellowBullet2(bx2, by, NaN, NaN, ((getAngle(bx2, by) + (Math.random() * 120)) - 60), (2 + ((t % 6) / 2))));
b++;
};
};
} else {
if ((((mode == 3)) && ((w > 50)))){
if ((t % 3) == 0){
b = 0;
while (b < 3) {
p = (p + 3);
parent.addChild(new LeafBullet(150, 150, NaN, NaN, (p + u), 2.5));
parent.addChild(new LeafBullet(350, 150, NaN, NaN, ((360 - p) + u), 2.5));
p = (p + 3);
parent.addChild(new YellowBullet(150, 150, NaN, NaN, (p + u), 1.8));
parent.addChild(new YellowBullet(350, 150, NaN, NaN, ((360 - p) + u), 1.8));
b++;
};
u = (u + 0.1);
};
} else {
if ((((mode == 4)) && ((w > 120)))){
b = 0;
while (b < 3) {
p = (p + 1);
if ((t % 2) == 0){
parent.addChild(new YellowBullet(bx, by, NaN, NaN, ((90 - p) + u), 2.5));
parent.addChild(new YellowBullet(bx2, by, NaN, NaN, ((90 + p) + u), 2.5));
u = (u + 0.2);
};
b++;
};
b = 0;
while (b < 3) {
p = (p + 1);
if ((t % 2) == 1){
parent.addChild(new YellowBullet(bx, by, NaN, NaN, (((90 - p) + u) + 192), 2.5));
parent.addChild(new YellowBullet(bx2, by, NaN, NaN, (((90 + p) + u) + 192), 2.5));
u = (u + 0.2);
};
b++;
};
} else {
if ((((mode == 5)) && ((w > 120)))){
parent.addChild(new GreenBullet(bx, by, ((-(t) * 6) - u), 5, (100 - (t % 100))));
parent.addChild(new GreenBullet(bx2, by, ((t * 6) + u), 5, (120 - (t % 100))));
parent.addChild(new GreenBullet(bx, by, (((-(t) * 6) - u) + 180), (3 + (t % 4)), (100 - (t % 100))));
parent.addChild(new GreenBullet(bx2, by, (((t * 6) + u) + 180), (3 + (t % 4)), (100 - (t % 100))));
parent.addChild(new LeafBullet(bx, by, NaN, NaN, ((-(t) * 5) - u), 3.5));
parent.addChild(new LeafBullet(bx2, by, NaN, NaN, ((t * 5) + u), 3.5));
u = (u + 0.4);
} else {
if ((((mode == 6)) && ((w > 120)))){
if ((t % 2) == 0){
parent.addChild(new GreenBall(bx, by, ((-(t) * 7) - u), 3));
parent.addChild(new GreenBall(bx2, by, ((t * 7) + u), 3));
parent.addChild(new LeafBullet(bx, by, NaN, NaN, ((-(t) * 5) - u), 6));
parent.addChild(new LeafBullet(bx2, by, NaN, NaN, ((t * 5) + u), 6));
parent.addChild(new GreenSlimeBullet(bx, by, NaN, NaN, ((-(t) * 6) - u), 4));
parent.addChild(new GreenSlimeBullet(bx2, by, NaN, NaN, ((t * 6) + u), 4));
parent.addChild(new GreenBullet(bx, by, ((-(t) * 9) - u), 5.5, (50 - (t % 50))));
parent.addChild(new GreenBullet(bx2, by, ((t * 9) + u), 5.5, (50 - (t % 50))));
u = (u + 0.1);
};
} else {
if ((((mode == 7)) && ((w > 120)))){
if ((t % 3) == 0){
if ((t % 40) < 20){
b = 0;
while (b < 360) {
parent.addChild(new LeafBullet(bx, by, NaN, NaN, ((b + ((t % 20) * 2)) + u), (1.5 + ((t % 20) / 4))));
parent.addChild(new LeafBullet(bx2, by, NaN, NaN, ((b + ((t % 20) * 2)) + u), (1.5 + ((t % 20) / 4))));
u = (u + 0.1);
b = (b + 40);
};
};
if ((t % 40) > 19){
b = 0;
while (b < 360) {
parent.addChild(new PurpleBullet(bx, by, NaN, NaN, ((b + ((t % 20) * 2)) + u), (1.5 + ((t % 20) / 5))));
parent.addChild(new PurpleBullet(bx2, by, NaN, NaN, ((b + ((t % 20) * 2)) + u), (1.5 + ((t % 20) / 5))));
u = (u + 0.3);
b = (b + 40);
};
};
};
} else {
if ((((mode == 8)) && ((w > 120)))){
o = (Math.sin(t) + 1);
if ((t % 2) == 0){
parent.addChild(new GreenBall(bx, by, ((-(t) * 7) - u), (2 + (o * 2))));
parent.addChild(new GreenBall(bx2, by, ((t * 7) + u), (2 + (o * 2))));
parent.addChild(new LeafBullet(bx, by, NaN, NaN, ((-(t) * 5) - u), (4 + o)));
parent.addChild(new LeafBullet(bx2, by, NaN, NaN, ((t * 5) + u), (4 + o)));
parent.addChild(new YellowBullet2(bx, by, NaN, NaN, ((-(t) * 6) - u), (3 + o)));
parent.addChild(new YellowBullet2(bx2, by, NaN, NaN, ((t * 6) + u), (3 + o)));
parent.addChild(new WhiteBullet(bx, by, NaN, NaN, ((-(t) * 7) - u), (2.5 + o)));
parent.addChild(new WhiteBullet(bx2, by, NaN, NaN, ((t * 7) + u), (2.5 + o)));
parent.addChild(new GreenBullet(bx, by, ((-(t) * 9) - u), (3 + (Math.random() * 2)), (80 - (t % 80))));
parent.addChild(new GreenBullet(bx2, by, ((t * 9) + u), (3 + (Math.random() * 2)), (80 - (t % 80))));
u = (u + 0.1);
};
};
};
};
};
};
};
};
};
if (HP > ((maxHP * 7) / 8)){
if (mode != 1){
mode = 1;
superArmor = 0;
};
} else {
if (HP > ((maxHP * 6) / 8)){
if (mode != 2){
mode = 2;
nextPattern(10, 20);
w = 0;
extraHeart();
};
} else {
if (HP > ((maxHP * 5) / 8)){
if (mode != 3){
mode = 3;
nextPattern(10, 20);
w = 0;
parent.addChild(new Heart(x, y));
};
} else {
if (HP > ((maxHP * 4) / 8)){
if (mode != 4){
mode = 4;
nextPattern(15, 20);
w = 0;
extraHeart();
};
} else {
if (HP > ((maxHP * 3) / 8)){
if (mode != 5){
mode = 5;
nextPattern(15, 20);
w = 0;
parent.addChild(new Heart(x, y));
};
} else {
if (HP > ((maxHP * 2) / 8)){
if (mode != 6){
mode = 6;
nextPattern(15, 20);
w = 0;
extraHeart();
};
} else {
if (HP > ((maxHP * 1) / 8)){
if (mode != 7){
mode = 7;
nextPattern(20, 20);
w = 0;
parent.addChild(new Heart(x, y));
};
} else {
if (HP < ((maxHP * 1) / 8)){
if (mode != 8){
mode = 8;
nextPattern(20, 20);
w = 0;
};
};
};
};
};
};
};
};
};
return (false);
}
}
}//package foes
Section 120
//Slinger (foes.Slinger)
package foes {
import bullets.*;
public class Slinger extends Foe {
var decel:Number;
public function Slinger(x:Number, y:Number, xspeed:Number, yspeed:Number, motion:Number, type:Number){
addFrameScript(0, frame1, 1, frame2, 4, frame5, 6, frame7, 20, frame21);
super(x, y, xspeed, yspeed, motion);
this.type = type;
setHP(35);
score = 250;
money = 3;
dropRate = 3;
dropChance = 0.02;
}
function frame5(){
if (!dead){
gotoAndStop(1);
};
}
function frame7(){
(root as Main).makeSound("metal", "f");
}
function frame1(){
stop();
}
function frame2(){
(root as Main).makeSound("metal", "f");
}
function frame21(){
if (this){
kill();
};
}
override function special():Boolean{
if ((t % type) == 0){
parent.addChild(new OrangeBullet(x, y, NaN, NaN, getAngle(x, y), 7));
};
return (false);
}
}
}//package foes
Section 121
//SmallBrick (foes.SmallBrick)
package foes {
public class SmallBrick extends Foe {
var decel:Number;
public function SmallBrick(x:Number, y:Number, xspeed:Number, yspeed:Number, motion:Number, type:Number){
addFrameScript(0, frame1, 5, frame6);
super(x, y, xspeed, yspeed, motion);
this.type = type;
setHP(Infinity);
score = 0;
money = 0;
dropRate = 0;
dropChance = 0;
cutoff = 100;
}
function frame6(){
if (!dead){
gotoAndStop(1);
};
}
function frame1(){
stop();
}
}
}//package foes
Section 122
//SmallRock (foes.SmallRock)
package foes {
public class SmallRock extends Foe {
public function SmallRock(x:Number, y:Number, xspeed:Number, yspeed:Number, motion:Number, type:Number){
addFrameScript(0, frame1, 1, frame2, 4, frame5, 7, frame8, 11, frame12);
super(x, y, xspeed, yspeed, motion);
this.delay = type;
setHP(4);
score = 0;
money = 1;
dropRate = 0.5;
dropChance = 0;
}
function frame12(){
if (this){
kill();
};
}
function frame5(){
if (!dead){
gotoAndStop(1);
};
}
function frame1(){
stop();
}
function frame2(){
(root as Main).makeSound("rock5", "f");
}
function frame8(){
(root as Main).makeSound("rock4", "f");
}
}
}//package foes
Section 123
//Sphinx (foes.Sphinx)
package foes {
import drops.*;
import bullets.*;
public class Sphinx extends Foe {
var inc:Number;// = 1
var ball1:OrbitBall;
var ball2:OrbitBall;
var decel:Number;
var halt:Boolean;// = true
var b:Number;// = 1
var m:Number;// = 1
var p:Number;// = 0
var o:Number;// = 0
var w:Number;// = 0
var bx2:Number;
var mode2:Number;// = 0
var mode:Number;// = 0
public function Sphinx(x:Number, y:Number, xspeed:Number, yspeed:Number, motion:Number, type:Number){
p = 0;
o = 0;
b = 1;
m = 1;
halt = true;
mode = 0;
mode2 = 0;
w = 0;
inc = 1;
addFrameScript(0, frame1, 1, frame2, 4, frame5, 8, frame9, 14, frame15, 22, frame23, 30, frame31, 37, frame38, 45, frame46, 76, frame77);
super(x, y, xspeed, yspeed, motion);
this.type = type;
setHP(25000);
score = 80000;
money = 6;
dropRate = 40;
cutoff = 200;
deathSpin = false;
boss = true;
}
function frame15(){
(root as Main).makeSound("explode", "f");
}
function frame5(){
if (!dead){
gotoAndStop(1);
};
}
function frame23(){
(root as Main).makeSound("explode", "f");
}
function frame1(){
stop();
}
function frame2(){
(root as Main).makeSound("rock3", "f");
}
function frame31(){
(root as Main).makeSound("explode", "f");
}
function frame38(){
(root as Main).makeSound("explode", "f");
}
function frame9(){
(root as Main).makeSound("explode", "f");
}
function frame46(){
(root as Main).makeSound("explode", "f");
}
override function special():Boolean{
var b:int;
var a:uint;
by = (y + 50);
bx = (x - 120);
bx2 = (x + 120);
w++;
if (t == 360){
t = 0;
};
if ((((mode == 0)) && ((w > 60)))){
parent.addChild(new RedDiamond((x - 35), (y - 90), NaN, NaN, (t * 4), 5));
parent.addChild(new RedDiamond((x + 35), (y - 90), NaN, NaN, (360 - (t * 4)), 5));
parent.addChild(new OrangeLazor((x - 35), (y - 90), NaN, NaN, ((t * 4) + 2), 3));
parent.addChild(new OrangeLazor((x + 35), (y - 90), NaN, NaN, ((360 - (t * 4)) - 2), 3));
parent.addChild(new YellowBullet2((x - 35), (y - 90), NaN, NaN, ((t * 4) + 2), 7));
parent.addChild(new YellowBullet2((x + 35), (y - 90), NaN, NaN, ((360 - (t * 4)) - 2), 7));
} else {
if ((((mode == 1)) && ((w > 120)))){
if ((((ball1 == undefined)) || (ball1.dead))){
ball1 = new OrbitBall(0, 0, -90, 150);
parent.addChild(ball1);
};
} else {
if ((((mode == 2)) && ((w > 50)))){
if ((t % 10) == 0){
parent.addChild(new OrangeBomb(x, (y + 20), NaN, NaN, ((getAngle(x, y) + (Math.random() * 90)) - 45), ((Math.random() * 4) + 3), 40, 13));
};
} else {
if ((((mode == 3)) && ((w > 70)))){
if ((t % 90) < 9){
a = 18;
while (a > 0) {
parent.addChild(new RedDiamond((x - 100), (y - 60), NaN, NaN, (Math.random() * 360), ((Math.random() * 4) + 6)));
parent.addChild(new SmallRedBullet((x - 100), (y - 60), NaN, NaN, (Math.random() * 360), ((Math.random() * 2) + 3)));
a--;
};
};
if (((((t % 90) > 45)) && (((t % 90) < 53)))){
a = 18;
while (a > 0) {
parent.addChild(new RedDiamond((x + 100), (y - 60), NaN, NaN, (Math.random() * 360), ((Math.random() * 4) + 4)));
parent.addChild(new SmallRedBullet((x + 100), (y - 60), NaN, NaN, (Math.random() * 360), ((Math.random() * 2) + 3)));
a--;
};
};
} else {
if ((((mode == 4)) && ((w > 120)))){
if ((t % 45) == 0){
parent.addChild(new YellowBullet3(x, (y + 20), NaN, NaN, getAngle(x, y), 6, 6, 17, 3));
};
} else {
if ((((mode == 5)) && ((w > 40)))){
t++;
parent.addChild(new RedDiamond((x - 100), (y - 60), NaN, NaN, (getAngle(x, y) + ((Math.sin(t) * 360) / 6)), 5));
parent.addChild(new SmallRedBullet((x - 100), (y - 60), NaN, NaN, (getAngle(x, y) - ((Math.sin(t) * 360) / 6)), 5));
parent.addChild(new RedDiamond((x + 100), (y - 60), NaN, NaN, (getAngle(x, y) - ((Math.sin(t) * 360) / 6)), 5));
parent.addChild(new SmallRedBullet((x + 100), (y - 60), NaN, NaN, (getAngle(x, y) + ((Math.sin(t) * 360) / 6)), 5));
} else {
if ((((mode == 6)) && ((w > 60)))){
parent.addChild(new RedDiamond(x, (y - 30), NaN, NaN, (Math.random() * 360), 7));
parent.addChild(new RedDiamond(x, (y - 30), NaN, NaN, (Math.random() * 360), 5));
parent.addChild(new YellowBullet2(x, (y - 30), NaN, NaN, (Math.random() * 360), 4.5));
parent.addChild(new OrangeLazor(x, (y - 30), NaN, NaN, (Math.random() * 360), 4));
parent.addChild(new SmallRedBullet(x, (y - 30), NaN, NaN, (Math.random() * 360), 5.5));
parent.addChild(new YellowBullet(x, (y - 30), NaN, NaN, (Math.random() * 360), 3.5));
parent.addChild(new OrangeBullet(x, (y - 30), NaN, NaN, (Math.random() * 360), 6));
};
};
};
};
};
};
};
if (HP > ((maxHP * 6) / 7)){
if (mode != 0){
mode = 0;
w = 0;
superArmor = 0;
extraHeart();
};
} else {
if (HP > ((maxHP * 5) / 7)){
if (mode != 1){
mode = 1;
w = 0;
superArmor = 60;
parent.addChild(new Heart(x, y));
};
} else {
if (HP > ((maxHP * 4) / 7)){
if (mode != 2){
mode = 2;
w = 0;
superArmor = 60;
ball1.play();
extraHeart();
};
} else {
if (HP > ((maxHP * 3) / 7)){
if (mode != 3){
mode = 3;
w = 0;
p = 0;
superArmor = 60;
parent.addChild(new Heart(x, y));
};
} else {
if (HP > ((maxHP * 2) / 7)){
if (mode != 4){
mode = 4;
w = 0;
superArmor = 60;
extraHeart();
};
} else {
if (HP > ((maxHP * 1) / 7)){
if (mode != 5){
mode = 5;
w = 0;
superArmor = 60;
parent.addChild(new Heart(x, y));
};
} else {
if (HP <= ((maxHP * 1) / 7)){
if (mode != 6){
mode = 6;
w = 0;
superArmor = 60;
};
};
};
};
};
};
};
};
return (false);
}
function frame77(){
if (this){
kill();
};
}
}
}//package foes
Section 124
//Sphinx2 (foes.Sphinx2)
package foes {
import drops.*;
import bullets.*;
public class Sphinx2 extends Sphinx {
var u:Number;// = 0
public function Sphinx2(x:Number, y:Number, xspeed:Number, yspeed:Number, motion:Number, type:Number){
u = 0;
super(x, y, xspeed, yspeed, motion, type);
setHP(55000);
score = 400000;
money = 6;
dropRate = 30;
}
override function special():Boolean{
var b:int;
by = (y + 50);
bx = (x - 120);
bx2 = (x + 120);
w++;
u = (u + 0.2);
if (t == 360){
t = 0;
};
if ((((mode == 0)) && ((w > 60)))){
parent.addChild(new DemonBullet(x, (y + 20), NaN, NaN, ((t * 13) + u), 4));
parent.addChild(new OrangeBullet(x, (y + 20), NaN, NaN, ((t * 6) + u), 5));
parent.addChild(new OrangeBullet(x, (y + 20), NaN, NaN, ((t * 5) + u), 3));
parent.addChild(new OrangeLazor(x, (y + 20), NaN, NaN, ((t * 7) + u), 7));
} else {
if ((((mode == 1)) && ((w > 120)))){
if ((t % 8) == 0){
b = 3;
while (b < 9) {
parent.addChild(new DemonBullet(x, (y - 30), NaN, NaN, ((t * 2) + u), (4 + (b * 2))));
parent.addChild(new DemonBullet(x, (y - 30), NaN, NaN, (((t * 2) + u) + 180), (4 + (b * 2))));
b++;
};
};
if ((t % 30) == 0){
b = 0;
while (b < 360) {
parent.addChild(new OrangeLazor(x, (y - 30), NaN, NaN, (b + u), 6));
b = (b + 10);
};
};
if ((t % 30) == 10){
b = 0;
while (b < 360) {
parent.addChild(new OrangeBullet(x, (y - 30), NaN, NaN, (b + u), 5));
b = (b + 6);
};
};
if ((t % 30) == 20){
b = 0;
while (b < 360) {
parent.addChild(new WaveBullet2(x, (y - 30), NaN, NaN, (b + u), 4));
b = (b + 20);
};
};
} else {
if ((((mode == 2)) && ((w > 50)))){
if ((t % 2) == 0){
parent.addChild(new OrangeBullet((Math.random() * 500), -5, NaN, NaN, 90, (2 + (Math.random() * 2))));
};
if ((t % 200) == 0){
b = 0;
while (b < 8) {
parent.addChild(new BeamLazor((Math.random() * 500), 603, (((90 - 180) + (Math.random() * 30)) - 15)));
b++;
};
};
if ((t % 200) == 100){
b = 0;
while (b < 8) {
parent.addChild(new BeamLazor((Math.random() * 500), -3, ((90 + (Math.random() * 30)) - 15)));
b++;
};
};
if ((t % 200) == 50){
b = 0;
while (b < 9) {
parent.addChild(new BeamLazor(-3, (Math.random() * 600), ((0 + (Math.random() * 30)) - 15)));
b++;
};
};
if ((t % 200) == 150){
b = 0;
while (b < 9) {
parent.addChild(new BeamLazor(503, (Math.random() * 600), ((180 + (Math.random() * 30)) - 15)));
b++;
};
};
} else {
if ((((mode == 3)) && ((w > 70)))){
if ((t % 10) == 0){
parent.addChild(new OrangeBomb(x, (y - 20), NaN, NaN, (t * 3), 4, 40, 6));
};
if ((t % 5) == 0){
parent.addChild(new OrangeBomb(x, (y - 20), NaN, NaN, ((t * 3) + 180), 10, 48, 5));
};
} else {
if ((((mode == 4)) && ((w > 120)))){
if ((t % 50) == 0){
};
if ((t % 30) < 5){
b = 0;
while (b < 360) {
parent.addChild(new YellowBullet((x - 100), (y - 60), NaN, NaN, ((-(b) - (t * 8)) - u), 3));
parent.addChild(new YellowBullet((x + 100), (y - 60), NaN, NaN, ((b + (t * 8)) + u), 3));
b = (b + 60);
};
};
if ((t % 120) == 60){
b = 0;
while (b < 9) {
parent.addChild(new BeamLazor(-3, (Math.random() * 600), ((0 + (Math.random() * 30)) - 15)));
b++;
};
};
if ((t % 120) == 0){
b = 0;
while (b < 9) {
parent.addChild(new BeamLazor(503, (Math.random() * 600), ((180 + (Math.random() * 30)) - 15)));
b++;
};
};
} else {
if ((((mode == 5)) && ((w > 40)))){
if ((t % 80) < 40){
b = 0;
while (b < 360) {
parent.addChild(new WaveBullet2(x, (y + 20), NaN, NaN, ((b + ((t % 40) * 8)) + u), (2 + ((t % 40) / 13))));
b = (b + 90);
};
};
if ((t % 80) > 39){
b = 0;
while (b < 360) {
parent.addChild(new WaveBullet2(x, (y + 20), NaN, NaN, (((b + ((t % 40) * 8)) + 45) + u), (2 + ((49 - (t % 40)) / 10))));
b = (b + 90);
};
};
if ((t % 40) < 4){
b = 0;
while (b < 360) {
parent.addChild(new WaveBullet(x, (y + 20), NaN, NaN, (((b + ((t % 40) * 6)) + 45) + u), (2 + ((t % 40) / 2))));
b = (b + 30);
};
};
} else {
if ((((mode == 6)) && ((w > 60)))){
if ((t % 15) == 0){
parent.addChild(new HugeOrangeBullet((Math.random() * 500), -99, 90, (1.5 + (Math.random() * 2))));
};
if ((t % 10) == 0){
parent.addChild(new DemonBullet((Math.random() * 500), -39, NaN, NaN, 90, (3 + (Math.random() * 2))));
};
if ((t % 3) == 0){
parent.addChild(new OrangeBullet((Math.random() * 500), -5, NaN, NaN, 90, (3 + (Math.random() * 4))));
};
} else {
if ((((mode == 7)) && ((w > 60)))){
if ((t % 14) == 0){
parent.addChild(new HugeRedBullet((Math.random() * 500), 699, -90, (1.5 + (Math.random() * 2))));
};
if ((t % 2) == 0){
parent.addChild(new SmallRedBullet((Math.random() * 500), 606, NaN, NaN, -90, (3 + (Math.random() * 2))));
};
} else {
if ((((mode == 8)) && ((w > 100)))){
if ((t % 80) == 0){
parent.addChild(new PurpleBall((x - 100), (y - 60), NaN, NaN, getAngle((x - 100), (y - 60)), 6));
parent.addChild(new PurpleBall((x + 100), (y - 60), NaN, NaN, getAngle((x + 100), (y - 60)), 6));
};
if ((t % 50) < 8){
b = 0;
while (b < 360) {
parent.addChild(new PurpleBullet((x - 100), (y - 60), NaN, NaN, (b + (t * 5)), 4));
parent.addChild(new PurpleBullet((x + 100), (y - 60), NaN, NaN, (b + (t * 5)), 4));
b = (b + 60);
};
};
if ((t % 20) == 0){
b = 0;
while (b < 360) {
parent.addChild(new SmallRedBullet(x, (y - 30), NaN, NaN, (b + u), 5));
b = (b + 12);
};
};
if ((t % 20) == 5){
b = 0;
while (b < 360) {
parent.addChild(new RedBullet(x, (y - 30), NaN, NaN, (b + u), 7));
b = (b + 10);
};
};
} else {
if ((((mode == 9)) && ((w > 60)))){
parent.addChild(new WaveBullet(x, (y + 20), NaN, NaN, ((t * 9) + u), 4));
parent.addChild(new YellowBullet(x, (y + 20), NaN, NaN, ((t * 11) + u), 5));
parent.addChild(new OrangeBullet(x, (y + 20), NaN, NaN, ((t * 7.5) + u), 3.5));
parent.addChild(new LeafBullet(x, (y + 20), NaN, NaN, ((t * 9) + u), 4.5));
parent.addChild(new PurpleBullet(x, (y + 20), NaN, NaN, ((t * 7) + u), 6));
parent.addChild(new BlueWave(x, (y + 20), NaN, NaN, ((t * 10) + u), 3));
parent.addChild(new GreenSlimeBullet(x, (y + 20), NaN, NaN, ((t * 8.5) + u), 3.8));
};
};
};
};
};
};
};
};
};
};
if (HP > ((maxHP * 9) / 10)){
if (mode != 0){
mode = 0;
superArmor = 0;
};
} else {
if (HP > ((maxHP * 8) / 10)){
if (mode != 1){
mode = 1;
nextPattern(5, 30);
w = 0;
extraHeart();
};
} else {
if (HP > ((maxHP * 7) / 10)){
if (mode != 2){
mode = 2;
nextPattern(5, 30);
w = 0;
parent.addChild(new Heart(x, y));
};
} else {
if (HP > ((maxHP * 6) / 10)){
if (mode != 3){
mode = 3;
nextPattern(10, 30);
w = 0;
extraHeart();
};
} else {
if (HP > ((maxHP * 5) / 10)){
if (mode != 4){
mode = 4;
nextPattern(15, 30);
w = 0;
parent.addChild(new Heart(x, y));
};
} else {
if (HP > ((maxHP * 4) / 10)){
if (mode != 5){
mode = 5;
nextPattern(20, 30);
w = 0;
extraHeart();
};
} else {
if (HP > ((maxHP * 3) / 10)){
if (mode != 6){
mode = 6;
nextPattern(25, 30);
w = 0;
parent.addChild(new Heart(x, y));
};
} else {
if (HP > ((maxHP * 2) / 10)){
if (mode != 7){
mode = 7;
nextPattern(25, 30);
w = 0;
extraHeart();
};
} else {
if (HP > ((maxHP * 1) / 10)){
if (mode != 8){
mode = 8;
nextPattern(30, 30);
w = 0;
parent.addChild(new Heart(x, y));
};
} else {
if (HP < ((maxHP * 1) / 10)){
if (mode != 9){
mode = 9;
nextPattern(30, 30);
w = 0;
};
};
};
};
};
};
};
};
};
};
};
return (false);
}
}
}//package foes
Section 125
//SpikeFish (foes.SpikeFish)
package foes {
import bullets.*;
public class SpikeFish extends Foe {
var decel:Number;
public function SpikeFish(x:Number, y:Number, xspeed:Number, yspeed:Number, motion:Number, type:Number){
addFrameScript(0, frame1, 1, frame2, 4, frame5, 6, frame7, 17, frame18);
super(x, y, xspeed, yspeed, motion);
this.type = type;
setHP(90);
score = 250;
money = 5;
dropRate = 1;
}
override function specialHit(){
scaleX = (scaleX + 0.04);
scaleY = (scaleY + 0.04);
parent.addChild(new SpikeBullet(x, y, NaN, NaN, (Math.random() * 360), 3));
}
function frame18(){
if (this){
kill();
};
}
function frame5(){
if (!dead){
gotoAndStop(1);
};
}
function frame7(){
(root as Main).makeSound("fish2", "f");
}
function frame1(){
stop();
}
function frame2(){
(root as Main).makeSound("fish", "f");
}
}
}//package foes
Section 126
//Spikes (foes.Spikes)
package foes {
public class Spikes extends Foe {
var decel:Number;
public function Spikes(x:Number, y:Number, xspeed:Number, yspeed:Number, motion:Number, type:Number){
addFrameScript(0, frame1, 1, frame2, 6, frame7);
super(x, y, xspeed, yspeed, motion);
this.type = type;
setHP(Infinity);
score = 0;
money = 0;
dropRate = 0;
dropChance = 0;
cutoff = 100;
}
function frame7(){
if (!dead){
gotoAndStop(1);
};
}
function frame1(){
stop();
}
function frame2(){
(root as Main).makeSound("metal", "f");
}
}
}//package foes
Section 127
//SteelBox (foes.SteelBox)
package foes {
public class SteelBox extends Foe {
public function SteelBox(a:Number, b:Number, c:Number, d:Number){
addFrameScript(0, frame1, 6, frame7, 17, frame18);
super(a, b, c, d);
setHP(30);
score = 10;
}
function frame18(){
if (this){
kill();
};
}
function frame7(){
if (!dead){
gotoAndStop(1);
};
}
function frame1(){
stop();
}
}
}//package foes
Section 128
//Tank (foes.Tank)
package foes {
import levels.*;
import bullets.*;
public class Tank extends Foe {
public function Tank(x:Number, y:Number, xspeed:Number, yspeed:Number, motion:Number, type:Number){
addFrameScript(0, frame1, 1, frame2, 4, frame5, 7, frame8, 32, frame33);
super(x, y, xspeed, yspeed, motion);
this.type = type;
setHP(900);
this.boom = true;
score = 2000;
money = 7;
dropRate = 3;
dropChance = 0.2;
cutoff = 100;
deathSpin = false;
}
function frame5(){
if (!dead){
gotoAndStop(1);
};
}
function frame1(){
stop();
}
function frame2(){
(root as Main).makeSound("metal", "f");
}
function frame33(){
if (this){
kill();
};
}
function frame8(){
(root as Main).makeSound("explode", "f");
}
override function special():Boolean{
if ((t % 2) == 0){
parent.addChild(new OrangeBullet(((x - 40) + (Math.random() * 80)), (y - 50), NaN, NaN, (((Math.random() * 30) - 15) - 90), 5));
};
if ((t % type) == 0){
(parent as Level).addFoe(new CrossBomb(((x + (Math.random() * 2)) - 1), (y + 40), 0, 6));
};
return (false);
}
}
}//package foes
Section 129
//TinyRock (foes.TinyRock)
package foes {
public class TinyRock extends Foe {
public function TinyRock(x:Number, y:Number, xspeed:Number, yspeed:Number, motion:Number, type:Number){
addFrameScript(0, frame1, 1, frame2, 4, frame5, 7, frame8, 11, frame12);
super(x, y, xspeed, yspeed, motion);
this.delay = type;
setHP(2);
score = 0;
money = 0;
dropRate = 0;
dropChance = 0;
}
function frame12(){
if (this){
kill();
};
}
function frame5(){
if (!dead){
gotoAndStop(1);
};
}
function frame1(){
stop();
}
function frame2(){
(root as Main).makeSound("rock5", "f");
}
function frame8(){
(root as Main).makeSound("rock4", "f");
}
}
}//package foes
Section 130
//Tree (foes.Tree)
package foes {
import bullets.*;
public class Tree extends Foe {
var decel:Number;
public function Tree(x:Number, y:Number, xspeed:Number, yspeed:Number, motion:Number, type:Number){
addFrameScript(0, frame1, 1, frame2, 4, frame5, 7, frame8, 17, frame18);
super(x, y, xspeed, yspeed, motion);
this.type = type;
setHP(50);
score = 250;
money = 4;
dropRate = 1;
}
function frame18(){
if (this){
kill();
};
}
function frame5(){
if (!dead){
gotoAndStop(1);
};
}
function frame1(){
stop();
}
function frame2(){
(root as Main).makeSound("log", "f");
}
function frame8(){
(root as Main).makeSound("log2", "f");
}
override function special():Boolean{
if ((t % type) < 5){
parent.addChild(new BigWhiteBullet(x, (y + 10), NaN, NaN, (getAngle(x, y) + ((t % type) * 3)), 6));
parent.addChild(new BigWhiteBullet(x, (y + 10), NaN, NaN, (getAngle(x, y) - ((t % type) * 3)), 6));
};
return (false);
}
}
}//package foes
Section 131
//Wasp (foes.Wasp)
package foes {
import bullets.*;
public class Wasp extends Foe {
var decel:Number;
public function Wasp(x:Number, y:Number, xspeed:Number, yspeed:Number, motion:Number, type:Number){
addFrameScript(0, frame1, 1, frame2, 5, frame6, 6, frame7, 20, frame21);
super(x, y, xspeed, yspeed, motion);
this.type = type;
setHP(44);
score = 300;
money = 4;
dropRate = 2;
}
function frame6(){
if (!dead){
gotoAndStop(1);
};
}
function frame7(){
(root as Main).makeSound("bug2", "f");
}
function frame1(){
stop();
}
function frame2(){
(root as Main).makeSound("bug", "f");
}
function frame21(){
if (this){
kill();
};
}
override function special():Boolean{
if ((t % type) == 0){
parent.addChild(new SmallRedBullet(x, y, NaN, NaN, (Math.random() * 360), 3));
};
return (false);
}
}
}//package foes
Section 132
//YellowJelly (foes.YellowJelly)
package foes {
import bullets.*;
public class YellowJelly extends Foe {
var decel:Number;
public function YellowJelly(x:Number, y:Number, xspeed:Number, yspeed:Number, motion:Number, type:Number){
addFrameScript(0, frame1, 1, frame2, 4, frame5, 6, frame7, 17, frame18);
super(x, y, xspeed, yspeed, motion);
this.type = type;
setHP(23);
score = 150;
money = 2;
dropRate = 3;
dropChance = 0.02;
}
function frame18(){
if (this){
kill();
};
}
function frame5(){
if (!dead){
gotoAndStop(1);
};
}
function frame7(){
(root as Main).makeSound("slime2", "f");
}
function frame1(){
stop();
}
function frame2(){
(root as Main).makeSound("slime", "f");
}
override function special():Boolean{
if ((t % type) == 0){
parent.addChild(new YellowBall(x, y, NaN, NaN, ((getAngle(x, y) + (Math.random() * 20)) - 10), 12, 3));
};
return (false);
}
}
}//package foes
Section 133
//Level (levels.Level)
package levels {
import flash.events.*;
import flash.display.*;
import mochi.as3.*;
import foes.*;
import flash.utils.*;
import flash.text.*;
import drops.*;
import players.*;
import bullets.*;
import shots.*;
import misc.*;
import flash.geom.*;
public class Level extends MovieClip {
public var bestCombo:int;// = 0
var foeListP:int;// = 0
public var gameOff:Boolean;// = false
public var keyIsDown:Array;
var rank:Number;// = 0
public var xlimit:int;// = 500
public var bg:Number;
public var b:Number;// = 1
public var moneyCollected:int;// = 0
public var d:Number;// = 0
public var t:Number;// = 0
public var pauseMenu:PauseScreen;
private var ti:int;
public var levelNo:Number;
public var foesKilled:int;// = 0
public var comboCounter:int;// = 0
public var score:int;// = 0
public var totalFoes:int;// = 0
public var bomb:Boolean;// = false
public var theBomb:PlayerBomb;
var foe:Foe;
private var time:int;
public var player:Player;
private var fps:int;
var drop:Drop;
public var ylimit:int;// = 600
public var bullet:Bullet;
var shot:Shot;
public var noTip:Boolean;// = false
public var background:MovieClip;
public var hitsTaken:int;// = 0
public var gameOn:Number;// = 0
public var wait:Number;// = 1
public var foeList:Array;
public var bombsUsed:int;// = 0
public var level:Levels;
public var combo:int;// = 1
var levelEnded:Boolean;// = false
private var prevTime:int;// = 0
public var ready:MovieClip;
var aRanks:int;// = 0
public var bottomBar:MovieClip;
public var timeTaken:int;// = 0
public var pause:Boolean;// = false
public function Level(selectedPlayer:Number, selectedLevel:Number){
keyIsDown = [];
foeList = [];
score = 0;
xlimit = 500;
ylimit = 600;
b = 1;
t = 0;
d = 0;
gameOff = false;
gameOn = 0;
wait = 1;
combo = 1;
comboCounter = 0;
bomb = false;
bestCombo = 0;
hitsTaken = 0;
foesKilled = 0;
timeTaken = 0;
moneyCollected = 0;
totalFoes = 0;
pause = false;
bombsUsed = 0;
noTip = false;
prevTime = 0;
foeListP = 0;
rank = 0;
aRanks = 0;
levelEnded = false;
super();
trace("starting level");
Global.vars.bulletArray = [];
Global.vars.shotArray = [];
Global.vars.foeArray = [];
Global.vars.dropArray = [];
pauseMenu = new PauseScreen();
this.addChild(pauseMenu);
pauseMenu.x = 250;
pauseMenu.y = 300;
pauseMenu.visible = false;
this.levelNo = selectedLevel;
Medals.level = this;
if (selectedLevel == 0){
level = new Level0(this);
bg = 2;
BGM.play("starMusic");
};
if (selectedLevel == 1){
level = new Level1(this);
bg = 2;
BGM.play("starMusic");
};
if (selectedLevel == 2){
level = new Level2(this);
bg = 2;
BGM.play("starMusic");
};
if (selectedLevel == 3){
level = new Level3(this);
bg = 1;
BGM.play("starMusic");
};
if (selectedLevel == 4){
level = new Level4(this);
bg = 1;
BGM.play("starMusic");
};
if (selectedLevel == 5){
level = new Level5(this);
bg = 2;
BGM.play("starMusic");
};
if (selectedLevel == 21){
level = new Level21(this);
bg = 1;
BGM.play("starMusic");
};
if (selectedLevel == 6){
level = new Level6(this);
bg = 4;
BGM.play("waterMusic");
};
if (selectedLevel == 7){
level = new Level7(this);
bg = 4;
BGM.play("waterMusic");
};
if (selectedLevel == 8){
level = new Level8(this);
bg = 3;
BGM.play("waterMusic");
};
if (selectedLevel == 9){
level = new Level9(this);
bg = 3;
BGM.play("waterMusic");
};
if (selectedLevel == 10){
level = new Level10(this);
bg = 3;
BGM.play("waterMusic");
};
if (selectedLevel == 22){
level = new Level22(this);
bg = 3;
BGM.play("waterMusic");
};
if (selectedLevel == 11){
level = new Level11(this);
bg = 5;
BGM.play("neverMusic");
};
if (selectedLevel == 12){
level = new Level12(this);
bg = 5;
BGM.play("neverMusic");
};
if (selectedLevel == 13){
level = new Level13(this);
bg = 6;
BGM.play("neverMusic");
};
if (selectedLevel == 14){
level = new Level14(this);
bg = 5;
BGM.play("neverMusic");
};
if (selectedLevel == 15){
level = new Level15(this);
bg = 6;
BGM.play("neverMusic");
};
if (selectedLevel == 23){
level = new Level23(this);
bg = 6;
BGM.play("neverMusic");
};
if (selectedLevel == 16){
level = new Level16(this);
bg = 8;
BGM.play("spaceMusic");
};
if (selectedLevel == 17){
level = new Level17(this);
bg = 7;
BGM.play("spaceMusic");
};
if (selectedLevel == 18){
level = new Level18(this);
bg = 8;
BGM.play("spaceMusic");
};
if (selectedLevel == 19){
level = new Level19(this);
bg = 7;
BGM.play("spaceMusic");
};
if (selectedLevel == 20){
level = new Level20(this);
bg = 8;
BGM.play("spaceMusic");
};
if (selectedLevel == 24){
level = new Level24(this);
bg = 7;
BGM.play("bossMusic");
};
if (selectedLevel == 25){
level = new Level25(this);
bg = 8;
BGM.play("starMusic");
};
if (selectedPlayer == 0){
player = new NoLegs();
};
if (selectedPlayer == 1){
player = new Matt();
};
if (selectedPlayer == 2){
player = new Natalie();
};
if (selectedPlayer == 3){
player = new Lance();
};
if (selectedPlayer == 4){
player = new Anna();
};
this.addChild(player);
(player as Player).setup();
if (selectedLevel == 25){
(player as Player).survivalStats();
};
ready = new GetReady();
this.addChild(ready);
ready.x = (ready.x - 50);
ready.y = (ready.y + 150);
if (((!(level.survival)) && (Global.vars.options[16]))){
player.bombs = (player.bombs * 2);
};
bottomBar.bossHP.visible = false;
bottomBar.bombs.text = player.bombs;
bottomBar.bomb.gotoAndStop((player.playerNo + 15));
if (level.survival){
bottomBar.waves.gotoAndStop(2);
bottomBar.powah.gotoAndStop(2);
};
if ((player is NoLegs)){
bottomBar.weaponIcon1.gotoAndStop(1);
bottomBar.weaponIcon2.gotoAndStop(6);
bottomBar.p0.icons.gotoAndStop(1);
};
if ((player is Matt)){
bottomBar.weaponIcon1.gotoAndStop(2);
bottomBar.weaponIcon2.gotoAndStop(7);
bottomBar.p0.icons.gotoAndStop(2);
};
if ((player is Natalie)){
bottomBar.weaponIcon1.gotoAndStop(3);
bottomBar.weaponIcon2.gotoAndStop(8);
bottomBar.p0.icons.gotoAndStop(3);
};
if ((player is Lance)){
bottomBar.weaponIcon1.gotoAndStop(4);
bottomBar.weaponIcon2.gotoAndStop(9);
bottomBar.p0.icons.gotoAndStop(4);
};
if ((player is Anna)){
bottomBar.weaponIcon1.gotoAndStop(5);
bottomBar.weaponIcon2.gotoAndStop(10);
bottomBar.p0.icons.gotoAndStop(5);
};
addEventListener(Event.ENTER_FRAME, onFrame);
addEventListener(Event.ENTER_FRAME, getFps);
addEventListener(Event.ENTER_FRAME, moveBullets);
this.t = 0;
}
public function unlockMedal(medal:String){
var a:int;
a = 0;
while (a < Medals.medals.length) {
if (medal == Medals.medals[a].name){
if (Medals.locks[a]){
trace(("Medal already unlocked: " + a));
} else {
Medals.locks[a] = true;
Medals.current = Medals.medals[a].pic;
(bottomBar.medalBox as MovieClip).gotoAndPlay(0);
trace(("Unlocking medal: " + a));
(root as Main).saveGame();
};
};
a++;
};
}
public function clearScore(){
var f:*;
combo = 1;
gameOff = true;
score = 0;
bottomBar.score.text = score;
bottomBar.multiplier.text = combo;
trace(("best combo: " + bestCombo));
trace(("foes killed: " + foesKilled));
t = 0;
for each (f in foeList) {
f.dead = true;
f.kill();
};
}
public function addFoe(foe:Foe):Foe{
addChild(foe);
foe.player = player;
foeList.push(foe);
if (foe.score != 0){
totalFoes++;
};
return (foe);
}
public function addScore(a:Number, x:Number, y:Number){
score = (score + (a * combo));
this.addChild(new ScoreLabel(a, combo, x, y));
bottomBar.score.text = score;
}
public function kongStats(){
var kongregate:*;
var meds:int;
var mm:int;
trace("SENDING STATS TO KONGREGATE");
kongregate = (root as Main).kongregate;
kongregate.stats.submit("totalKills", Medals.stats.kills);
kongregate.stats.submit("totalHits", Medals.stats.damage);
kongregate.stats.submit("totalPowerUps", Medals.stats.powerUps);
kongregate.stats.submit(("highScore" + levelNo), (parent as Main).levelScores[levelNo]);
kongregate.stats.submit("waves", (root as Main).survivalWaves);
kongregate.stats.submit("kills", (root as Main).survivalKills);
kongregate.stats.submit("maxMoney", (root as Main).money);
meds = 0;
mm = 0;
while (mm < Medals.locks.length) {
if (Medals.locks[mm] == true){
meds++;
};
mm++;
};
kongregate.stats.submit("medalsEarned", meds);
kongregate.stats.submit("Aranks", aRanks);
meds = 0;
mm = 0;
while (mm < (root as Main).playersUnlocked.length) {
if ((root as Main).playersUnlocked[mm] == true){
meds++;
};
mm++;
};
kongregate.stats.submit("playersUnlocked", meds);
meds = 0;
mm = 1;
while (mm <= 20) {
if ((root as Main).levelRanks[mm] >= 2){
meds++;
};
mm++;
};
kongregate.stats.submit("gameProgress", meds);
meds = 0;
mm = 21;
while (mm <= 24) {
if ((root as Main).levelRanks[mm] >= 2){
meds++;
};
mm++;
};
kongregate.stats.submit("bonusProgress", meds);
meds = 0;
mm = 1;
while (mm <= 24) {
if ((root as Main).levelRanks[mm] >= 2){
meds++;
};
mm++;
};
kongregate.stats.submit("levelProgress", meds);
}
public function addMoney(v:Number){
moneyCollected = (moneyCollected + v);
}
public function moveBullets(e:Event){
var i:int;
if (!pause){
i = 0;
while (i < Global.vars.bulletArray.length) {
bullet = Global.vars.bulletArray[i];
bullet.move();
if (bullet.dead){
i--;
};
i++;
};
foeListP = foesKilled;
i = 0;
while (i < foeList.length) {
foe = foeList[i];
foe.move();
if (foe.dead2){
i--;
foeListP++;
trace(foeListP);
};
i++;
};
i = 0;
while (i < Global.vars.shotArray.length) {
shot = Global.vars.shotArray[i];
shot.onFrame();
if (shot.dead2){
i--;
};
i++;
};
i = 0;
while (i < Global.vars.dropArray.length) {
drop = Global.vars.dropArray[i];
drop.onFrame();
if (drop.dead){
i--;
};
i++;
};
player.move();
if (((bomb) && (theBomb))){
theBomb.onFrame();
};
(parent as Main).countSound = 0;
updateBars();
if ((foesKilled - foeListP) >= 25){
Medals.unlockMedal("Ultimate Blade");
};
};
}
public function useBomb(){
bomb = true;
bombsUsed++;
bottomBar.bombs.text = player.bombs;
}
public function onFrame(e:Event){
var foe:Foe;
if (!pause){
if (((!(gameOff)) && (!(ready)))){
level.timer();
if (wait == 0){
level.spawn(t);
t++;
};
} else {
gameOn++;
if (gameOn == 30){
gameOn = 0;
gameOff = false;
t = 0;
};
};
comboCounter--;
if (comboCounter == 0){
addCombo(-10);
};
};
}
public function foeTimeOut(){
var i:int;
var foe:Foe;
trace("Time out!");
i = 0;
while (i < foeList.length) {
foe = foeList[i];
if (!foe.dead){
foe.timeOut();
if (foe.dead2){
i--;
};
};
i++;
};
}
public function exitLevel(){
kongStats();
Global.vars.bullets = 0;
removeEventListener(Event.ENTER_FRAME, onFrame);
removeEventListener(Event.ENTER_FRAME, moveBullets);
removeEventListener(Event.ENTER_FRAME, getFps);
if (!level.survival){
(parent as Main).money = ((parent as Main).money + moneyCollected);
trace(("adding money: " + moneyCollected));
moneyCollected = 0;
};
trace("BACK TO MENU");
(parent as MovieClip).gotoAndStop("levelSelect");
Medals.level = undefined;
parent.removeChild(this);
}
public function waitFor(foe:Foe):Foe{
foe.waitFlag = true;
wait++;
return (foe);
}
public function pauseGame(){
if (((!(levelEnded)) && (!(ready)))){
pause = !(pause);
if (pause){
BGM.pause();
background.stop();
} else {
BGM.resume();
if (Global.vars.options[0]){
background.play();
};
};
pauseMenu.visible = !(pauseMenu.visible);
if (pause){
setChildIndex(pauseMenu, (numChildren - 1));
setChildIndex(bottomBar, (numChildren - 1));
} else {
setChildIndex(bottomBar, 0);
};
};
}
public function winLevel(){
trace((((("killed " + foesKilled) + " / ") + totalFoes) + " foes."));
if (((((((parent as Main).levelRanks[(levelNo + 1)] < 0)) || (((parent as Main).levelRanks[(levelNo + 1)] == undefined)))) && (!(player.dead)))){
if (levelNo < 20){
trace(("unlocking level " + (levelNo + 1)));
(parent as Main).levelRanks[(levelNo + 1)] = 1;
(parent as Main).unlockedLevel = (levelNo + 1);
(parent as Main).levelUnlock = true;
};
};
endLevel();
}
public function updateBars(){
bottomBar.mainChargeBar.scaleX = (player.mainCharge / 100);
bottomBar.subChargeBar.scaleX = (player.subCharge / 100);
bottomBar.hpBar.scaleX = (player.HP / player.maxHP);
bottomBar.kills.text = foesKilled;
bottomBar.money.text = moneyCollected;
bottomBar.bullets.text = Global.vars.bullets;
bottomBar.health.text = player.HP;
bottomBar.main.text = Math.floor(player.mainCharge);
bottomBar.sub.text = Math.floor(player.subCharge);
if (ready){
setChildIndex(ready, (numChildren - 1));
};
setChildIndex(bottomBar, (numChildren - 1));
}
public function addHit(){
hitsTaken++;
combo = 1;
if (!level.survival){
score = (Math.floor((score * 0.09)) * 10);
bottomBar.hits.text = hitsTaken;
bottomBar.score.text = score;
};
}
public function unlockMedalNo(medal:Number){
if (Medals.locks[medal]){
trace(("Medal already unlocked: " + medal));
} else {
Medals.locks[medal] = true;
Medals.current = Medals.medals[medal].pic;
(bottomBar.medalBox as MovieClip).gotoAndPlay(0);
trace(("Unlocking medal: " + medal));
(root as Main).saveGame();
};
}
public function getMedals(){
var unbeaten:Boolean;
var a:int;
if ((((moneyCollected >= 3000)) && (!((levelNo == 25))))){
Medals.unlockMedal("Gold Farmer");
};
if ((((levelNo == 20)) && (!(player.dead)))){
Medals.unlockMedal("The End");
if (player.maxHP == 3){
Medals.unlockMedal("3 Heart Challenge");
};
};
if ((((score >= 500000)) && (!((levelNo == 25))))){
Medals.unlockMedal("500k");
};
if ((((score >= 1000000)) && (!((levelNo == 25))))){
Medals.unlockMedal("Millionaire");
};
if (aRanks >= 5){
Medals.unlockMedalNo(0);
(parent as Main).unlockPlayer(2);
};
if (aRanks >= 10){
Medals.unlockMedalNo(1);
(parent as Main).unlockPlayer(3);
};
if (aRanks >= 15){
Medals.unlockMedalNo(2);
(parent as Main).unlockPlayer(4);
};
if (aRanks >= 20){
Medals.unlockMedalNo(3);
};
if (aRanks >= 25){
Medals.unlockMedalNo(4);
};
unbeaten = false;
a = 0;
while (a < 4) {
if (((((((parent as Main).levelRanks[(21 + a)] == 0)) || (((parent as Main).levelRanks[(21 + a)] == 1)))) || (((parent as Main).levelRanks[(21 + a)] == undefined)))){
unbeaten = true;
};
a++;
};
if (!unbeaten){
Medals.unlockMedal("Bullet Master");
};
if ((((((hitsTaken == 0)) && ((levelNo > 15)))) && ((levelNo < 21)))){
Medals.unlockMedal("Perfect Run");
};
if (Medals.stats.powerUps >= 100){
Medals.unlockMedalNo(14);
};
if (Medals.stats.damage >= 100){
Medals.unlockMedalNo(15);
};
if (Medals.stats.kills >= 300){
Medals.unlockMedalNo(8);
};
if (Medals.stats.kills >= 1000){
Medals.unlockMedalNo(9);
(parent as Main).unlockPlayer(2);
};
if (Medals.stats.kills >= 3000){
Medals.unlockMedalNo(10);
(parent as Main).unlockPlayer(3);
};
if (Medals.stats.kills >= 10000){
Medals.unlockMedalNo(11);
(parent as Main).unlockPlayer(4);
};
if (foesKilled >= 1000){
Medals.unlockMedalNo(6);
};
trace(("Total Power Ups: " + Medals.stats.powerUps));
trace(("Total Damage: " + Medals.stats.damage));
trace(("Total Kills: " + Medals.stats.kills));
}
public function addItem(drop:Drop){
this.addChild(drop);
this.setChildIndex(drop, getChildIndex(player));
}
public function endLevel(){
var hasCheats:Boolean;
var bestWaves:Boolean;
var bestKills:Boolean;
var board:LevelEnd;
var a:int;
var j:int;
var percent:Number;
levelEnded = true;
background.stop();
root.stage.frameRate = 30;
pause = true;
Global.vars.bulletArray = [];
Global.vars.shotArray = [];
Global.vars.foeArray = [];
Global.vars.dropArray = [];
hasCheats = false;
bestWaves = false;
bestKills = false;
if (((((parent as Main).levelRanks[levelNo] < 2)) && (!(player.dead)))){
MochiEvents.trackEvent(("beat level " + levelNo));
trace("BEAT NEW LEVEL!!!");
};
rank = 0;
aRanks = 0;
if (level.survival){
if ((level as Level25).waveCount >= 100){
rank = 8;
} else {
if ((level as Level25).waveCount >= 80){
rank = 7;
} else {
if ((level as Level25).waveCount >= 60){
rank = 6;
} else {
if ((level as Level25).waveCount >= 40){
rank = 5;
} else {
if ((level as Level25).waveCount >= 20){
rank = 4;
} else {
if ((level as Level25).waveCount >= 10){
rank = 3;
} else {
rank = 2;
};
};
};
};
};
};
if ((level as Level25).waveCount > (root as Main).survivalWaves){
(root as Main).survivalWaves = (level as Level25).waveCount;
bestWaves = true;
};
if (foesKilled > (root as Main).survivalKills){
(root as Main).survivalKills = foesKilled;
bestKills = true;
};
} else {
percent = (20 + Math.floor((((foesKilled / totalFoes) * 80) - (hitsTaken * 4))));
if (Global.vars.options[13]){
percent = (percent - 12);
score = (score * 0.7);
hasCheats = true;
};
if (Global.vars.options[14]){
percent = (percent - 12);
score = (score * 0.7);
hasCheats = true;
};
if (Global.vars.options[15]){
percent = (percent - 12);
score = (score * 0.7);
hasCheats = true;
};
if (Global.vars.options[16]){
percent = (percent - 12);
score = (score * 0.7);
hasCheats = true;
};
score = (Math.floor((score / 10)) * 10);
if (percent >= 90){
rank = 8;
} else {
if (percent >= 80){
rank = 7;
} else {
if (percent >= 70){
rank = 6;
} else {
if (percent >= 60){
rank = 5;
} else {
if (percent >= 50){
rank = 4;
} else {
if (percent >= 40){
rank = 3;
} else {
rank = 2;
};
};
};
};
};
};
if (player.dead){
rank = 1;
};
};
board = new LevelEnd(score, (((foesKilled + " (") + Math.floor(((foesKilled / totalFoes) * 100))) + "%)"), hitsTaken, bestCombo, moneyCollected, rank);
this.addChild(board);
board.x = 250;
board.y = 300;
if (((!(hasCheats)) || (player.dead))){
board.cheats.visible = false;
};
Medals.stats.kills = (Medals.stats.kills + foesKilled);
var _local8 = Medals.stats.playerLevels;
var _local9 = player.playerNo;
var _local10 = (_local8[_local9] + 1);
_local8[_local9] = _local10;
trace((("Beaten " + Medals.stats.playerLevels[player.playerNo]) + " levels as this player"));
if (Medals.stats.playerLevels[player.playerNo] >= 9){
Medals.unlockMedalNo((16 + player.playerNo));
};
if (board.best1){
board.best1.visible = false;
};
if (level.survival){
board.gotoAndStop(2);
if (((board.best2) && (!(bestWaves)))){
board.best2.visible = false;
};
if (board.best3){
board.best3.visible = false;
};
if (((board.best4) && (!(bestKills)))){
board.best4.visible = false;
};
};
if ((parent as Main).levelRanks[levelNo] == undefined){
(parent as Main).levelRanks[levelNo] = 0;
};
if (rank > (parent as Main).levelRanks[levelNo]){
(parent as Main).levelRanks[levelNo] = rank;
};
if (score > (parent as Main).levelScores[levelNo]){
(parent as Main).levelScores[levelNo] = score;
if (board.best1){
board.best1.visible = true;
};
if (board.best3){
board.best3.visible = true;
};
};
for each (a in (parent as Main).levelRanks) {
if (a > 6){
aRanks++;
};
};
trace((("A or S ranks in " + aRanks) + " levels."));
for each (j in [21, 22, 23, 24]) {
if ((((aRanks >= ((j - 20) * 5))) && (((((parent as Main).levelRanks[j] < 0)) || (((parent as Main).levelRanks[j] == undefined)))))){
(parent as Main).levelRanks[j] = 1;
(parent as Main).unlockedLevel = j;
(parent as Main).levelUnlock = true;
};
};
trace(("rrrank: " + rank));
board.rr = rank;
getMedals();
kongStats();
Global.vars.bullets = 0;
(parent as Main).saveGame();
}
public function addCombo(n:Number){
combo = (combo + n);
if (combo > 9){
combo = 9;
};
if (combo < 1){
combo = 1;
};
comboCounter = 60;
}
private function getFps(e:Event):void{
ti++;
if ((ti % 30) == 0){
ti = 0;
time = getTimer();
fps = ((30000 / (time - prevTime)) + 1);
if (fps > 30){
fps = 30;
};
bottomBar.fps.text = ("" + fps);
prevTime = getTimer();
};
}
public function retryLevel(){
kongStats();
Global.vars.bullets = 0;
if (!level.survival){
(parent as Main).money = ((parent as Main).money + moneyCollected);
trace(("adding money: " + moneyCollected));
moneyCollected = 0;
};
trace("RETRY LEVEL");
(parent as Main).retryLevel();
}
}
}//package levels
Section 134
//Level0 (levels.Level0)
package levels {
import foes.*;
import bullets.*;
public class Level0 extends Levels {
var p:Number;// = 0
var s:Number;// = 0
public function Level0(l:Level){
p = 0;
s = 0;
super(l);
}
function makeCat(x:Number){
l.addFoe(new Kitten(x, -30, 0, 4, 0, 30));
}
function makeLog(x:Number){
l.addFoe(new BigLog(x, -30, 0, 4, 0, 30));
}
override public function spawn(t:Number){
var b:int;
if ((t % 1) == 0){
b = 0;
while (b < 4) {
p = (p + 3);
l.addChild(new LeafBullet(150, 150, NaN, NaN, p, 2));
l.addChild(new LeafBullet(350, 150, NaN, NaN, (360 - p), 2));
p = (p + 3);
l.addChild(new YellowBullet(150, 150, NaN, NaN, p, 1.5));
l.addChild(new YellowBullet(350, 150, NaN, NaN, (360 - p), 1.5));
b++;
};
};
switch (t){
};
}
function makeTank(x:Number){
l.addFoe(new CatRam(x, -49, 0, 4, 0, 30));
}
}
}//package levels
Section 135
//Level1 (levels.Level1)
package levels {
import foes.*;
public class Level1 extends Levels {
public function Level1(l:Level){
super(l);
}
function makeCat(x:Number){
l.addFoe(new Kitten(x, -30, 0, 4, 0, 30));
}
function makeLog(x:Number){
l.addFoe(new BigLog(x, -30, 0, 4, 0, 30));
}
override public function spawn(t:Number){
if (((((t % 13) == 0)) && ((t < 340)))){
makeCat(((Math.random() * 450) + 25));
};
if (((((((t % 12) == 0)) && ((t > 577)))) && ((t < 666)))){
makeCat(270);
makeCat(230);
};
if (((((((t % 12) == 0)) && ((t > 666)))) && ((t < 777)))){
makeCat(100);
makeCat(140);
makeCat(400);
makeCat(360);
};
if (((((((t % 12) == 0)) && ((t > 870)))) && ((t < 1000)))){
makeCat(((Math.random() * 450) + 25));
};
if (((((((t % 16) == 0)) && ((t > 1100)))) && ((t < 1220)))){
makeCat(100);
makeCat(140);
makeCat(400);
makeCat(360);
};
switch (t){
case 400:
makeCat(100);
makeCat(160);
makeLog(130);
break;
case 410:
makeCat(100);
makeCat(160);
break;
case 450:
makeCat(340);
makeCat(400);
makeLog(370);
break;
case 460:
makeCat(340);
makeCat(400);
break;
case 500:
makeCat(220);
makeCat(280);
makeLog(250);
break;
case 510:
makeCat(220);
makeCat(280);
break;
case 850:
makeTank(250).drop = "heart";
break;
case 890:
makeTank(200);
makeTank(300);
break;
case 1060:
makeTank(100);
makeTank(400);
break;
case 1160:
makeTank(250).drop = "heart";
makeLog(200);
makeLog(300);
break;
case 1440:
l.winLevel();
};
}
function makeTank(x:Number):Foe{
return (l.addFoe(new CatRam(x, -49, 0, 4, 0, 30)));
}
}
}//package levels
Section 136
//Level10 (levels.Level10)
package levels {
import foes.*;
public class Level10 extends Levels {
public function Level10(l:Level){
super(l);
}
function makeBushWall(yspeed:Number){
var b:Number;
b = 0;
while (b < 7) {
l.addFoe(new Bush((100 + (b * 50)), -30, 0, yspeed, 0, 20));
b++;
};
}
function makeLogWall(){
var b:Number;
b = 0;
while (b < 9) {
l.addFoe(new BigLog((50 + (b * 50)), -30, 0, 6, 0, 30));
b++;
};
}
function makeBush2(){
l.addFoe(new Bush(-30, -30, ((Math.random() * 5) + 8), ((Math.random() * 5) + 5), 2, 30));
}
function makeBush3(){
l.addFoe(new Bush(530, -30, ((-(Math.random()) * 5) - 8), ((Math.random() * 5) + 5), 2, 30));
}
function makeBigBush(x:Number){
l.addFoe(new BigBush(x, -49, 0, 4, 0, 3));
}
function makeBigBush2(x:Number){
makeBigBush(x);
makeBigBush((500 - x));
}
function makeLog(x:Number){
l.addFoe(new BigLog(x, -30, 0, 4, 0, 30));
}
function makeSlime(){
l.addFoe(new GreenSlime(((Math.random() * 450) + 25), -30, 0, 5, 0, 0));
}
override public function spawn(t:Number){
if (((((t % 12) == 0)) && ((t < 500)))){
l.addFoe(new PinkJelly(-30, 300, 6, 0, 0, 999990));
l.addFoe(new PurpleJelly(549, 250, -6, 0, 0, 999990));
};
if (((((t % 18) == 0)) && ((t < 500)))){
l.addFoe(new BlueJelly(-49, 150, 5.5, 0, 0, 10000));
l.addFoe(new GreenJelly(530, 200, -5.5, 0, 0, 10));
};
if (((((t % 24) == 0)) && ((t < 500)))){
l.addFoe(new YellowJelly(-30, 100, 5, 0, 0, 10000));
l.addFoe(new SpikeFish(530, 50, -5, 0, 0, 10000));
};
switch (t){
case 600:
l.waitFor(l.addFoe(new GiantCrab(250, -150, 0, 21, 3, 0)));
BGM.play("bossMusic");
break;
case 800:
l.winLevel();
break;
};
}
function makeBush(x:Number){
l.addFoe(new Bush(x, -49, 0, 4, 0, 30));
}
function makeTank(x:Number){
l.addFoe(new CatRam(x, -49, 0, 4, 0, 30));
}
}
}//package levels
Section 137
//Level11 (levels.Level11)
package levels {
import foes.*;
public class Level11 extends Levels {
public function Level11(l:Level){
super(l);
}
function makeTree(x:Number, y:Number){
return (l.waitFor(l.addFoe(new Tree(x, -49, 0, y, 3, 30))));
}
function makeWasps(i:int){
var n:int;
n = 0;
while (n < i) {
l.waitFor(l.addFoe(new Wasp(((Math.random() * 450) + 25), -49, 0, (11 + (Math.random() * 7)), 3, 1)));
n++;
};
}
function makeEye2(x:Number){
l.addFoe(new EyeBall(x, -30, 0, 3, 0, 50));
l.addFoe(new EyeBall((500 - x), -30, 0, 3, 0, 50));
}
function makeEye3(i:int){
var n:int;
n = 0;
while (n < i) {
l.addFoe(new EyeBall(((Math.random() * 450) + 25), -30, 0, (6 + (Math.random() * 5)), 0, 5000));
n++;
};
}
override public function spawn(t:Number){
if (((((t % 26) == 0)) && ((t < 500)))){
makeEye2(((Math.random() * 190) + 25));
};
if (((((((t % 46) == 0)) && ((t > 1650)))) && ((t < 2200)))){
l.addFoe(new Wasp(((Math.random() * 450) + 25), -30, 0, 4, 0, 1));
};
if (((((((t % 2) == 0)) && ((t > 660)))) && ((t < 674)))){
l.addFoe(new Shroom(530, (-50 + (40 * (t % 20))), -9, 0, 0, 4));
};
if (((((((t % 2) == 0)) && ((t > 900)))) && ((t < 914)))){
l.addFoe(new Shroom(-30, (-50 + (40 * (t % 20))), 9, 0, 0, 4));
};
switch (t){
case 570:
makeTree(150, 14);
makeTree(350, 14);
makeTree(250, 17);
break;
case 600:
makeTree(150, 16);
makeTree(350, 16);
makeTree(60, 13);
makeTree(440, 13);
makeTree(250, 17);
break;
case 800:
makeTree(170, 12);
makeTree(330, 12);
makeTree(150, 16);
makeTree(350, 16);
makeTree(60, 13);
makeTree(440, 13);
makeTree(250, 17);
break;
case 830:
makeTree(80, 11);
makeTree(420, 11);
makeTree(170, 12);
makeTree(330, 12);
makeTree(150, 16);
makeTree(350, 16);
makeTree(60, 13);
makeTree(440, 13);
makeTree(250, 17);
break;
case 970:
makeTree(170, 12);
makeTree(330, 12);
makeTree(150, 16);
makeTree(350, 16);
makeTree(60, 13);
makeTree(440, 13);
makeTree(250, 17);
makeEye3(3);
break;
case 1030:
makeTree(80, 11);
makeTree(420, 11);
makeTree(170, 12);
makeTree(330, 12);
makeTree(150, 16);
makeTree(350, 16);
makeTree(60, 13);
makeTree(440, 13);
makeEye3(5);
break;
case 1100:
makeEye3(8);
break;
case 1250:
makeEye3(12);
break;
case 1400:
makeEye3(16);
break;
case 1550:
makeEye3(20);
break;
case 2300:
makeWasps(2);
break;
case 2400:
makeWasps(4);
makeEye3(2);
break;
case 2500:
makeWasps(6);
makeEye3(4);
break;
case 2720:
l.winLevel();
break;
};
}
}
}//package levels
Section 138
//Level12 (levels.Level12)
package levels {
import foes.*;
public class Level12 extends Levels {
public function Level12(l:Level){
super(l);
}
function makeTree(x:Number, y:Number){
return (l.waitFor(l.addFoe(new Tree(x, -49, 0, y, 3, 30))));
}
function makeSlingers(i:int){
var n:int;
n = 0;
while (n < i) {
l.waitFor(l.addFoe(new Slinger(((Math.random() * 450) + 25), -49, 0, (7 + (Math.random() * 6)), 4, 6)));
n++;
};
}
function makeWasps(i:int){
var n:int;
n = 0;
while (n < i) {
l.waitFor(l.addFoe(new Wasp(((Math.random() * 450) + 25), -49, 0, (10 + (Math.random() * 14)), 3, 1)));
n++;
};
}
function makeEye2(x:Number){
l.addFoe(new EyeBall(x, -30, 0, 3, 0, 50));
l.addFoe(new EyeBall((500 - x), -30, 0, 3, 0, 50));
}
function makeEye3(i:int){
var n:int;
n = 0;
while (n < i) {
l.addFoe(new EyeBall(((Math.random() * 450) + 25), -30, 0, (6 + (Math.random() * 5)), 0, 5000));
n++;
};
}
function makeMages(i:int){
var n:int;
n = 0;
while (n < i) {
l.waitFor(l.addFoe(new Mage(((Math.random() * 450) + 25), -49, 0, (7 + (Math.random() * 6)), 4, 40)));
n++;
};
}
override public function spawn(t:Number){
if (((((((t % 150) == 0)) && ((t > 100)))) && ((t < 2000)))){
l.addFoe(new HugeRock(((Math.random() * 450) + 25), -90, 0, ((Math.random() * 2) + 3), 0, 4));
};
if (((((((t % 60) == 0)) && ((t > 100)))) && ((t < 2300)))){
l.addFoe(new BigRock(((Math.random() * 450) + 25), -30, 0, ((Math.random() * 3) + 3), 0, 4));
};
if (((((((t % 30) == 0)) && ((t > 100)))) && ((t < 2300)))){
l.addFoe(new MediumRock(((Math.random() * 450) + 25), -30, 0, ((Math.random() * 5) + 3), 0, 4));
};
if (((((((t % 15) == 0)) && ((t > 100)))) && ((t < 2300)))){
l.addFoe(new SmallRock(((Math.random() * 450) + 25), -30, 0, ((Math.random() * 5) + 3), 0, 4));
};
if (((((((t % 10) == 0)) && ((t > 100)))) && ((t < 2300)))){
l.addFoe(new TinyRock(((Math.random() * 450) + 25), -30, 0, ((Math.random() * 5) + 4), 0, 4));
};
if (((((((t % 35) == 0)) && ((t > 1100)))) && ((t < 2300)))){
l.addFoe(new Mage(((Math.random() * 450) + 25), -49, 0, 4, 0, 60));
};
if (((((((t % 80) == 0)) && ((t > 1600)))) && ((t < 2300)))){
l.addFoe(new Slinger(((Math.random() * 450) + 25), -49, 0, 5, 0, 10));
};
switch (t){
case 50:
makeWasps(7);
break;
case 200:
makeEye3(1);
break;
case 250:
makeEye3(2);
break;
case 300:
makeEye3(3);
break;
case 350:
makeEye3(4);
break;
case 400:
makeEye3(5);
break;
case 450:
makeEye3(6);
break;
case 500:
makeEye3(7);
break;
case 550:
makeWasps(2);
break;
case 600:
makeWasps(4);
break;
case 700:
makeSlingers(4);
break;
case 750:
makeMages(4);
break;
case 800:
makeSlingers(7);
break;
case 850:
makeMages(7);
break;
case 900:
makeSlingers(10);
break;
case 950:
makeMages(10);
break;
case 1000:
makeSlingers(9);
makeMages(9);
break;
case 2500:
l.winLevel();
break;
};
}
}
}//package levels
Section 139
//Level13 (levels.Level13)
package levels {
import foes.*;
public class Level13 extends Levels {
public function Level13(l:Level){
super(l);
l.t = 100;
}
function makeWall3(){
l.addFoe(new DoubleBrick(0, -70, 0, 7, 0, 0));
l.addFoe(new DoubleBrick(440, -70, 0, 7, 0, 0));
l.addFoe(new DoubleBrick(140, -70, 0, 7, 0, 0));
l.addFoe(new DoubleBrick(300, -70, 0, 7, 0, 0));
}
function makeSlingers(i:int){
var n:int;
n = 0;
while (n < i) {
l.waitFor(l.addFoe(new Slinger(((Math.random() * 450) + 25), -49, 0, (4 + (Math.random() * 3)), 0, 6)));
n++;
};
}
function makeTree(x:Number, y:Number){
return (l.waitFor(l.addFoe(new Tree(x, -49, 0, y, 3, 30))));
}
function makeCats1(){
l.addFoe(new DeadCat(230, -30, 0, 7, 0, 0));
l.addFoe(new DeadCat(270, -30, 0, 7, 0, 0));
}
function makeCat(xx:int){
l.addFoe(new DeadCat(xx, -30, 0, 7, 0, 0));
}
function makeMages(i:int){
var n:int;
n = 0;
while (n < i) {
l.waitFor(l.addFoe(new Mage(((Math.random() * 450) + 25), -49, 0, (4 + (Math.random() * 3)), 0, 40)));
n++;
};
}
function makeWasps(i:int){
var n:int;
n = 0;
while (n < i) {
l.addFoe(new Wasp(((Math.random() * 340) + 80), -49, 0, (7 + (Math.random() * 5)), 0, 1));
n++;
};
}
function makeCats2(){
l.addFoe(new DeadCat(420, -30, 0, 7, 0, 0));
l.addFoe(new DeadCat(370, -30, 0, 7, 0, 0));
l.addFoe(new DeadCat(80, -30, 0, 7, 0, 0));
l.addFoe(new DeadCat(130, -30, 0, 7, 0, 0));
}
function makeEye3(i:int){
var n:int;
n = 0;
while (n < i) {
l.addFoe(new EyeBall(((Math.random() * 450) + 25), -30, 0, (6 + (Math.random() * 5)), 0, 5000));
n++;
};
}
function makeBirds(i:int){
var n:int;
n = 0;
while (n < i) {
l.addFoe(new Bird(((Math.random() * 450) + 25), -49, 0, (5 + (Math.random() * 6)), 0, 6));
n++;
};
}
function makeEye2(x:Number){
l.addFoe(new EyeBall(x, -30, 0, 3, 0, 50));
l.addFoe(new EyeBall((500 - x), -30, 0, 3, 0, 50));
}
function makeWall1(){
l.addFoe(new HugeBrick(0, -70, 0, 7, 0, 0));
l.addFoe(new HugeBrick(300, -70, 0, 7, 0, 0));
}
function makeWall2(){
l.addFoe(new HugeBrick(150, -70, 0, 7, 0, 0));
l.addFoe(new DoubleBrick(0, -70, 0, 7, 0, 0));
l.addFoe(new DoubleBrick(440, -70, 0, 7, 0, 0));
}
override public function spawn(t:Number){
if (((((((t % 10) == 0)) && ((t > 120)))) && ((t < 900)))){
makeWall0();
};
switch (t){
case 30:
l.waitFor(l.addFoe(new Obelisk(250, -30, 0, 16, 3, 30)));
break;
case 90:
l.waitFor(l.addFoe(new Obelisk(100, -30, 0, 14, 3, 40)));
l.waitFor(l.addFoe(new Obelisk(400, -30, 0, 14, 3, 40)));
break;
case 120:
makeWall1();
break;
case 130:
makeWall1();
makeCats1();
break;
case 140:
makeWall1();
break;
case 150:
makeWall1();
makeCats1();
break;
case 160:
makeWall1();
break;
case 170:
makeWall1();
makeCats1();
break;
case 180:
makeWall1();
break;
case 190:
makeWall1();
makeCats1();
break;
case 200:
makeWall1();
break;
case 210:
makeWall1();
makeCats1();
break;
case 220:
makeWall0();
break;
case 230:
makeWall0();
break;
case 240:
makeWall2();
break;
case 250:
makeWall2();
makeCats2();
break;
case 260:
makeWall2();
break;
case 270:
makeWall2();
break;
case 280:
makeWall2();
break;
case 290:
makeWall2();
break;
case 300:
l.addFoe(new Spikes(20, -70, 0, 7, 0, 0));
l.addFoe(new HugeBrick(0, -120, 0, 7, 0, 0));
makeWall2();
break;
case 310:
makeWall2();
break;
case 370:
makeWasps(1);
break;
case 380:
makeWasps(1);
break;
case 390:
makeWasps(1);
break;
case 400:
makeWasps(1);
break;
case 410:
makeWasps(1);
break;
case 470:
makeWall2();
break;
case 480:
makeWall2();
makeCats2();
break;
case 490:
makeWall2();
break;
case 500:
makeWall2();
break;
case 510:
makeWall2();
break;
case 520:
makeWall2();
break;
case 530:
l.addFoe(new Spikes(320, -70, 0, 7, 0, 0));
l.addFoe(new HugeBrick(300, -120, 0, 7, 0, 0));
makeWall2();
break;
case 540:
makeWall2();
break;
case 640:
l.addFoe(new Obelisk(150, -30, 0, 8, 0, 40));
l.addFoe(new Obelisk(350, -30, 0, 8, 0, 40));
break;
case 750:
makeWall3();
makeCat(90);
makeCat(250);
makeCat(410);
break;
case 760:
makeWall3();
makeCat(90);
makeCat(250);
makeCat(410);
break;
case 770:
makeWall3();
makeCat(90);
break;
case 780:
makeWall3();
makeCat(90);
break;
case 790:
makeWall3();
makeCat(90);
break;
case 800:
makeWall3();
makeCat(90);
break;
case 810:
makeWall3();
makeCat(90);
break;
case 820:
makeWall3();
makeCat(90);
break;
case 830:
makeWall3();
makeCat(90);
break;
case 840:
makeWall3();
makeCat(90);
break;
case 850:
makeWall3();
makeCat(90);
break;
case 860:
makeWall3();
makeCat(90);
break;
case 900:
makeWall3();
makeCat(90);
makeCat(250);
makeCat(410);
break;
case 910:
makeWall3();
makeCat(90);
makeCat(250);
makeCat(410);
break;
case 920:
makeWall3();
makeCat(410);
break;
case 930:
makeWall3();
makeCat(410);
break;
case 940:
makeWall3();
makeCat(410);
break;
case 950:
makeWall3();
makeCat(410);
break;
case 960:
makeWall3();
makeCat(410);
break;
case 970:
makeWall3();
makeCat(410);
break;
case 980:
makeWall3();
makeCat(410);
break;
case 990:
makeWall3();
makeCat(410);
break;
case 1000:
makeWall3();
makeCat(410);
break;
case 1010:
makeWall3();
makeCat(410);
break;
case 1100:
l.waitFor(l.addFoe(new Obelisk(80, -30, 0, 13, 3, 60)));
l.waitFor(l.addFoe(new Obelisk(420, -30, 0, 13, 3, 60)));
l.waitFor(l.addFoe(new Obelisk(180, -30, 0, 16, 3, 60)));
l.waitFor(l.addFoe(new Obelisk(320, -30, 0, 16, 3, 60)));
break;
case 1160:
makeBirds(3);
break;
case 1220:
makeMages(2);
makeBirds(2);
break;
case 0x0500:
makeBirds(3);
break;
case 1340:
makeMages(2);
makeSlingers(2);
makeBirds(3);
break;
case 1400:
makeBirds(7);
break;
case 1560:
l.waitFor(l.addFoe(new Obelisk(530, 250, -15, 0, 1, 40)));
l.waitFor(l.addFoe(new Obelisk(-30, 250, 15, 0, 1, 40)));
l.waitFor(l.addFoe(new Obelisk(530, 350, -15, 0, 1, 40)));
l.waitFor(l.addFoe(new Obelisk(-30, 350, 15, 0, 1, 40)));
break;
case 1630:
l.waitFor(l.addFoe(new Obelisk(530, 300, -11, 0, 1, 40)));
l.waitFor(l.addFoe(new Obelisk(-30, 300, 11, 0, 1, 40)));
break;
case 1700:
l.waitFor(l.addFoe(new Golem(250, -100, 0, 16, 3, 30)));
break;
case 1900:
l.winLevel();
break;
};
}
function makeWall0(){
l.addFoe(new DoubleBrick(0, -70, 0, 7, 0, 0));
l.addFoe(new DoubleBrick(440, -70, 0, 7, 0, 0));
}
}
}//package levels
Section 140
//Level14 (levels.Level14)
package levels {
import foes.*;
public class Level14 extends Levels {
public function Level14(l:Level){
super(l);
}
function makeMage(x:int){
l.addFoe(new Mage(x, -30, 0, 5, 0, 60));
}
override public function spawn(t:Number){
var a:int;
if (((((((t % 20) == 0)) && ((t > 40)))) && ((t < 220)))){
makeCactus(((Math.random() * 400) + 50));
};
if (((((((t % 20) == 0)) && ((t > 360)))) && ((t < 500)))){
makeCactus(((Math.random() * 400) + 50));
};
if (((((((t % 30) == 0)) && ((t > 620)))) && ((t < 920)))){
makeCactus(((Math.random() * 400) + 50));
};
if (((((((t % 20) == 0)) && ((t > 620)))) && ((t < 850)))){
makeMage(((Math.random() * 400) + 50));
};
if (((((((t % 35) == 0)) && ((t > 1090)))) && ((t < 1450)))){
makeCactus(((Math.random() * 400) + 50));
};
if (((((((t % 45) == 0)) && ((t > 1090)))) && ((t < 1450)))){
makeMage(((Math.random() * 400) + 50));
};
if (((((((t % 50) == 0)) && ((t > 1090)))) && ((t < 1450)))){
makeSlinger(((Math.random() * 400) + 50));
};
if (((((((t % 8) == 0)) && ((t > 1700)))) && ((t < 2100)))){
makeEyeBit(((Math.random() * 400) + 50));
};
if (((((((t % 25) == 0)) && ((t > 1700)))) && ((t < 2100)))){
makeSlinger(((Math.random() * 400) + 50));
};
if (((((((t % 20) == 0)) && ((t > 2500)))) && ((t < 3000)))){
makeCactus(((Math.random() * 200) + 25));
makeCactus(((Math.random() * 200) + 275));
};
switch (t){
case 30:
makeEye(100, 15);
makeEye(400, 15);
break;
case 300:
makeEye(100, 15);
makeEye(400, 15);
makeEye(200, 18);
makeEye(300, 18);
break;
case 560:
makeEye(100, 15);
makeEye(400, 15);
makeEye(200, 18);
makeEye(300, 18);
break;
case 1000:
makeEye(100, 14);
makeEye(400, 14);
makeEye(200, 17);
makeEye(300, 17);
break;
case 1600:
makeEye(100, 14);
makeEye(400, 14);
makeEye(150, 19);
makeEye(350, 19);
makeEye(200, 17);
makeEye(300, 17);
break;
case 2250:
makeEye(100, 17);
makeEye(400, 17);
makeEye(200, 26);
makeEye(300, 26);
break;
case 2350:
a = 0;
while (a < 10) {
makeEyeBit(((Math.random() * 400) + 50));
a++;
};
break;
case 2400:
a = 0;
while (a < 10) {
makeEyeBit(((Math.random() * 400) + 50));
a++;
};
break;
case 2450:
a = 0;
while (a < 10) {
makeEyeBit(((Math.random() * 400) + 50));
a++;
};
break;
case 3220:
l.winLevel();
break;
};
}
function makeEye(x:Number, y:Number){
l.waitFor(l.addFoe(new EyeGuy(x, -70, 0, y, 3, 10)));
}
function makeSlinger(x:int){
l.addFoe(new Slinger(x, -30, 0, 5, 0, 7));
}
function makeEyeBit(x:int){
l.addFoe(new EyeBit(x, -30, 0, (5 + (Math.random() * 3)), 0, 0));
}
function makeSlingers(i:int){
var n:int;
n = 0;
while (n < i) {
l.waitFor(l.addFoe(new Slinger(((Math.random() * 450) + 25), -49, 0, (4 + (Math.random() * 3)), 0, 6)));
n++;
};
}
function makeCats2(){
l.addFoe(new DeadCat(420, -30, 0, 7, 0, 0));
l.addFoe(new DeadCat(370, -30, 0, 7, 0, 0));
l.addFoe(new DeadCat(80, -30, 0, 7, 0, 0));
l.addFoe(new DeadCat(130, -30, 0, 7, 0, 0));
}
function makeEye3(i:int){
var n:int;
n = 0;
while (n < i) {
l.addFoe(new EyeBall(((Math.random() * 450) + 25), -30, 0, (6 + (Math.random() * 5)), 0, 5000));
n++;
};
}
function makeHydra(y:Number, left:Boolean, xp:Number, tt:Number){
return (l.addFoe(new Hydra(0, y, left, xp, 4, tt)));
}
function makeGhost(x:Number, y:Number){
return (l.waitFor(l.addFoe(new Ghost(x, -50, 0, y, 3, 50))));
}
function makeCactus(x:int){
l.addFoe(new Cactus(x, -30, 0, 4, 0, 5));
}
}
}//package levels
Section 141
//Level15 (levels.Level15)
package levels {
import foes.*;
public class Level15 extends Levels {
public function Level15(l:Level){
super(l);
}
function makeWall3(){
l.addFoe(new DoubleBrick(0, -70, 0, 5, 0, 0));
l.addFoe(new DoubleBrick(440, -70, 0, 5, 0, 0));
l.addFoe(new DoubleBrick(140, -70, 0, 5, 0, 0));
l.addFoe(new DoubleBrick(300, -70, 0, 5, 0, 0));
}
function makeRow1(){
l.addFoe(new SmallBrick(0, -70, 0, 6, 0, 0));
l.addFoe(new SmallBrick(440, -70, 0, 6, 0, 0));
l.addFoe(new SmallBrick(140, -70, 0, 6, 0, 0));
l.addFoe(new SmallBrick(300, -70, 0, 6, 0, 0));
l.addFoe(new DeadCat(100, -40, 0, 6, 0, 0));
l.addFoe(new DeadCat(250, -40, 0, 6, 0, 0));
l.addFoe(new DeadCat(400, -40, 0, 6, 0, 0));
}
function makeRow2(){
l.addFoe(new BigBrick(0, -70, 0, 6, 0, 0));
l.addFoe(new BigBrick(380, -70, 0, 6, 0, 0));
l.addFoe(new DeadCat(200, -40, 0, 6, 0, 0));
l.addFoe(new DeadCat(250, -40, 0, 6, 0, 0));
l.addFoe(new DeadCat(300, -40, 0, 6, 0, 0));
}
function makeRow4(){
l.addFoe(new SmallBrick(50, -70, 0, 6, 0, 0));
l.addFoe(new SmallBrick(390, -70, 0, 6, 0, 0));
l.addFoe(new DeadCat(200, -40, 0, 6, 0, 0));
l.addFoe(new DeadCat(250, -40, 0, 6, 0, 0));
l.addFoe(new DeadCat(300, -40, 0, 6, 0, 0));
}
function makeRow5(){
l.addFoe(new BigBrick(190, -70, 0, 6, 0, 0));
l.addFoe(new DeadCat(350, -40, 0, 6, 0, 0));
l.addFoe(new DeadCat(400, -40, 0, 6, 0, 0));
l.addFoe(new DeadCat(450, -40, 0, 6, 0, 0));
}
function makeCats1(){
l.addFoe(new DeadCat(230, -30, 0, 5, 0, 0));
l.addFoe(new DeadCat(270, -30, 0, 5, 0, 0));
}
function makeRow3(){
l.addFoe(new BigBrick(190, -70, 0, 6, 0, 0));
l.addFoe(new DeadCat(50, -40, 0, 6, 0, 0));
l.addFoe(new DeadCat(100, -40, 0, 6, 0, 0));
l.addFoe(new DeadCat(150, -40, 0, 6, 0, 0));
}
function makeCats2(){
l.addFoe(new DeadCat(420, -30, 0, 5, 0, 0));
l.addFoe(new DeadCat(370, -30, 0, 5, 0, 0));
l.addFoe(new DeadCat(80, -30, 0, 5, 0, 0));
l.addFoe(new DeadCat(130, -30, 0, 5, 0, 0));
}
function makeCat(xx:int){
l.addFoe(new DeadCat(xx, -30, 0, 5, 0, 0));
}
function makeWall2(){
l.addFoe(new HugeBrick(150, -70, 0, 5, 0, 0));
l.addFoe(new DoubleBrick(0, -70, 0, 5, 0, 0));
l.addFoe(new DoubleBrick(440, -70, 0, 5, 0, 0));
}
override public function spawn(t:Number){
var b:int;
if (((((t % 30) == 0)) && ((t < 900)))){
b = (Math.random() * 5);
if (b == 0){
makeRow1();
};
if (b == 1){
makeRow2();
};
if (b == 2){
makeRow3();
};
if (b == 3){
makeRow4();
};
if (b == 4){
makeRow5();
};
};
if (((((t % 30) == 15)) && ((t < 900)))){
l.addFoe(new DeadCat(100, -40, 0, 6, 0, 0));
l.addFoe(new DeadCat(200, -40, 0, 6, 0, 0));
l.addFoe(new DeadCat(300, -40, 0, 6, 0, 0));
l.addFoe(new DeadCat(400, -40, 0, 6, 0, 0));
};
switch (t){
case 1030:
l.waitFor(l.addFoe(new Sphinx(250, -150, 0, 23, 3, 0)));
BGM.play("bossMusic");
break;
case 1150:
l.winLevel();
break;
};
}
function makeWall0(){
l.addFoe(new DoubleBrick(0, -70, 0, 5, 0, 0));
l.addFoe(new DoubleBrick(440, -70, 0, 5, 0, 0));
}
}
}//package levels
Section 142
//Level16 (levels.Level16)
package levels {
import foes.*;
public class Level16 extends Levels {
public function Level16(l:Level){
super(l);
}
function makeMage(x:int){
l.addFoe(new Mage(x, -30, 0, 5, 0, 60));
}
function makeCactus(x:int){
l.addFoe(new Cactus(x, -30, 0, 4, 0, 5));
}
function makeEye(x:Number, y:Number){
l.waitFor(l.addFoe(new EyeGuy(x, -70, 0, y, 3, 10)));
}
function makeShrubWall(yspeed:Number){
var b:Number;
b = 0;
while (b < 7) {
l.waitFor(l.addFoe(new Shrub((100 + (b * 50)), -30, 0, yspeed, 3, 17)));
b++;
};
}
function makeSlinger(x:int){
l.addFoe(new Slinger(x, -30, 0, 5, 0, 7));
}
function makeEyeBit(x:int){
l.addFoe(new EyeBit(x, -30, 0, (5 + (Math.random() * 3)), 0, 0));
}
function makeSlingers(i:int){
var n:int;
n = 0;
while (n < i) {
l.waitFor(l.addFoe(new Slinger(((Math.random() * 450) + 25), -49, 0, (4 + (Math.random() * 3)), 0, 6)));
n++;
};
}
function makeCats2(){
l.addFoe(new DeadCat(420, -30, 0, 7, 0, 0));
l.addFoe(new DeadCat(370, -30, 0, 7, 0, 0));
l.addFoe(new DeadCat(80, -30, 0, 7, 0, 0));
l.addFoe(new DeadCat(130, -30, 0, 7, 0, 0));
}
function makeEye3(i:int){
var n:int;
n = 0;
while (n < i) {
l.addFoe(new EyeBall(((Math.random() * 450) + 25), -30, 0, (6 + (Math.random() * 5)), 0, 5000));
n++;
};
}
function makeGhost2(x:Number){
return (l.addFoe(new Ghost(x, -50, 0, 4, 0, 50)));
}
function makeHydra(y:Number, left:Boolean, xp:Number, tt:Number){
if (!left){
return (l.addFoe(new Hydra(0, (((l.player.y * 5) / 6) + 50), left, xp, 0, tt)));
};
return (l.addFoe(new Hydra(500, (((l.player.y * 5) / 6) + 50), left, -(xp), 0, tt)));
}
function makeShrubs(x:int){
l.addFoe(new Shrub(x, -30, 0, 4, 0, 17));
l.addFoe(new Shrub((500 - x), -30, 0, 4, 0, 17));
}
function makeGhost(x:Number, y:Number){
return (l.waitFor(l.addFoe(new Ghost(x, -50, 0, y, 3, 50))));
}
override public function spawn(t:Number){
if (((((((t % 20) == 0)) && ((t > 0)))) && ((t < 120)))){
makeShrubs(170);
makeShrubs(223);
};
if (((((((t % 20) == 0)) && ((t >= 120)))) && ((t < 240)))){
makeShrubs(50);
makeShrubs(120);
};
if (((((((t % 30) == 0)) && ((t >= 1400)))) && ((t < 1900)))){
makeShrubs(((Math.random() * 200) + 25));
};
if (((((((t % 200) == 100)) && ((t >= 1400)))) && ((t < 2500)))){
makeHydra(((Math.random() * 500) + 50), false, 10, 40);
};
if (((((((t % 200) == 0)) && ((t >= 1400)))) && ((t < 2500)))){
makeHydra(((Math.random() * 500) + 50), true, 10, 40);
};
if (((((((t % 80) == 0)) && ((t >= 2000)))) && ((t < 2500)))){
makeGhost2(((Math.random() * 200) + 25));
};
switch (t){
case 300:
makeShrubWall(10);
makeShrubWall(17);
break;
case 360:
makeShrubWall(12);
makeShrubWall(17);
makeShrubWall(22);
break;
case 420:
l.waitFor(l.addFoe(new BigShrub(250, -80, 0, 15, 3, 0)));
break;
case 500:
makeShrubWall(10);
makeShrubWall(15);
makeShrubWall(20);
makeShrubWall(25);
break;
case 570:
l.waitFor(l.addFoe(new BigShrub(150, -80, 0, 14, 3, 0)));
l.waitFor(l.addFoe(new BigShrub(350, -80, 0, 14, 3, 0)));
break;
case 660:
makeGhost(100, 14);
makeGhost(400, 14);
break;
case 620:
makeGhost(150, 14);
makeGhost(250, 16);
makeGhost(350, 14);
break;
case 700:
makeHydra(((Math.random() * 500) + 50), true, 8, 90);
break;
case 750:
makeHydra(((Math.random() * 500) + 50), false, 8, 90);
break;
case 800:
makeHydra(((Math.random() * 500) + 50), true, 8, 60);
break;
case 850:
makeHydra(((Math.random() * 500) + 50), false, 9, 60);
break;
case 900:
makeHydra(((Math.random() * 500) + 50), true, 9, 50);
break;
case 950:
makeHydra(((Math.random() * 500) + 50), false, 10, 50);
break;
case 980:
makeHydra(((Math.random() * 500) + 50), true, 10, 40);
break;
case 1010:
makeHydra(((Math.random() * 500) + 50), false, 10, 40);
break;
case 1040:
makeHydra(((Math.random() * 500) + 50), true, 11, 30);
break;
case 1060:
makeHydra(((Math.random() * 500) + 50), false, 11, 30);
break;
case 1080:
makeHydra(((Math.random() * 500) + 50), true, 12, 20);
break;
case 1100:
makeHydra(((Math.random() * 500) + 50), false, 12, 20);
break;
case 1180:
makeGhost(100, 15);
makeGhost(200, 17);
makeGhost(300, 17);
makeGhost(400, 15);
break;
case 1240:
makeGhost(120, 14);
makeGhost(380, 14);
makeGhost(100, 17);
makeGhost(200, 15);
makeGhost(300, 15);
makeGhost(400, 17);
break;
case 2690:
l.winLevel();
break;
};
}
}
}//package levels
Section 143
//Level17 (levels.Level17)
package levels {
import foes.*;
public class Level17 extends Levels {
public function Level17(l:Level){
super(l);
}
function makeMage(x:int){
l.addFoe(new Mage(x, -30, 0, 5, 0, 60));
}
function makeCactus(x:int){
l.addFoe(new Cactus(x, -30, 0, 4, 0, 5));
}
function makeSlinger(x:int){
l.addFoe(new Slinger(x, -30, 0, 5, 0, 7));
}
function makeEyeBit(x:int){
l.addFoe(new EyeBit(x, -30, 0, (5 + (Math.random() * 3)), 0, 0));
}
function makeSlingers(i:int){
var n:int;
n = 0;
while (n < i) {
l.waitFor(l.addFoe(new Slinger(((Math.random() * 450) + 25), -49, 0, (4 + (Math.random() * 3)), 0, 6)));
n++;
};
}
function makeFireWall(yspeed:Number){
var b:Number;
b = 0;
while (b < 7) {
l.waitFor(l.addFoe(new FireGuy((100 + (b * 50)), -30, 0, yspeed, 3, 9)));
b++;
};
}
function makeFlameWall(yspeed:Number){
var b:Number;
b = 0;
while (b < 7) {
l.waitFor(l.addFoe(new FlameGuy((100 + (b * 50)), -30, 0, yspeed, 3, 4)));
b++;
};
}
function makeGhost(x:Number, y:Number){
return (l.waitFor(l.addFoe(new Ghost(x, -50, 0, y, 3, 50))));
}
function makeGhost2(x:Number){
return (l.addFoe(new Ghost(x, -50, 0, 4, 0, 100)));
}
function makeHydra(y:Number, left:Boolean, xp:Number, tt:Number){
if (!left){
return (l.addFoe(new Hydra(0, (((l.player.y * 5) / 6) + 50), left, xp, 0, tt)));
};
return (l.addFoe(new Hydra(500, (((l.player.y * 5) / 6) + 50), left, -(xp), 0, tt)));
}
function makeShrubs(x:int){
l.addFoe(new Shrub(x, -30, 0, 4, 0, 17));
l.addFoe(new Shrub((500 - x), -30, 0, 4, 0, 17));
}
override public function spawn(t:Number){
if (((((((t % 19) == 0)) && ((t > 0)))) && ((t < 500)))){
l.addFoe(new FlameGuy(((Math.random() * 450) + 25), -30, 0, 4, 0, 3));
};
if (((((((t % 24) == 0)) && ((t > 700)))) && ((t < 1200)))){
l.addFoe(new FlameGuy(((Math.random() * 450) + 25), -30, 0, 4, 0, 4));
};
if (((((((t % 17) == 0)) && ((t > 700)))) && ((t < 1200)))){
l.addFoe(new RedSlime(((Math.random() * 450) + 25), -30, 0, 4, 0, 3));
};
if (((((((t % 32) == 0)) && ((t > 1400)))) && ((t < 1900)))){
l.addFoe(new FireGuy(((Math.random() * 450) + 25), -30, 0, 4, 0, 9));
};
if (((((((t % 90) == 0)) && ((t > 1400)))) && ((t < 1900)))){
makeGhost2(((Math.random() * 450) + 25));
};
if (((((((t % 33) == 0)) && ((t > 2100)))) && ((t < 2600)))){
l.addFoe(new FlameGuy(((Math.random() * 450) + 25), -30, 0, 4, 0, 4));
};
if (((((((t % 27) == 0)) && ((t > 2100)))) && ((t < 2600)))){
l.addFoe(new FlameGuy(((Math.random() * 450) + 25), -30, 0, 4, 0, 4));
};
if (((((((t % 39) == 0)) && ((t > 2800)))) && ((t < 3250)))){
l.addFoe(new FlameGuy(((Math.random() * 450) + 25), -30, 0, 4, 0, 4));
};
if (((((((t % 38) == 0)) && ((t > 2800)))) && ((t < 3250)))){
l.addFoe(new FireGuy(((Math.random() * 450) + 25), -30, 0, 4, 0, 10));
};
if (((((((t % 28) == 0)) && ((t > 2800)))) && ((t < 3250)))){
l.addFoe(new RedSlime(((Math.random() * 450) + 25), -30, 0, 4, 0, 4));
};
switch (t){
case 600:
makeFireWall(12);
break;
case 1300:
makeFlameWall(12);
makeFireWall(17);
break;
case 2000:
makeFlameWall(15);
makeFireWall(20);
break;
case 2700:
makeBigSlime(250, 23);
break;
case 3350:
makeBigSlime(150, 16);
makeBigSlime(350, 16);
break;
case 3590:
l.winLevel();
break;
};
}
function makeBigSlime(x:Number, y:Number){
l.waitFor(l.addFoe(new BigSlime(x, -70, 0, y, 3, 30)));
}
function makeCats2(){
l.addFoe(new DeadCat(420, -30, 0, 7, 0, 0));
l.addFoe(new DeadCat(370, -30, 0, 7, 0, 0));
l.addFoe(new DeadCat(80, -30, 0, 7, 0, 0));
l.addFoe(new DeadCat(130, -30, 0, 7, 0, 0));
}
}
}//package levels
Section 144
//Level18 (levels.Level18)
package levels {
import foes.*;
public class Level18 extends Levels {
public function Level18(l:Level){
super(l);
}
function makeMage(x:int){
l.addFoe(new Mage(x, -30, 0, 5, 0, 60));
}
function makeCactus(x:int){
l.addFoe(new Cactus(x, -30, 0, 4, 0, 5));
}
function makeSlinger(x:int){
l.addFoe(new Slinger(x, -30, 0, 5, 0, 7));
}
function makeEyeBit(x:int){
l.addFoe(new EyeBit(x, -30, 0, (5 + (Math.random() * 3)), 0, 0));
}
function makeSlingers(i:int){
var n:int;
n = 0;
while (n < i) {
l.waitFor(l.addFoe(new Slinger(((Math.random() * 450) + 25), -49, 0, (4 + (Math.random() * 3)), 0, 6)));
n++;
};
}
function makeFireWall(yspeed:Number){
var b:Number;
b = 0;
while (b < 7) {
l.waitFor(l.addFoe(new FireGuy((100 + (b * 50)), -30, 0, yspeed, 3, 9)));
b++;
};
}
function makeFlameWall(yspeed:Number){
var b:Number;
b = 0;
while (b < 7) {
l.waitFor(l.addFoe(new FlameGuy((100 + (b * 50)), -30, 0, yspeed, 3, 4)));
b++;
};
}
function makeGhost(x:Number, y:Number){
return (l.waitFor(l.addFoe(new Ghost(x, -50, 0, y, 3, 50))));
}
function makeGhost2(x:Number){
return (l.addFoe(new Ghost(x, -50, 0, 4, 0, 100)));
}
function makeHydra(y:Number, left:Boolean, xp:Number, tt:Number){
if (!left){
return (l.addFoe(new Hydra(0, (((l.player.y * 5) / 6) + 50), left, xp, 0, tt)));
};
return (l.addFoe(new Hydra(500, (((l.player.y * 5) / 6) + 50), left, -(xp), 0, tt)));
}
function makeShrubs(x:int){
l.addFoe(new Shrub(x, -30, 0, 4, 0, 17));
l.addFoe(new Shrub((500 - x), -30, 0, 4, 0, 17));
}
override public function spawn(t:Number){
if (((((((t % 30) == 0)) && ((t > 0)))) && ((t < 300)))){
l.addFoe(new GunBot(-30, 120, 4, 0, 0, 10));
l.addFoe(new GunBot(530, 200, -4, 0, 0, 10));
};
if (((((((t % 30) == 0)) && ((t > 660)))) && ((t < 960)))){
l.addFoe(new LazorBot(-30, ((Math.random() * 350) + 25), 4, 0, 0, (20 + Math.floor((Math.random() * 5)))));
l.addFoe(new LazorBot(530, ((Math.random() * 350) + 25), -4, 0, 0, (20 + Math.floor((Math.random() * 5)))));
};
if (((((((t % 20) == 0)) && ((t > 1360)))) && ((t < 2400)))){
l.addFoe(new Missile(((Math.random() * 450) + 25), -30, 0, (7 + (Math.random() * 3))));
};
if (((((((t % 65) == 0)) && ((t > 1500)))) && ((t < 2400)))){
l.addFoe(new GunBot(-30, ((Math.random() * 200) + 100), 14, 0, 2, 12));
l.addFoe(new GunBot(530, ((Math.random() * 200) + 100), -14, 0, 2, 12));
};
if (((((((t % 109) == 0)) && ((t > 1850)))) && ((t < 2400)))){
l.addFoe(new LazorBot(-30, ((Math.random() * 200) + 100), 14, 0, 2, 20));
l.addFoe(new LazorBot(530, ((Math.random() * 200) + 100), -14, 0, 2, 20));
};
if (((((((t % 20) == 0)) && ((t > 2580)))) && ((t < 3000)))){
l.addFoe(new Missile(((Math.random() * 450) + 25), -30, 0, (7 + (Math.random() * 3))));
};
if (((((((t % 42) == 0)) && ((t > 2580)))) && ((t < 3000)))){
l.addFoe(new SeaBomb(((Math.random() * 450) + 25), -45, 0, (3 + (Math.random() * 3)), 0, 60));
};
switch (t){
case 400:
l.addFoe(new GunBot(-30, 400, 6, 0, 2, 8));
break;
case 420:
l.addFoe(new GunBot(-30, 350, 8, 0, 2, 8));
break;
case 440:
l.addFoe(new GunBot(-30, 300, 10, 0, 2, 8));
break;
case 460:
l.addFoe(new GunBot(-30, 250, 12, 0, 2, 8));
break;
case 480:
l.addFoe(new GunBot(-30, 200, 14, 0, 2, 8));
break;
case 500:
l.addFoe(new GunBot(-30, 150, 16, 0, 2, 8));
break;
case 520:
l.addFoe(new GunBot(530, 400, -6, 0, 2, 8));
break;
case 530:
l.addFoe(new GunBot(530, 350, -8, 0, 2, 8));
break;
case 540:
l.addFoe(new GunBot(530, 300, -10, 0, 2, 8));
break;
case 550:
l.addFoe(new GunBot(530, 250, -12, 0, 2, 8));
break;
case 560:
l.addFoe(new GunBot(530, 200, -14, 0, 2, 8));
break;
case 570:
l.addFoe(new GunBot(530, 150, -16, 0, 2, 8));
break;
case 1030:
l.addFoe(new LazorBot(-30, 400, 6, 0, 2, 20));
break;
case 1040:
l.addFoe(new LazorBot(-30, 350, 8, 0, 2, 20));
break;
case 1050:
l.addFoe(new LazorBot(-30, 300, 10, 0, 2, 20));
break;
case 1060:
l.addFoe(new LazorBot(-30, 250, 12, 0, 2, 20));
break;
case 1070:
l.addFoe(new LazorBot(-30, 200, 14, 0, 2, 20));
break;
case 1080:
l.addFoe(new LazorBot(-30, 150, 16, 0, 2, 20));
break;
case 1100:
l.addFoe(new LazorBot(530, 400, -6, 0, 2, 20));
break;
case 1110:
l.addFoe(new LazorBot(530, 350, -8, 0, 2, 20));
break;
case 1120:
l.addFoe(new LazorBot(530, 300, -10, 0, 2, 20));
break;
case 1130:
l.addFoe(new LazorBot(530, 250, -12, 0, 2, 20));
break;
case 1140:
l.addFoe(new LazorBot(530, 200, -14, 0, 2, 20));
break;
case 1150:
l.addFoe(new LazorBot(530, 150, -16, 0, 2, 20));
break;
case 1260:
l.waitFor(l.addFoe(new Tank(150, -70, 0, 15, 3, 50)));
l.waitFor(l.addFoe(new Tank(350, -70, 0, 15, 3, 33)));
break;
case 2500:
l.waitFor(l.addFoe(new Tank(150, -70, 0, 15, 3, 36)));
l.waitFor(l.addFoe(new Tank(350, -70, 0, 15, 3, 27)));
break;
case 3160:
l.waitFor(l.addFoe(new BossBot(250, -90, 0, 15, 3, 0)));
break;
case 3360:
l.winLevel();
break;
};
}
function makeBigSlime(x:Number, y:Number){
l.waitFor(l.addFoe(new BigSlime(x, -70, 0, y, 3, 30)));
}
function makeCats2(){
l.addFoe(new DeadCat(420, -30, 0, 7, 0, 0));
l.addFoe(new DeadCat(370, -30, 0, 7, 0, 0));
l.addFoe(new DeadCat(80, -30, 0, 7, 0, 0));
l.addFoe(new DeadCat(130, -30, 0, 7, 0, 0));
}
}
}//package levels
Section 145
//Level19 (levels.Level19)
package levels {
import foes.*;
public class Level19 extends Levels {
public function Level19(l:Level){
super(l);
}
function makeMage(x:int){
l.addFoe(new Mage(x, -30, 0, 5, 0, 60));
}
function makeCactus(x:int){
l.addFoe(new Cactus(x, -30, 0, 4, 0, 5));
}
function makeSlinger(x:int){
l.addFoe(new Slinger(x, -30, 0, 5, 0, 7));
}
function makeEyeBit(x:int){
l.addFoe(new EyeBit(x, -30, 0, (5 + (Math.random() * 3)), 0, 0));
}
function makeSlingers(i:int){
var n:int;
n = 0;
while (n < i) {
l.waitFor(l.addFoe(new Slinger(((Math.random() * 450) + 25), -49, 0, (4 + (Math.random() * 3)), 0, 6)));
n++;
};
}
function makeFireWall(yspeed:Number){
var b:Number;
b = 0;
while (b < 4) {
l.waitFor(l.addFoe(new FireGuy((100 + (b * 100)), -30, 0, yspeed, 4, 12)));
b++;
};
}
function makeFlameWall(yspeed:Number){
var b:Number;
b = 0;
while (b < 4) {
l.waitFor(l.addFoe(new FlameGuy((100 + (b * 100)), -30, 0, yspeed, 4, 6)));
b++;
};
}
function makeGhost(x:Number, y:Number){
return (l.waitFor(l.addFoe(new Ghost(x, -50, 0, y, 3, 50))));
}
function makeGhost2(x:Number){
return (l.addFoe(new Ghost(x, -50, 0, 4, 0, 100)));
}
function makeHydra(y:Number, left:Boolean, xp:Number, tt:Number){
if (!left){
return (l.addFoe(new Hydra(0, (((l.player.y * 5) / 6) + 50), left, xp, 0, tt)));
};
return (l.addFoe(new Hydra(500, (((l.player.y * 5) / 6) + 50), left, -(xp), 0, tt)));
}
function makeShrubs(x:int){
l.addFoe(new Shrub(x, -30, 0, 8, 0, 10000));
l.addFoe(new Shrub((500 - x), -30, 0, 8, 0, 10000));
}
override public function spawn(t:Number){
if (((((((t % 9) == 0)) && ((t > 760)))) && ((t < 1160)))){
makeShrubs(100);
makeShrubs(150);
makeShrubs(200);
};
switch (t){
case 30:
l.waitFor(l.addFoe(new Monolith(250, -90, 0, 15, 3, 40)));
break;
case 60:
l.addFoe(new LazorBot(-30, 50, 14, 0, 2, 20));
l.addFoe(new LazorBot(530, 100, -14, 0, 2, 20));
break;
case 90:
l.waitFor(l.addFoe(new FaceBot(250, -90, 0, 17, 3, 50)));
break;
case 150:
l.waitFor(l.addFoe(new FaceBot(150, -90, 0, 17, 3, 60)));
l.waitFor(l.addFoe(new FaceBot(350, -90, 0, 17, 3, 60)));
break;
case 210:
l.waitFor(l.addFoe(new FaceBot(150, -90, 0, 14, 3, 70)));
l.waitFor(l.addFoe(new Monolith(250, -90, 0, 19, 3, 70)));
l.waitFor(l.addFoe(new FaceBot(350, -90, 0, 14, 3, 70)));
break;
case 270:
makeFlameWall(10);
makeFireWall(12);
break;
case 300:
makeFlameWall(13);
makeFireWall(17);
break;
case 360:
makeFlameWall(11);
makeFireWall(14);
l.waitFor(l.addFoe(new Demon(250, -90, 0, 16, 3, 20)));
break;
case 400:
makeFlameWall(12);
makeFireWall(15);
l.waitFor(l.addFoe(new Demon(100, -90, 0, 24, 3, 35)));
l.waitFor(l.addFoe(new Demon(400, -90, 0, 24, 3, 35)));
break;
case 460:
l.waitFor(l.addFoe(new Monolith(150, -90, 0, 14, 3, Infinity)));
l.waitFor(l.addFoe(new Monolith(350, -90, 0, 14, 3, Infinity)));
break;
case 520:
l.waitFor(l.addFoe(new Demon(150, -90, 0, 14, 3, 26)));
l.waitFor(l.addFoe(new BigSlime(250, -90, 0, 19, 3, 45)));
l.waitFor(l.addFoe(new Demon(350, -90, 0, 14, 3, 26)));
break;
case 580:
l.waitFor(l.addFoe(new BigSlime(150, -90, 0, 14, 3, 60)));
l.waitFor(l.addFoe(new BigSlime(350, -90, 0, 14, 3, 60)));
break;
case 640:
l.waitFor(l.addFoe(new Tank(150, -70, 0, 15, 3, 49)));
l.waitFor(l.addFoe(new Tank(350, -70, 0, 19, 3, 37)));
l.waitFor(l.addFoe(new Tank(250, -70, 0, 25, 3, 64)));
break;
case 700:
l.waitFor(l.addFoe(new Demon(150, -90, 0, 14, 3, 28)));
l.waitFor(l.addFoe(new Monolith(250, -90, 0, 19, 3, Infinity)));
l.waitFor(l.addFoe(new Demon(350, -90, 0, 14, 3, 28)));
break;
case 1200:
l.waitFor(l.addFoe(new Monolith(150, -90, 0, 14, 3, Infinity)));
l.waitFor(l.addFoe(new Monolith(350, -90, 0, 14, 3, Infinity)));
l.waitFor(l.addFoe(new Monolith(300, -90, 0, 19, 3, Infinity)));
l.waitFor(l.addFoe(new Monolith(200, -90, 0, 19, 3, Infinity)));
break;
case 1360:
l.winLevel();
break;
};
}
function makeBigSlime(x:Number, y:Number){
l.waitFor(l.addFoe(new BigSlime(x, -70, 0, y, 3, 30)));
}
function makeCats2(){
l.addFoe(new DeadCat(420, -30, 0, 7, 0, 0));
l.addFoe(new DeadCat(370, -30, 0, 7, 0, 0));
l.addFoe(new DeadCat(80, -30, 0, 7, 0, 0));
l.addFoe(new DeadCat(130, -30, 0, 7, 0, 0));
}
}
}//package levels
Section 146
//Level2 (levels.Level2)
package levels {
import foes.*;
import bullets.*;
public class Level2 extends Levels {
public function Level2(l:Level){
super(l);
}
function makeLogWall(){
var b:Number;
b = 0;
while (b < 9) {
l.addFoe(new BigLog((50 + (b * 50)), -30, 0, 6, 0, 30));
b++;
};
}
function makeTree(x:Number, y:Number){
return (l.waitFor(l.addFoe(new Tree(x, -49, 0, y, 3, 40))));
}
function makeCat(x:Number){
l.addFoe(new Kitten(x, -30, 0, 4, 0, 30));
}
function makeSlimeWall(){
var b:Number;
b = 0;
while (b < 10) {
l.addFoe(new GreenSlime((25 + (b * 50)), -30, 0, 4, 0, 20));
b++;
};
}
function makeSlime2(){
l.addFoe(new GreenSlime(-30, -30, ((Math.random() * 7) + 5), ((Math.random() * 5) + 3), 1, 30));
}
function makeBigBush2(x:Number, y:Number){
makeBigBush(x, y);
makeBigBush((500 - x), y);
}
function makeLog(x:Number){
l.addFoe(new BigLog(x, -30, 0, 3, 0, 30));
}
function makeSlime3(){
l.addFoe(new GreenSlime(530, -30, ((-(Math.random()) * 7) - 5), ((Math.random() * 5) + 3), 1, 30));
}
function makeBigBush(x:Number, y:Number){
l.waitFor(l.addFoe(new BigBush(x, -49, 0, y, 3, 5)));
}
override public function spawn(t:Number){
if (((((t % 17) == 0)) && ((t < 160)))){
makeSlime2();
makeSlime3();
};
if (((((((t % 15) == 0)) && ((t > 360)))) && ((t < 490)))){
makeBush(((Math.random() * 450) + 25));
};
if (((((((t % 12) == 0)) && ((t > 910)))) && ((t < 1000)))){
makeCat(100);
makeCat(140);
makeCat(400);
makeCat(360);
};
if (((((((t % 12) == 0)) && ((t > 870)))) && ((t < 1080)))){
};
if (((((((t % 16) == 0)) && ((t > 1100)))) && ((t < 1220)))){
};
switch (t){
case 270:
makeSlimeWall();
break;
case 300:
makeSlimeWall();
break;
case 580:
makeTank(200);
makeTank(300);
break;
case 640:
makeTank(150);
makeTank(350);
break;
case 700:
makeTank(200).drop = "shield";
makeTank(300).drop = "heart";
break;
case 820:
makeLogWall();
break;
case 940:
makeTank(250);
break;
case 990:
makeTank(250);
break;
case 1120:
makeBigBush2(100, 15);
break;
case 1150:
makeBigBush2(200, 17);
break;
case 1220:
makeTree(150, 14);
makeTree(350, 14).drop = "heart";
makeTree(250, 17);
break;
case 1300:
l.winLevel();
};
}
function makeBush(x:Number){
l.addFoe(new Bush(x, -49, 0, 4, 0, 30));
}
function makeTank(x:Number){
return (l.addFoe(new CatRam(x, -49, 0, 3, 0, 40)));
}
}
}//package levels
Section 147
//Level20 (levels.Level20)
package levels {
import foes.*;
public class Level20 extends Levels {
public function Level20(l:Level){
super(l);
}
override public function spawn(t:Number){
if (((((t % 14) == 0)) && ((t < 600)))){
l.addFoe(new Shrub(-30, 300, 6, 0, 0, 111111110));
l.addFoe(new RedSlime(530, 250, -6, 0, 0, 111111110));
};
if (((((t % 19) == 0)) && ((t < 600)))){
l.addFoe(new Shrub(-30, 200, 5, 0, 0, 1000));
};
if (((((t % 50) == 0)) && ((t < 600)))){
l.addFoe(new FlameGuy(-30, 150, 2, 0, 0, 12));
l.addFoe(new FireGuy(530, 100, -2, 0, 0, 20));
};
switch (t){
case 750:
l.waitFor(l.addFoe(new GodCat(250, -150, 0, 23, 3, 0)));
BGM.play("bossMusic");
break;
case 900:
l.winLevel();
break;
};
}
}
}//package levels
Section 148
//Level21 (levels.Level21)
package levels {
import foes.*;
public class Level21 extends Levels {
public function Level21(l:Level){
super(l);
}
override public function spawn(t:Number){
var a:int;
a = 0;
switch (t){
case 60:
l.waitFor(l.addFoe(new SlimeKing2(250, -150, 0, 19, 3, 0)));
break;
case 250:
l.winLevel();
break;
};
}
}
}//package levels
Section 149
//Level22 (levels.Level22)
package levels {
import foes.*;
public class Level22 extends Levels {
public function Level22(l:Level){
super(l);
}
override public function spawn(t:Number){
var a:int;
a = 0;
switch (t){
case 60:
l.waitFor(l.addFoe(new GiantCrab2(250, -150, 0, 24, 3, 0)));
break;
case 250:
l.winLevel();
break;
};
}
}
}//package levels
Section 150
//Level23 (levels.Level23)
package levels {
import foes.*;
public class Level23 extends Levels {
public function Level23(l:Level){
super(l);
}
override public function spawn(t:Number){
var a:int;
a = 0;
switch (t){
case 60:
l.waitFor(l.addFoe(new Sphinx2(250, -150, 0, 23, 3, 0)));
break;
case 250:
l.winLevel();
break;
};
}
}
}//package levels
Section 151
//Level24 (levels.Level24)
package levels {
import foes.*;
public class Level24 extends Levels {
public function Level24(l:Level){
super(l);
}
override public function spawn(t:Number){
var a:int;
a = 0;
switch (t){
case 60:
l.waitFor(l.addFoe(new GodCat2(250, -150, 0, 23, 3, 0)));
break;
case 250:
l.winLevel();
break;
};
}
}
}//package levels
Section 152
//Level25 (levels.Level25)
package levels {
import foes.*;
import drops.*;
import bullets.*;
public class Level25 extends Levels {
var lastRandom:int;// = -1
var b:int;// = 0
var pnext:int;// = 20
var r:int;// = 0
public var waveCount:int;// = 0
var waveTimer:int;// = 0
public function Level25(l:Level){
b = 0;
r = 0;
waveCount = 0;
waveTimer = 0;
lastRandom = -1;
pnext = 20;
super(l);
survival = true;
}
override public function timer(){
if (l.moneyCollected >= pnext){
pnext = (pnext * 2);
l.player.levelUp();
};
waveTimer++;
if (waveTimer > 300){
l.foeTimeOut();
waveTimer = 0;
};
}
public function random(a:int):int{
var b:int;
b = (Math.random() * a);
while (b == lastRandom) {
b = (Math.random() * a);
};
lastRandom = b;
return (b);
}
function waves(c:int){
var a:int;
if (c > 80){
r = random(9);
if (r == 8){
b = 50;
while (b < 490) {
l.waitFor(l.addFoe(new LazorBot(b, -30, 0, 8, 3, 18)));
l.waitFor(l.addFoe(new CrossBomb(b, -30, 0, (3 + (Math.random() * 2)))));
b = (b + 80);
};
};
if (r == 7){
l.waitFor(l.addFoe(new Tank(150, -70, 0, 12, 3, 56)));
l.waitFor(l.addFoe(new FaceBot(250, -30, 0, 18, 3, 7)));
l.waitFor(l.addFoe(new Tank(350, -70, 0, 12, 3, 69)));
};
if (r == 6){
b = 50;
while (b < 490) {
l.waitFor(l.addFoe(new Tree((b + 20), -30, 0, 9, 3, 25)));
l.waitFor(l.addFoe(new PurpleJelly((b - 20), -30, 0, 12, 3, 18)));
l.waitFor(l.addFoe(new PinkJelly((b + 20), -30, 0, 16, 3, 10)));
b = (b + 80);
};
};
if (r == 5){
l.waitFor(l.addFoe(new Monolith(-80, 150, 22, 0, 1, Infinity))).t = 5;
l.waitFor(l.addFoe(new Monolith(580, 150, -22, 0, 1, Infinity))).t = 10;
l.waitFor(l.addFoe(new Monolith(-80, 220, 22, 0, 1, Infinity))).t = 15;
l.waitFor(l.addFoe(new Monolith(580, 220, -22, 0, 1, Infinity))).t = 20;
};
if (r == 4){
l.waitFor(l.addFoe(new BossBot(120, -90, 0, 15, 3, 0)));
l.waitFor(l.addFoe(new BossBot(380, -90, 0, 15, 3, 0)));
};
if (r == 3){
b = 50;
while (b < 500) {
l.waitFor(l.addFoe(new SeaBomb(b, -40, 0, (1 + (Math.random() * 4)), 0, 30)));
l.waitFor(l.addFoe(new Missile(((Math.random() * 450) + 25), -30, 0, (2 + (Math.random() * 3)))));
b = (b + 50);
};
l.waitFor(l.addFoe(new CrossBomb(((Math.random() * 450) + 25), -30, 0, (2 + (Math.random() * 2)))));
};
if (r == 2){
l.waitFor(l.addFoe(new Golem(150, -100, 0, 16, 3, 30)));
l.waitFor(l.addFoe(new Golem(350, -100, 0, 16, 3, 30)));
};
if (r == 1){
l.waitFor(l.addFoe(new Monolith(-80, 100, 15, 0, 1, Infinity))).t = 5;
l.waitFor(l.addFoe(new Monolith(580, 100, -15, 0, 1, Infinity))).t = 10;
l.waitFor(l.addFoe(new Monolith(-80, 500, 15, 0, 1, Infinity))).t = 15;
l.waitFor(l.addFoe(new Monolith(580, 500, -15, 0, 1, Infinity))).t = 20;
};
if (r == 0){
l.waitFor(l.addFoe(new LazorBot(70, -30, 0, 15, 3, 40)));
l.waitFor(l.addFoe(new FaceBot(160, -70, 0, 11, 3, 18)));
l.waitFor(l.addFoe(new FaceBot(250, -30, 0, 17, 3, 12)));
l.waitFor(l.addFoe(new FaceBot(340, -70, 0, 11, 3, 18)));
l.waitFor(l.addFoe(new LazorBot(430, -30, 0, 15, 3, 40)));
};
} else {
if (c > 70){
r = random(10);
if (r == 9){
for each (b in [150, 200, 250, 300, 350]) {
l.waitFor(l.addFoe(new RedSlime(b, -30, 0, 10, 3, 0)));
l.waitFor(l.addFoe(new RedSlime(b, -30, 0, 13.2, 3, 0)));
l.waitFor(l.addFoe(new RedSlime(b, -30, 0, 16, 3, 0)));
};
for each (b in [50, 450]) {
l.waitFor(l.addFoe(new Ghost(b, -30, 0, 12, 3, 70)));
l.waitFor(l.addFoe(new Ghost(b, -30, 0, 18, 3, 70))).t = 10;
};
};
if (r == 8){
l.waitFor(l.addFoe(new BigSlime(250, -90, 0, 14, 3, 60)));
for each (b in [50, 100, 150, 350, 400, 450]) {
l.waitFor(l.addFoe(new RedSlime(b, -30, 0, 10, 3, 0)));
l.waitFor(l.addFoe(new RedSlime(b, -30, 0, 13.2, 3, 0)));
l.waitFor(l.addFoe(new RedSlime(b, -30, 0, 16, 3, 0)));
};
};
if (r == 7){
b = 200;
while (b < 350) {
l.waitFor(l.addFoe(new DeadCat(b, -30, 0, 12, 3, 12)));
l.waitFor(l.addFoe(new Ghost(b, -30, 0, 16, 3, 70)));
b = (b + 50);
};
l.waitFor(l.addFoe(new Demon(100, -90, 0, 15, 3, 28)));
l.waitFor(l.addFoe(new Demon(400, -90, 0, 15, 3, 28)));
};
if (r == 6){
l.waitFor(l.addFoe(new BigSlime(150, -90, 0, 14, 3, 60)));
l.waitFor(l.addFoe(new BigSlime(350, -90, 0, 14, 3, 60)));
};
if (r == 0){
l.waitFor(l.addFoe(new Demon(150, -90, 0, 15, 3, 28)));
l.waitFor(l.addFoe(new FaceBot(250, -30, 0, 17, 3, 12)));
l.waitFor(l.addFoe(new Demon(350, -90, 0, 15, 3, 28)));
};
if (r == 5){
l.waitFor(l.addFoe(new Monolith(-80, 100, 22, 0, 1, 50))).t = 5;
l.waitFor(l.addFoe(new Monolith(580, 100, -22, 0, 1, 50))).t = 5;
};
if (r == 4){
l.waitFor(l.addFoe(new GunBot(100, -30, 0, 15, 3, 15)));
l.waitFor(l.addFoe(new Tank(160, -70, 0, 15, 3, 36)));
l.waitFor(l.addFoe(new GunBot(250, -30, 0, 15, 3, 15)));
l.waitFor(l.addFoe(new Tank(340, -70, 0, 15, 3, 36)));
l.waitFor(l.addFoe(new GunBot(400, -30, 0, 15, 3, 15)));
};
if (r == 3){
b = 50;
while (b < 490) {
l.waitFor(l.addFoe(new Tree((b + 20), -30, 0, 9, 3, 40)));
l.waitFor(l.addFoe(new FlameGuy((b - 20), -30, 0, 12, 3, 6)));
l.waitFor(l.addFoe(new FireGuy((b + 20), -30, 0, 16, 3, 12)));
l.waitFor(l.addFoe(new DeadCat((b - 20), -30, 0, 19, 3, 20)));
b = (b + 80);
};
};
if (r == 2){
b = 50;
while (b < 490) {
l.waitFor(l.addFoe(new FlameGuy((b + 20), -30, 0, 9, 3, 7)));
l.waitFor(l.addFoe(new PurpleJelly((b - 20), -30, 0, 12, 3, 30)));
l.waitFor(l.addFoe(new FireGuy((b + 20), -30, 0, 16, 3, 11)));
l.waitFor(l.addFoe(new Shrub((b - 20), -30, 0, 19, 3, 20)));
b = (b + 80);
};
};
if (r == 1){
l.waitFor(l.addFoe(new BossBot(250, -90, 0, 15, 3, 0)));
l.waitFor(l.addFoe(new GunBot(400, -30, 0, 18, 3, 20)));
l.waitFor(l.addFoe(new GunBot(100, -30, 0, 18, 3, 20)));
};
} else {
if (c > 60){
r = random(10);
if (r == 9){
l.waitFor(l.addFoe(new GunBot(250, -49, 0, 9, 3, 40)));
l.waitFor(l.addFoe(new GunBot(180, -49, 0, 13, 3, 40)));
l.waitFor(l.addFoe(new GunBot(320, -49, 0, 13, 3, 40)));
l.waitFor(l.addFoe(new LazorBot(100, -49, 0, 17, 3, 40)));
l.waitFor(l.addFoe(new SeaBomb(210, -40, 0, 17, 3, 40)));
l.waitFor(l.addFoe(new SeaBomb(290, -40, 0, 17, 3, 40)));
l.waitFor(l.addFoe(new SeaBomb(250, -40, 0, 15, 3, 40)));
l.waitFor(l.addFoe(new SeaBomb(250, -40, 0, 19, 3, 40)));
l.waitFor(l.addFoe(new LazorBot(400, -49, 0, 17, 3, 40)));
l.waitFor(l.addFoe(new GunBot(180, -49, 0, 21, 3, 40)));
l.waitFor(l.addFoe(new GunBot(320, -49, 0, 21, 3, 40)));
l.waitFor(l.addFoe(new GunBot(250, -49, 0, 25, 3, 40)));
};
if (r == 8){
l.waitFor(l.addFoe(new GunBot(100, -30, 0, 15, 3, 15)));
l.waitFor(l.addFoe(new FaceBot(160, -70, 0, 15, 3, 36)));
l.waitFor(l.addFoe(new GunBot(250, -30, 0, 15, 3, 15)));
l.waitFor(l.addFoe(new FaceBot(340, -70, 0, 15, 3, 36)));
l.waitFor(l.addFoe(new GunBot(400, -30, 0, 15, 3, 15)));
};
if (r == 7){
b = 50;
while (b < 490) {
l.waitFor(l.addFoe(new LazorBot((b + 12), -30, ((Math.random() * 4) - 2), (8 + (Math.random() * 4)), 4, (25 + Math.floor((Math.random() * 15))))));
l.waitFor(l.addFoe(new LazorBot((b - 12), -30, ((Math.random() * 4) - 2), (11 + (Math.random() * 5)), 4, (25 + Math.floor((Math.random() * 15))))));
b = (b + 80);
};
};
if (r == 6){
b = 50;
while (b < 490) {
l.waitFor(l.addFoe(new GunBot((b + 12), -30, 0, 9, 3, 15)));
l.waitFor(l.addFoe(new GunBot((b - 12), -30, 0, 12, 3, 15)));
b = (b + 80);
};
};
if (r == 5){
b = 50;
while (b < 490) {
l.waitFor(l.addFoe(new FireGuy(b, -30, 0, 12, 3, 11)));
l.waitFor(l.addFoe(new FlameGuy(b, -30, 0, 18, 3, 7)));
b = (b + 80);
};
};
if (r == 4){
l.waitFor(l.addFoe(new Ghost(150, -50, 0, 17, 3, 70))).t = 10;
l.waitFor(l.addFoe(new Ghost(350, -50, 0, 17, 3, 70))).t = 10;
l.waitFor(l.addFoe(new Ghost(120, -50, 0, 12, 3, 70))).t = 20;
l.waitFor(l.addFoe(new Ghost(380, -50, 0, 12, 3, 70))).t = 20;
l.waitFor(l.addFoe(new Ghost(250, -50, 0, 11, 3, 70))).t = 0;
l.waitFor(l.addFoe(new Ghost(250, -50, 0, 22, 3, 70))).t = 30;
};
if (r == 3){
l.waitFor(l.addFoe(new BigShrub(250, -80, 0, 14, 3, 0)));
for each (b in [50, 100, 400, 450]) {
l.waitFor(l.addFoe(new Mage(b, -49, 0, 9, 3, 65)));
l.waitFor(l.addFoe(new Shrub(b, -49, 0, 15, 3, 40)));
};
};
if (r == 2){
l.waitFor(l.addFoe(new BigShrub(150, -80, 0, 14, 3, 0)));
l.waitFor(l.addFoe(new BigShrub(350, -80, 0, 14, 3, 0)));
};
if (r == 1){
b = 0;
while (b < 14) {
l.waitFor(l.addFoe(new Shrub(-30, ((Math.random() * 300) + 50), ((Math.random() * 10) + 7), ((Math.random() * 4) - 2), 2, 12)));
l.waitFor(l.addFoe(new Shrub(530, ((Math.random() * 300) + 50), ((-(Math.random()) * 10) - 7), ((Math.random() * 4) - 2), 2, 12)));
b++;
};
};
if (r == 0){
l.waitFor(l.addFoe(new Obelisk(250, -49, 0, 9, 3, 40)));
l.waitFor(l.addFoe(new Obelisk(200, -49, 0, 13, 3, 40)));
l.waitFor(l.addFoe(new Obelisk(300, -49, 0, 13, 3, 40)));
l.waitFor(l.addFoe(new Obelisk(150, -49, 0, 17, 3, 40)));
l.waitFor(l.addFoe(new Obelisk(350, -49, 0, 17, 3, 40)));
l.waitFor(l.addFoe(new Obelisk(200, -49, 0, 21, 3, 40)));
l.waitFor(l.addFoe(new Obelisk(300, -49, 0, 21, 3, 40)));
l.waitFor(l.addFoe(new Obelisk(250, -49, 0, 25, 3, 40)));
};
} else {
if (c > 50){
r = random(10);
if (r == 9){
b = 0;
while (b < 10) {
l.waitFor(l.addFoe(new Shrub(-30, ((Math.random() * 200) + 50), ((Math.random() * 10) + 7), ((Math.random() * 4) - 2), 2, 25)));
l.waitFor(l.addFoe(new Shrub(530, ((Math.random() * 200) + 50), ((-(Math.random()) * 10) - 7), ((Math.random() * 4) - 2), 2, 25)));
b++;
};
};
if (r == 8){
b = 0;
while (b < 4) {
l.waitFor(l.addFoe(new FlameGuy(530, ((Math.random() * 500) + 50), (-6 - (Math.random() * 12)), 0, 1, 8)));
b++;
};
l.waitFor(l.addFoe(new Hydra(500, ((Math.random() * 150) + 50), true, (-8 - (Math.random() * 3)), 0, 60)));
l.waitFor(l.addFoe(new Hydra(500, ((Math.random() * 200) + 200), true, (-8 - (Math.random() * 3)), 0, 70)));
l.waitFor(l.addFoe(new Hydra(500, ((Math.random() * 150) + 400), true, (-8 - (Math.random() * 3)), 0, 60)));
};
if (r == 7){
b = 0;
while (b < 4) {
l.waitFor(l.addFoe(new FireGuy(-30, ((Math.random() * 500) + 50), (6 + (Math.random() * 12)), 0, 1, 14)));
b++;
};
l.waitFor(l.addFoe(new Hydra(0, ((Math.random() * 150) + 50), false, (8 + (Math.random() * 3)), 0, 60)));
l.waitFor(l.addFoe(new Hydra(0, ((Math.random() * 200) + 200), false, (8 + (Math.random() * 3)), 0, 70)));
l.waitFor(l.addFoe(new Hydra(0, ((Math.random() * 150) + 400), false, (8 + (Math.random() * 3)), 0, 60)));
};
if (r == 6){
l.waitFor(l.addFoe(new Hydra(0, (((l.player.y * 5) / 6) + 50), false, (8 + (Math.random() * 3)), 0, 50)));
l.waitFor(l.addFoe(new Hydra(500, (((l.player.y * 5) / 6) - 50), true, (-8 - (Math.random() * 3)), 0, 50)));
l.waitFor(l.addFoe(new Hydra(0, ((((l.player.y * 5) / 6) - 200) % 600), false, (8 + (Math.random() * 3)), 0, 50)));
l.waitFor(l.addFoe(new Hydra(500, ((((l.player.y * 5) / 6) + 200) % 600), true, (-8 - (Math.random() * 3)), 0, 50)));
};
if (r == 5){
l.waitFor(l.addFoe(new HugeRock(250, -40, 0, 16, 3, 4)));
l.waitFor(l.addFoe(new HugeRock(90, -40, 0, 15, 3, 4)));
l.waitFor(l.addFoe(new HugeRock(410, -40, 0, 14, 3, 4)));
l.waitFor(l.addFoe(new Obelisk(100, -49, 0, 11, 3, 50)));
l.waitFor(l.addFoe(new Obelisk(400, -49, 0, 11, 3, 50)));
l.waitFor(l.addFoe(new DeadCat(200, -49, 0, 11, 3, 8)));
l.waitFor(l.addFoe(new DeadCat(250, -49, 0, 11, 3, 8)));
l.waitFor(l.addFoe(new DeadCat(300, -49, 0, 11, 3, 8)));
l.waitFor(l.addFoe(new Wasp(220, -49, 0, 15, 3, 3)));
l.waitFor(l.addFoe(new Wasp(280, -49, 0, 15, 3, 3)));
};
if (r == 4){
l.waitFor(l.addFoe(new HugeRock(250, -40, 0, 16, 3, 4)));
l.waitFor(l.addFoe(new HugeRock(90, -40, 0, 15, 3, 4)));
l.waitFor(l.addFoe(new HugeRock(410, -40, 0, 14, 3, 4)));
l.waitFor(l.addFoe(new EyeGuy(100, -49, 0, 11, 3, 8)));
l.waitFor(l.addFoe(new EyeGuy(400, -49, 0, 11, 3, 8)));
l.waitFor(l.addFoe(new Slinger(200, -49, 0, 11, 3, 8)));
l.waitFor(l.addFoe(new Slinger(250, -49, 0, 11, 3, 8)));
l.waitFor(l.addFoe(new Slinger(300, -49, 0, 11, 3, 8)));
l.waitFor(l.addFoe(new Mage(220, -49, 0, 15, 3, 40)));
l.waitFor(l.addFoe(new Mage(280, -49, 0, 15, 3, 40)));
};
if (r == 3){
l.waitFor(l.addFoe(new EyeGuy(100, -49, 0, 13, 3, 8)));
l.waitFor(l.addFoe(new EyeGuy(170, -49, 0, 15, 3, 8)));
l.waitFor(l.addFoe(new EyeGuy(250, -49, 0, 10, 3, 8)));
l.waitFor(l.addFoe(new EyeGuy(250, -49, 0, 19, 3, 8)));
l.waitFor(l.addFoe(new EyeGuy(330, -49, 0, 15, 3, 8)));
l.waitFor(l.addFoe(new EyeGuy(400, -49, 0, 13, 3, 8)));
};
if (r == 2){
l.waitFor(l.addFoe(new Obelisk(-80, 100, 13, 0, 1, 120))).t = 0;
l.waitFor(l.addFoe(new Obelisk(580, 100, -13, 0, 1, 120))).t = 30;
l.waitFor(l.addFoe(new Obelisk(-80, 500, 13, 0, 1, 120))).t = 60;
l.waitFor(l.addFoe(new Obelisk(580, 500, -13, 0, 1, 120))).t = 90;
};
if (r == 1){
l.waitFor(l.addFoe(new Golem(250, -100, 0, 16, 3, 30)));
b = 0;
while (b < 7) {
l.waitFor(l.addFoe(new BigRock(250, -40, ((Math.random() * 8) - 4), ((Math.random() * 4) + 2), 0, 4)));
l.waitFor(l.addFoe(new SmallRock(250, -40, ((Math.random() * 8) - 4), ((Math.random() * 4) + 2), 0, 4)));
l.waitFor(l.addFoe(new MediumRock(250, -40, ((Math.random() * 8) - 4), ((Math.random() * 4) + 2), 0, 4)));
b++;
};
};
if (r == 0){
l.waitFor(l.addFoe(new EyeGuy(150, -49, 0, 11, 3, 10)));
l.waitFor(l.addFoe(new EyeGuy(150, -49, 0, 18, 3, 10)));
l.waitFor(l.addFoe(new EyeGuy(350, -49, 0, 11, 3, 10)));
l.waitFor(l.addFoe(new EyeGuy(350, -49, 0, 18, 3, 10)));
l.waitFor(l.addFoe(new Obelisk(250, -49, 0, 15, 3, 30)));
};
} else {
if (c > 40){
r = random(9);
if (r == 8){
for each (b in [100, 200, 300, 400]) {
l.waitFor(l.addFoe(new Mage((b - 30), -49, 0, 10, 3, 45)));
l.waitFor(l.addFoe(new Slinger((b - 10), -49, 0, 14, 3, 12)));
l.waitFor(l.addFoe(new Cactus((b + 10), -49, 0, 18, 3, 18)));
l.waitFor(l.addFoe(new EyeBall((b + 30), -49, 0, 22, 3, 30)));
};
};
if (r == 7){
l.waitFor(l.addFoe(new HugeRock(((Math.random() * 450) + 25), -90, 0, ((Math.random() * 3) + 3), 0, 4)));
l.waitFor(l.addFoe(new BigRock(((Math.random() * 450) + 25), -40, 0, ((Math.random() * 4) + 2), 0, 4)));
l.waitFor(l.addFoe(new BigRock(((Math.random() * 450) + 25), -40, 0, ((Math.random() * 4) + 3), 0, 4)));
l.waitFor(l.addFoe(new BigRock(((Math.random() * 450) + 25), -40, 0, ((Math.random() * 4) + 3), 0, 4)));
b = 0;
while (b < 7) {
l.waitFor(l.addFoe(new MediumRock(((Math.random() * 450) + 25), -30, 0, ((Math.random() * 11) + 2), 0, 4)));
l.waitFor(l.addFoe(new SmallRock(((Math.random() * 450) + 25), -30, 0, ((Math.random() * 11) + 2), 0, 4)));
l.waitFor(l.addFoe(new TinyRock(((Math.random() * 450) + 25), -30, 0, ((Math.random() * 11) + 2), 0, 4)));
b++;
};
l.waitFor(l.addFoe(new EyeBall(((Math.random() * 450) + 25), -49, 0, 4, 0, 10)));
l.waitFor(l.addFoe(new EyeBall(((Math.random() * 450) + 25), -49, 0, 5, 0, 10)));
l.waitFor(l.addFoe(new EyeBall(((Math.random() * 450) + 25), -49, 0, 6, 0, 10)));
};
if (r == 6){
l.waitFor(l.addFoe(new DeadCat(350, -49, 0, 10, 3, 40)));
l.waitFor(l.addFoe(new DeadCat(350, -49, 0, 15, 3, 40)));
l.waitFor(l.addFoe(new DeadCat(400, -49, 0, 12, 3, 40)));
l.waitFor(l.addFoe(new DeadCat(400, -49, 0, 17, 3, 40)));
l.waitFor(l.addFoe(new DeadCat(100, -49, 0, 12, 3, 40)));
l.waitFor(l.addFoe(new DeadCat(100, -49, 0, 17, 3, 40)));
l.waitFor(l.addFoe(new DeadCat(150, -49, 0, 10, 3, 40)));
l.waitFor(l.addFoe(new DeadCat(150, -49, 0, 15, 3, 40)));
l.waitFor(l.addFoe(new Obelisk(200, -49, 0, 14, 3, 40)));
l.waitFor(l.addFoe(new Obelisk(300, -49, 0, 14, 3, 40)));
l.waitFor(l.addFoe(new Obelisk(250, -49, 0, 18, 3, 40)));
};
if (r == 5){
for each (b in [50, 100, 400, 450]) {
l.waitFor(l.addFoe(new Mage(b, -49, 0, 9, 3, 45)));
l.waitFor(l.addFoe(new Mage(b, -49, 0, 15, 3, 50)));
};
l.waitFor(l.addFoe(new EyeGuy(180, -49, 0, 11, 3, 10))).t = 20;
l.waitFor(l.addFoe(new EyeGuy(320, -49, 0, 11, 3, 10))).t = 20;
};
if (r == 4){
for each (b in [50, 100, 400, 450]) {
l.waitFor(l.addFoe(new Cactus(b, -49, 0, 9, 3, 14)));
l.waitFor(l.addFoe(new Cactus(b, -49, 0, 15, 3, 14)));
};
l.waitFor(l.addFoe(new Tree(200, -49, 0, 11, 3, 30))).t = 20;
l.waitFor(l.addFoe(new Tree(300, -49, 0, 11, 3, 30))).t = 20;
l.waitFor(l.addFoe(new Tree(200, -49, 0, 18, 3, 30)));
l.waitFor(l.addFoe(new Tree(300, -49, 0, 18, 3, 30)));
l.waitFor(l.addFoe(new Mage(250, -49, 0, 23, 3, 45)));
};
if (r == 3){
b = 50;
while (b < 460) {
l.waitFor(l.addFoe(new Cactus((b + 20), -30, 0, 9, 3, 20)));
l.waitFor(l.addFoe(new Slinger((b - 20), -30, 0, (3 + (Math.random() * 2)), 0, 9)));
b = (b + 100);
};
};
if (r == 2){
b = 50;
while (b < 460) {
l.waitFor(l.addFoe(new Slinger((b - 20), -30, 0, 9, 3, 12)));
l.waitFor(l.addFoe(new Bird((b + 20), -30, 0, 15, 3, 12)));
b = (b + 80);
};
};
if (r == 1){
b = 50;
while (b < 460) {
l.waitFor(l.addFoe(new Mage((b - 20), -30, 0, 9, 3, 40)));
l.waitFor(l.addFoe(new Bird((b + 20), -30, 0, 15, 3, 12)));
b = (b + 100);
};
};
if (r == 0){
b = 50;
while (b < 500) {
l.waitFor(l.addFoe(new SeaBomb(b, -40, 0, (2 + (Math.random() * 4)), 0, 30)));
b = (b + 50);
};
};
} else {
if (c > 30){
r = random(10);
if (r == 9){
l.waitFor(l.addFoe(new Shark(0, ((Math.random() * 250) + 50), true, 1)));
l.waitFor(l.addFoe(new Shark(0, ((Math.random() * 250) + 50), false, 2)));
l.waitFor(l.addFoe(new Shark(0, ((Math.random() * 250) + 300), true, 2)));
l.waitFor(l.addFoe(new Shark(0, ((Math.random() * 250) + 300), false, 1)));
};
if (r == 8){
for each (b in [50, 100, 400, 450]) {
l.waitFor(l.addFoe(new GreenJelly(b, -49, 0, 9, 3, 30)));
l.waitFor(l.addFoe(new GreenJelly(b, -49, 0, 15, 3, 30)));
};
l.waitFor(l.addFoe(new Tree(200, -49, 0, 11, 3, 30))).t = 20;
l.waitFor(l.addFoe(new Tree(300, -49, 0, 11, 3, 30))).t = 20;
l.waitFor(l.addFoe(new Tree(200, -49, 0, 18, 3, 30)));
l.waitFor(l.addFoe(new Tree(300, -49, 0, 18, 3, 30)));
};
if (r == 7){
l.waitFor(l.addFoe(new Tree(100, -49, 0, 15, 3, 30))).t = 10;
l.waitFor(l.addFoe(new Tree(200, -49, 0, 11, 3, 30))).t = 20;
l.waitFor(l.addFoe(new Tree(300, -49, 0, 11, 3, 30))).t = 20;
l.waitFor(l.addFoe(new Tree(200, -49, 0, 18, 3, 30)));
l.waitFor(l.addFoe(new Tree(300, -49, 0, 18, 3, 30)));
l.waitFor(l.addFoe(new Tree(400, -49, 0, 15, 3, 30))).t = 10;
};
if (r == 6){
for each (b in [50, 100, 400, 450]) {
l.waitFor(l.addFoe(new EyeBall(b, -49, 0, 9, 3, 30)));
l.waitFor(l.addFoe(new EyeBall(b, -49, 0, 15, 3, 30)));
l.waitFor(l.addFoe(new EyeBall(b, -49, 0, 22, 3, 30)));
};
};
if (r == 5){
b = 0;
while (b < 12) {
l.waitFor(l.addFoe(new EyeBall(((Math.random() * 450) + 25), -30, 0, (6 + (Math.random() * 5)), 0, 5000)));
b++;
};
};
if (r == 4){
l.waitFor(l.addFoe(new PurpleJelly(-30, 100, 19, 0, 1, 40)));
l.waitFor(l.addFoe(new PurpleJelly(530, 100, -19, 0, 1, 40)));
l.waitFor(l.addFoe(new GreenJelly(-30, 150, 15, 0, 1, 40)));
l.waitFor(l.addFoe(new GreenJelly(530, 150, -15, 0, 1, 40)));
l.waitFor(l.addFoe(new BlueJelly(-30, 200, 11, 0, 1, 40)));
l.waitFor(l.addFoe(new BlueJelly(530, 200, -11, 0, 1, 40)));
l.waitFor(l.addFoe(new GreenJelly(-30, 250, 15, 0, 1, 40)));
l.waitFor(l.addFoe(new GreenJelly(530, 250, -15, 0, 1, 40)));
l.waitFor(l.addFoe(new PurpleJelly(-30, 300, 19, 0, 1, 40)));
l.waitFor(l.addFoe(new PurpleJelly(530, 300, -19, 0, 1, 40)));
l.waitFor(l.addFoe(new SeaBomb(530, 200, -18, 0, 1, 40)));
l.waitFor(l.addFoe(new SeaBomb(-30, 200, 18, 0, 1, 40)));
};
if (r == 3){
l.waitFor(l.addFoe(new PurpleJelly(-30, 100, 19, 0, 1, 40)));
l.waitFor(l.addFoe(new PurpleJelly(530, 100, -19, 0, 1, 40)));
l.waitFor(l.addFoe(new PurpleJelly(-30, 150, 15, 0, 1, 40)));
l.waitFor(l.addFoe(new PurpleJelly(530, 150, -15, 0, 1, 40)));
l.waitFor(l.addFoe(new PurpleJelly(-30, 200, 11, 0, 1, 40)));
l.waitFor(l.addFoe(new PurpleJelly(530, 200, -11, 0, 1, 40)));
l.waitFor(l.addFoe(new PurpleJelly(-30, 250, 15, 0, 1, 40)));
l.waitFor(l.addFoe(new PurpleJelly(530, 250, -15, 0, 1, 40)));
l.waitFor(l.addFoe(new PurpleJelly(-30, 300, 19, 0, 1, 40)));
l.waitFor(l.addFoe(new PurpleJelly(530, 300, -19, 0, 1, 40)));
l.waitFor(l.addFoe(new PinkJelly(530, 200, -19, 0, 1, 8)));
l.waitFor(l.addFoe(new PinkJelly(-30, 200, 19, 0, 1, 8)));
};
if (r == 2){
b = 50;
while (b < 460) {
l.waitFor(l.addFoe(new GreenJelly((b - 15), -30, 0, 9, 3, 40)));
l.waitFor(l.addFoe(new PurpleJelly((b + 15), -30, 0, 13, 3, 45)));
b = (b + 80);
};
b = 50;
while (b < 460) {
l.waitFor(l.addFoe(new SeaBomb(b, -40, 0, 19, 3, 20)));
b = (b + 100);
};
};
if (r == 1){
l.waitFor(l.addFoe(new Moor(0, ((Math.random() * 250) + 50), true, 1)));
l.waitFor(l.addFoe(new Moor(0, ((Math.random() * 250) + 300), true, 1)));
l.waitFor(l.addFoe(new Moor(0, ((Math.random() * 250) + 50), false, 1)));
l.waitFor(l.addFoe(new Moor(0, ((Math.random() * 250) + 300), false, 1)));
};
if (r == 0){
b = 50;
while (b < 460) {
l.waitFor(l.addFoe(new BlueJelly((b - 15), -30, 0, 9, 3, 40)));
l.waitFor(l.addFoe(new PurpleJelly(b, -30, 0, 13, 3, 45)));
l.waitFor(l.addFoe(new PinkJelly((b + 15), -30, 0, 17, 3, 16)));
b = (b + 80);
};
};
} else {
if (c > 20){
r = random(10);
if (r == 9){
l.waitFor(l.addFoe(new Shark(0, ((l.player.y + 100) % 600), true, 1)));
l.waitFor(l.addFoe(new Shark(0, ((l.player.y - 100) % 600), false, 1)));
};
if (r == 8){
b = 100;
while (b < 450) {
l.waitFor(l.addFoe(new SpikeFish(b, -40, 0, (1 + (Math.random() * 2)), 0, 30)));
l.waitFor(l.addFoe(new BlueJelly(((Math.random() * 400) + 50), -40, 0, (2 + (Math.random() * 3)), 0, 25)));
b = (b + 50);
};
};
if (r == 7){
b = 50;
while (b < 460) {
l.waitFor(l.addFoe(new BlueJelly((b - 15), -30, 0, 9, 3, 40)));
l.waitFor(l.addFoe(new YellowJelly((b + 15), -30, 0, 13, 3, 40)));
b = (b + 80);
};
};
if (r == 6){
b = 50;
while (b < 460) {
l.waitFor(l.addFoe(new PurpleJelly((b - 15), -30, 0, 9, 3, 45)));
l.waitFor(l.addFoe(new PinkJelly((b + 15), -30, 0, 13, 3, 12)));
b = (b + 80);
};
};
if (r == 5){
b = 50;
while (b < 500) {
l.waitFor(l.addFoe(new Butterfly(b, -40, 0, (9 + (Math.random() * 12)), 3, 30)));
b = (b + 50);
};
l.waitFor(l.addFoe(new Wasp(((Math.random() * 300) + 100), -40, 0, (9 + (Math.random() * 12)), 3, 2)));
l.waitFor(l.addFoe(new Wasp(((Math.random() * 300) + 100), -40, 0, (9 + (Math.random() * 12)), 3, 2)));
};
if (r == 4){
a = 0;
while (a < 3) {
l.waitFor(l.addFoe(new BlueJelly(530, (80 + (a * 80)), (-10 + (a * 1)), 0, 1, 50)));
l.waitFor(l.addFoe(new BlueJelly(-30, (80 + (a * 80)), (10 - (a * 1)), 0, 1, 50)));
l.waitFor(l.addFoe(new BlueJelly(530, (110 + (a * 80)), (-13 + (a * 1)), 0, 1, 50)));
l.waitFor(l.addFoe(new BlueJelly(-30, (110 + (a * 80)), (13 - (a * 1)), 0, 1, 50)));
a++;
};
l.waitFor(l.addFoe(new SpikeFish(530, 400, -10, 0, 1, 40)));
l.waitFor(l.addFoe(new SpikeFish(-30, 400, 10, 0, 1, 40)));
};
if (r == 3){
a = 0;
while (a < 3) {
l.waitFor(l.addFoe(new PurpleJelly(530, (80 + (a * 80)), (-10 + (a * 1)), 0, 1, 60)));
l.waitFor(l.addFoe(new PurpleJelly(-30, (80 + (a * 80)), (10 - (a * 1)), 0, 1, 60)));
l.waitFor(l.addFoe(new PurpleJelly(530, (110 + (a * 80)), (-13 + (a * 1)), 0, 1, 60)));
l.waitFor(l.addFoe(new PurpleJelly(-30, (110 + (a * 80)), (13 - (a * 1)), 0, 1, 60)));
a++;
};
l.waitFor(l.addFoe(new SeaBomb(400, -40, 0, 29, 3, 40)));
l.waitFor(l.addFoe(new SeaBomb(100, -40, 0, 29, 3, 40)));
};
if (r == 2){
while (a < 6) {
l.waitFor(l.addFoe(new YellowJelly(530, (50 + (a * 80)), (-15 + (a * 2)), 0, 2, 35)));
l.waitFor(l.addFoe(new GreenJelly(-30, (50 + (a * 80)), (15 - (a * 2)), 0, 2, 3)));
a++;
};
};
if (r == 1){
l.waitFor(l.addFoe(new BossBush(150, -49, 0, 14, 3, 30)));
l.waitFor(l.addFoe(new BossBush(350, -49, 0, 14, 3, 30)));
};
if (r == 0){
while (a < 5) {
l.waitFor(l.addFoe(new PurpleJelly(530, (80 + (a * 80)), (-13 + (a * 2)), 0, 2, 40)));
l.waitFor(l.addFoe(new PurpleJelly(-30, (80 + (a * 80)), (13 - (a * 2)), 0, 2, 40)));
a++;
};
};
} else {
if (c > 10){
r = random(10);
if (r == 9){
a = 0;
while (a < 3) {
l.waitFor(l.addFoe(new GreenJelly(530, (80 + (a * 80)), (-10 + (a * 1)), 0, 1, 12)));
l.waitFor(l.addFoe(new GreenJelly(-30, (80 + (a * 80)), (10 - (a * 1)), 0, 1, 12)));
l.waitFor(l.addFoe(new Bush(530, (110 + (a * 80)), (-13 + (a * 1)), 0, 1, 30)));
l.waitFor(l.addFoe(new Bush(-30, (110 + (a * 80)), (13 - (a * 1)), 0, 1, 30)));
a++;
};
};
if (r == 8){
a = 0;
while (a < 3) {
l.waitFor(l.addFoe(new GreenJelly(530, (110 + (a * 80)), (-13 + (a * 1)), 0, 1, 15)));
l.waitFor(l.addFoe(new GreenJelly(-30, (110 + (a * 80)), (13 - (a * 1)), 0, 1, 15)));
l.waitFor(l.addFoe(new YellowJelly(530, (80 + (a * 80)), (-10 + (a * 1)), 0, 1, 40)));
l.waitFor(l.addFoe(new YellowJelly(-30, (80 + (a * 80)), (10 - (a * 1)), 0, 1, 40)));
a++;
};
};
if (r == 7){
while (a < 5) {
l.waitFor(l.addFoe(new PinkJelly(530, (80 + (a * 80)), (-13 + (a * 2)), 0, 2, 12)));
l.waitFor(l.addFoe(new PinkJelly(-30, (80 + (a * 80)), (13 - (a * 2)), 0, 2, 12)));
a++;
};
};
if (r == 6){
while (a < 5) {
l.waitFor(l.addFoe(new BlueJelly(530, (80 + (a * 80)), (-13 + (a * 2)), 0, 2, 25)));
l.waitFor(l.addFoe(new BlueJelly(-30, (80 + (a * 80)), (13 - (a * 2)), 0, 2, 25)));
a++;
};
};
if (r == 5){
b = 50;
while (b < 500) {
l.waitFor(l.addFoe(new Shroom(b, -40, 0, (2 + (Math.random() * 3)), 0, 7)));
b = (b + 100);
};
b = 100;
while (b < 500) {
l.waitFor(l.addFoe(new BigBush(b, -40, 0, (2 + (Math.random() * 3)), 0, 4)));
b = (b + 100);
};
};
if (r == 4){
b = 100;
while (b < 350) {
l.waitFor(l.addFoe(new BigBush(540, b, (-2 - (Math.random() * 3)), 0, 0, 5)));
l.waitFor(l.addFoe(new BigBush(-40, b, (2 + (Math.random() * 3)), 0, 0, 5)));
l.waitFor(l.addFoe(new Wasp(540, (b - 50), (-1 - (Math.random() * 2)), 0, 0, 5)));
l.waitFor(l.addFoe(new Wasp(-40, (b - 50), (1 + (Math.random() * 2)), 0, 0, 5)));
b = (b + 100);
};
};
if (r == 3){
b = 100;
while (b < 350) {
l.waitFor(l.addFoe(new BigBush(540, b, (-2 - (Math.random() * 3)), 0, 0, 3)));
l.waitFor(l.addFoe(new BigBush(-40, b, (2 + (Math.random() * 3)), 0, 0, 3)));
b = (b + 50);
};
};
if (r == 2){
b = 50;
while (b < 500) {
l.waitFor(l.addFoe(new Wasp(((Math.random() * 300) + 100), -40, 0, (9 + (Math.random() * 12)), 3, 2)));
b = (b + 100);
};
};
if (r == 1){
b = 50;
while (b < 500) {
l.waitFor(l.addFoe(new Butterfly(b, -40, 0, (9 + (Math.random() * 12)), 3, 40)));
b = (b + 50);
};
};
if (r == 0){
l.waitFor(l.addFoe(new Bush(100, -49, 0, 13, 3, 15)));
l.waitFor(l.addFoe(new Bush(150, -49, 0, 15, 3, 15)));
l.waitFor(l.addFoe(new BossBush(250, -49, 0, 14, 3, 30)));
l.waitFor(l.addFoe(new Bush(350, -49, 0, 15, 3, 15)));
l.waitFor(l.addFoe(new Bush(400, -49, 0, 13, 3, 15)));
};
} else {
r = random(10);
if (r == 9){
l.waitFor(l.addFoe(new Butterfly(540, 200, -14, 0, 1, 40)));
l.waitFor(l.addFoe(new Butterfly(-40, 200, 14, 0, 1, 40)));
l.waitFor(l.addFoe(new Butterfly(540, 140, -30, 0, 1, 40)));
l.waitFor(l.addFoe(new Butterfly(-40, 140, 30, 0, 1, 40)));
};
if (r == 8){
l.waitFor(l.addFoe(new BigBush(540, 200, -14, 0, 1, 3)));
l.waitFor(l.addFoe(new BigBush(-40, 200, 14, 0, 1, 3)));
l.waitFor(l.addFoe(new BigBush(540, 250, -16, 0, 1, 3)));
l.waitFor(l.addFoe(new BigBush(-40, 250, 16, 0, 1, 3)));
};
if (r == 7){
l.waitFor(l.addFoe(new BigBush(100, -49, 0, 13, 3, 3)));
l.waitFor(l.addFoe(new BigBush(400, -49, 0, 13, 3, 3)));
b = 150;
while (b <= 350) {
l.waitFor(l.addFoe(new Bush(b, -40, 0, (2 + (Math.random() * 3)), 0, 18)));
b = (b + 50);
};
};
if (r == 6){
b = 50;
while (b < 500) {
l.waitFor(l.addFoe(new Shroom(b, -40, 0, (2 + (Math.random() * 3)), 0, 6)));
b = (b + 100);
};
b = 100;
while (b < 500) {
l.waitFor(l.addFoe(new Bush(b, -40, 0, (2 + (Math.random() * 3)), 0, 18)));
b = (b + 100);
};
};
if (r == 5){
b = 50;
while (b < 500) {
l.waitFor(l.addFoe(new Shroom(b, -40, 0, (2 + (Math.random() * 3)), 0, 6)));
b = (b + 50);
};
};
if (r == 4){
l.waitFor(l.addFoe(new CatRam(250, -49, 0, 3, 0, 30)));
l.waitFor(l.addFoe(new Bush(50, -49, 0, 2, 0, 25)));
l.waitFor(l.addFoe(new Bush(100, -49, 0, 3, 0, 25)));
l.waitFor(l.addFoe(new Bush(150, -49, 0, 4, 0, 25)));
l.waitFor(l.addFoe(new Bush(200, -49, 0, 5, 0, 25)));
l.waitFor(l.addFoe(new Bush(250, -49, 0, 6, 0, 25)));
l.waitFor(l.addFoe(new Bush(300, -49, 0, 5, 0, 25)));
l.waitFor(l.addFoe(new Bush(350, -49, 0, 4, 0, 25)));
l.waitFor(l.addFoe(new Bush(400, -49, 0, 3, 0, 25)));
l.waitFor(l.addFoe(new Bush(450, -49, 0, 2, 0, 25)));
};
if (r == 3){
for each (b in [50, 100, 400, 450]) {
l.waitFor(l.addFoe(new Bush(b, -49, 0, 9, 3, 25)));
l.waitFor(l.addFoe(new Bush(b, -49, 0, 12, 3, 25)));
l.waitFor(l.addFoe(new Bush(b, -49, 0, 16, 3, 25)));
};
};
if (r == 2){
l.waitFor(l.addFoe(new BigLog(100, -49, 0, 8, 3, 30)));
l.waitFor(l.addFoe(new Bush(150, -49, 0, 9, 3, 15)));
l.waitFor(l.addFoe(new Bush(150, -49, 0, 12, 3, 15)));
l.waitFor(l.addFoe(new BigLog(200, -49, 0, 8, 3, 30)));
l.waitFor(l.addFoe(new BigBush(250, -49, 0, 13, 3, 3)));
l.waitFor(l.addFoe(new BigLog(300, -49, 0, 8, 3, 30)));
l.waitFor(l.addFoe(new Bush(350, -49, 0, 12, 3, 15)));
l.waitFor(l.addFoe(new Bush(350, -49, 0, 9, 3, 15)));
l.waitFor(l.addFoe(new BigLog(400, -49, 0, 8, 3, 30)));
};
if (r == 1){
l.waitFor(l.addFoe(new BigLog(100, -49, 0, 9, 3, 30)));
l.waitFor(l.addFoe(new CatRam(150, -49, 0, 11, 3, 30)));
l.waitFor(l.addFoe(new BigLog(200, -49, 0, 11, 3, 30)));
l.waitFor(l.addFoe(new CatRam(250, -49, 0, 13, 3, 30)));
l.waitFor(l.addFoe(new BigLog(300, -49, 0, 11, 3, 30)));
l.waitFor(l.addFoe(new CatRam(350, -49, 0, 11, 3, 30)));
l.waitFor(l.addFoe(new BigLog(400, -49, 0, 9, 3, 30)));
l.waitFor(l.addFoe(new Kitten(200, -49, 0, 9, 3, 30)));
l.waitFor(l.addFoe(new Kitten(300, -49, 0, 9, 3, 30)));
};
if (r == 0){
l.waitFor(l.addFoe(new CatRam(100, -49, 0, 4, 0, 30)));
l.waitFor(l.addFoe(new CatRam(200, -49, 0, 4, 0, 30)));
l.waitFor(l.addFoe(new CatRam(300, -49, 0, 4, 0, 30)));
l.waitFor(l.addFoe(new CatRam(400, -49, 0, 4, 0, 30)));
};
};
};
};
};
};
};
};
};
}
override public function spawn(t:Number){
var c:Number;
if ((t % 5) == 0){
waveTimer = 0;
waveCount++;
if ((((waveCount == 33)) && ((l.foesKilled == 0)))){
Medals.unlockMedal("Pacifism");
};
if ((waveCount % 10) == 0){
l.addItem(new Heart(250, -10));
};
trace(("Wave " + waveCount));
c = (((waveCount * 0.8) + (Math.random() * 6)) - 3);
if ((((c > 80)) && ((Math.random() > 0.8)))){
c = (c - 10);
};
waves(c);
l.bottomBar.hits.text = waveCount;
};
}
}
}//package levels
Section 153
//Level3 (levels.Level3)
package levels {
import foes.*;
import bullets.*;
public class Level3 extends Levels {
public function Level3(l:Level){
super(l);
}
function makeBushWall(yspeed:Number){
var b:Number;
b = 0;
while (b < 7) {
l.waitFor(l.addFoe(new Bush((100 + (b * 50)), -30, 0, yspeed, 3, 20)));
b++;
};
}
function makeLogWall(){
var b:Number;
b = 0;
while (b < 9) {
l.addFoe(new BigLog((50 + (b * 50)), -30, 0, 6, 0, 30));
b++;
};
}
function makeBush2(){
l.addFoe(new Bush(-30, -30, ((Math.random() * 5) + 8), ((Math.random() * 5) + 5), 2, 30));
}
function makeBush3(){
l.addFoe(new Bush(530, -30, ((-(Math.random()) * 5) - 8), ((Math.random() * 5) + 5), 2, 30));
}
function makeBigBush(x:Number){
l.addFoe(new BigBush(x, -49, 0, 4, 0, 3));
}
function makeBigBush2(x:Number){
makeBigBush(x);
makeBigBush((500 - x));
}
function makeLog(x:Number){
l.addFoe(new BigLog(x, -30, 0, 4, 0, 30));
}
function makeSlime(){
l.addFoe(new GreenSlime(((Math.random() * 450) + 25), -30, 0, 5, 0, 0));
}
override public function spawn(t:Number){
if (((((t % 13) == 0)) && ((t < 230)))){
makeBush2();
makeBush3();
};
if (((((((t % 15) == 0)) && ((t > 900)))) && ((t < 1020)))){
l.addFoe(new Kitten(-30, 300, 4, 0, 0, 0));
l.addFoe(new Kitten(530, 200, -4, 0, 0, 0));
};
if (((((((t % 6) == 0)) && ((t > 1050)))) && ((t < 1200)))){
makeSlime();
};
if (((((((t % 12) == 0)) && ((t > 870)))) && ((t < 1000)))){
};
if (((((((t % 16) == 0)) && ((t > 1100)))) && ((t < 1220)))){
};
switch (t){
case 300:
makeBushWall(11);
break;
case 330:
makeBushWall(9);
makeBushWall(13);
break;
case 350:
makeLogWall();
break;
case 370:
makeBigBush2(100);
break;
case 480:
makeBigBush2(200);
break;
case 550:
makeLogWall();
break;
case 630:
makeBushWall(9);
makeBushWall(13);
makeBushWall(16);
break;
case 640:
makeBigBush2(100);
break;
case 700:
makeBigBush2(200);
break;
case 730:
makeTank(250).drop = "heart";
break;
case 790:
makeTank(100);
makeTank(400);
break;
case 1300:
l.waitFor(l.addFoe(new BigBush(-30, 100, 12, 0, 1, 3)));
l.waitFor(l.addFoe(new BigBush(-30, 200, 14, 0, 1, 3)));
l.waitFor(l.addFoe(new BigBush(-30, 300, 16, 0, 1, 3)));
break;
case 1360:
l.waitFor(l.addFoe(new BigBush(530, 100, -12, 0, 1, 3)));
l.waitFor(l.addFoe(new BigBush(530, 200, -14, 0, 1, 3)));
l.waitFor(l.addFoe(new BigBush(530, 300, -16, 0, 1, 3)));
break;
case 1450:
l.waitFor(l.addFoe(new BossBush(250, -45, 0, 13, 3, 0)));
l.waitFor(l.addFoe(new BigBush(100, -40, 0, 15, 3, 3))).drop = "heart";
l.waitFor(l.addFoe(new BigBush(400, -40, 0, 15, 3, 3))).drop = "shield";
break;
case 1650:
l.winLevel();
};
}
function makeBush(x:Number){
l.addFoe(new Bush(x, -49, 0, 4, 0, 30));
}
function makeTank(x:Number){
return (l.addFoe(new CatRam(x, -49, 0, 4, 0, 30)));
}
}
}//package levels
Section 154
//Level4 (levels.Level4)
package levels {
import foes.*;
public class Level4 extends Levels {
public function Level4(l:Level){
super(l);
}
function makeBushWall(yspeed:Number){
var b:Number;
b = 0;
while (b < 7) {
l.addFoe(new Bush((100 + (b * 50)), -30, 0, yspeed, 0, 20));
b++;
};
}
function makeLogWall(){
var b:Number;
b = 0;
while (b < 9) {
l.addFoe(new BigLog((50 + (b * 50)), -30, 0, 6, 0, 30));
b++;
};
}
function makeBush2(){
l.addFoe(new Bush(-30, -30, ((Math.random() * 5) + 8), ((Math.random() * 5) + 5), 2, 30));
}
function makeBush3(){
l.addFoe(new Bush(530, -30, ((-(Math.random()) * 5) - 8), ((Math.random() * 5) + 5), 2, 30));
}
function makeBigBush(x:Number){
l.addFoe(new BigBush(x, -49, 0, 4, 0, 4));
}
function makeBigBush2(x:Number){
makeBigBush(x);
makeBigBush((500 - x));
}
function makeLog(x:Number){
l.addFoe(new BigLog(x, -30, 0, 4, 0, 30));
}
function makeSlime(){
l.addFoe(new GreenSlime(((Math.random() * 450) + 25), -30, 0, 5, 0, 0));
}
override public function spawn(t:Number){
if (((((((t % 13) == 0)) && ((t > 30)))) && ((t < 180)))){
l.addFoe(new Shroom(((Math.random() * 450) + 25), -30, 0, 5, 0, 4));
};
if (((((((t % 12) == 0)) && ((t > 500)))) && ((t < 620)))){
l.addFoe(new Shroom(530, ((Math.random() * 550) + 25), -5, 0, 0, 4));
};
if (((((((t % 12) == 0)) && ((t > 620)))) && ((t < 740)))){
l.addFoe(new Shroom(-30, ((Math.random() * 550) + 25), 5, 0, 0, 4));
};
if (((((((t % 12) == 0)) && ((t > 740)))) && ((t < 860)))){
l.addFoe(new Shroom(((Math.random() * 450) + 25), 630, 0, -5, 0, 4));
};
if (((((((t % 23) == 0)) && ((t > 1170)))) && ((t < 1400)))){
l.addFoe(new Butterfly(((Math.random() * 450) + 25), -30, 0, 5, 0, 40));
};
switch (t){
case 260:
makeBigBush2(100);
break;
case 300:
makeBigBush2(200);
break;
case 370:
makeBushWall(5);
break;
case 400:
makeBushWall(5);
break;
case 430:
makeBushWall(5);
break;
case 950:
makeBigBush2(70);
break;
case 980:
makeBigBush2(140);
break;
case 1010:
makeBigBush2(210);
break;
case 1040:
makeBigBush2(140);
break;
case 1070:
makeBigBush2(70);
break;
case 1560:
l.winLevel();
break;
};
}
function makeBush(x:Number){
l.addFoe(new Bush(x, -49, 0, 4, 0, 30));
}
function makeTank(x:Number){
l.addFoe(new CatRam(x, -49, 0, 4, 0, 30));
}
}
}//package levels
Section 155
//Level5 (levels.Level5)
package levels {
import foes.*;
public class Level5 extends Levels {
public function Level5(l:Level){
super(l);
}
function makeBushWall(yspeed:Number){
var b:Number;
b = 0;
while (b < 7) {
l.addFoe(new Bush((100 + (b * 50)), -30, 0, yspeed, 0, 20));
b++;
};
}
function makeLogWall(){
var b:Number;
b = 0;
while (b < 9) {
l.addFoe(new BigLog((50 + (b * 50)), -30, 0, 6, 0, 30));
b++;
};
}
function makeBush2(){
l.addFoe(new Bush(-30, -30, ((Math.random() * 5) + 8), ((Math.random() * 5) + 5), 2, 30));
}
function makeBush3(){
l.addFoe(new Bush(530, -30, ((-(Math.random()) * 5) - 8), ((Math.random() * 5) + 5), 2, 30));
}
function makeBigBush(x:Number){
l.addFoe(new BigBush(x, -49, 0, 4, 0, 3));
}
function makeBigBush2(x:Number){
makeBigBush(x);
makeBigBush((500 - x));
}
function makeLog(x:Number){
l.addFoe(new BigLog(x, -30, 0, 4, 0, 30));
}
function makeSlime(){
l.addFoe(new GreenSlime(((Math.random() * 450) + 25), -30, 0, 5, 0, 0));
}
override public function spawn(t:Number){
if (((((t % 12) == 0)) && ((t < 500)))){
l.addFoe(new Kitten(-30, 300, 6, 0, 0, 0));
l.addFoe(new Kitten(530, 250, -6, 0, 0, 0));
};
if (((((t % 16) == 0)) && ((t < 500)))){
l.addFoe(new Bush(-30, 150, 5, 0, 0, 1000));
l.addFoe(new Bush(530, 200, -5, 0, 0, 1000));
};
if (((((t % 21) == 0)) && ((t < 500)))){
l.addFoe(new GreenSlime(-30, 100, 4, 0, 0, 1000));
l.addFoe(new GreenSlime(530, 50, -4, 0, 0, 1000));
};
switch (t){
case 600:
l.waitFor(l.addFoe(new SlimeKing(250, -150, 0, 19, 3, 0)));
BGM.play("bossMusic");
break;
case 720:
l.winLevel();
break;
};
}
function makeBush(x:Number){
l.addFoe(new Bush(x, -49, 0, 4, 0, 30));
}
function makeTank(x:Number){
l.addFoe(new CatRam(x, -49, 0, 4, 0, 30));
}
}
}//package levels
Section 156
//Level6 (levels.Level6)
package levels {
import foes.*;
public class Level6 extends Levels {
public function Level6(l:Level){
super(l);
}
function makeAmbush(){
var a:int;
while (a < 3) {
l.waitFor(l.addFoe(new BlueJelly(530, (110 + (a * 80)), (-13 + (a * 1)), 0, 1, 30)));
l.waitFor(l.addFoe(new BlueJelly(-30, (110 + (a * 80)), (13 - (a * 1)), 0, 1, 30)));
l.waitFor(l.addFoe(new PurpleJelly(530, (80 + (a * 80)), (-10 + (a * 1)), 0, 1, 30)));
l.waitFor(l.addFoe(new PurpleJelly(-30, (80 + (a * 80)), (10 - (a * 1)), 0, 1, 30)));
a++;
};
}
override public function spawn(t:Number){
if (((((t % 30) == 0)) && ((t < 300)))){
l.addFoe(new BlueJelly(-30, 100, 4, 0, 0, 30));
l.addFoe(new BlueJelly(530, 170, -4, 0, 0, 30));
};
if (((((((t % 30) == 0)) && ((t > 330)))) && ((t < 630)))){
l.addFoe(new PurpleJelly(-30, 100, 4, 0, 0, 30));
l.addFoe(new PurpleJelly(530, 170, -4, 0, 0, 30));
};
if (((((((t % 24) == 0)) && ((t > 630)))) && ((t < 930)))){
l.addFoe(new PurpleJelly(-30, 100, 4, 0, 0, 30));
l.addFoe(new PinkJelly(530, 170, -4, 0, 0, 8));
};
if (((((((t % 28) == 0)) && ((t > 1360)))) && ((t < 1960)))){
l.addFoe(new PinkJelly(-30, 60, 4, 0, 0, 10));
l.addFoe(new PinkJelly(530, 120, -4, 0, 0, 10));
};
switch (t){
case 1060:
makeBlueAmbush();
break;
case 1190:
makePurpleAmbush();
break;
case 1320:
makeAmbush();
break;
case 1600:
makeMiniAmbush1();
break;
case 1700:
makeMiniAmbush1();
break;
case 1800:
makeMiniAmbush1();
break;
case 1900:
makeMiniAmbush1();
break;
case 2200:
l.winLevel();
break;
};
}
function makeBlueAmbush(){
var a:int;
while (a < 5) {
l.addFoe(new BlueJelly(530, (80 + (a * 80)), (-13 + (a * 2)), 0, 2, 30));
l.addFoe(new BlueJelly(-30, (80 + (a * 80)), (13 - (a * 2)), 0, 2, 30));
a++;
};
}
function makePurpleAmbush(){
var a:int;
while (a < 5) {
l.addFoe(new PurpleJelly(530, (80 + (a * 80)), (-13 + (a * 2)), 0, 2, 30));
l.addFoe(new PurpleJelly(-30, (80 + (a * 80)), (13 - (a * 2)), 0, 2, 30));
a++;
};
}
function makeMiniAmbush1(){
var a:int;
while (a < 2) {
l.addFoe(new BlueJelly(530, (200 + (a * 60)), (-12 + (a * 2)), 0, 2, 30));
l.addFoe(new BlueJelly(-30, (200 + (a * 60)), (12 - (a * 2)), 0, 2, 30));
a++;
};
}
}
}//package levels
Section 157
//Level7 (levels.Level7)
package levels {
import foes.*;
public class Level7 extends Levels {
public var b:Number;// = 0
public function Level7(l:Level){
b = 0;
super(l);
}
function makeBlueAmbush(){
var a:int;
while (a < 5) {
l.addFoe(new BlueJelly(530, (80 + (a * 80)), (-13 + (a * 2)), 0, 2, 30));
l.addFoe(new BlueJelly(-30, (80 + (a * 80)), (13 - (a * 2)), 0, 2, 30));
a++;
};
}
function makeAmbush(){
var a:int;
a = 0;
while (a < 3) {
l.waitFor(l.addFoe(new GreenJelly(530, (110 + (a * 80)), (-13 + (a * 1)), 0, 1, 3)));
l.waitFor(l.addFoe(new GreenJelly(-30, (110 + (a * 80)), (13 - (a * 1)), 0, 1, 3)));
l.waitFor(l.addFoe(new YellowJelly(530, (80 + (a * 80)), (-10 + (a * 1)), 0, 1, 60)));
l.waitFor(l.addFoe(new YellowJelly(-30, (80 + (a * 80)), (10 - (a * 1)), 0, 1, 60)));
a++;
};
}
function makePurpleAmbush(){
var a:int;
while (a < 5) {
l.addFoe(new PurpleJelly(530, (80 + (a * 80)), (-13 + (a * 2)), 0, 2, 30));
l.addFoe(new PurpleJelly(-30, (80 + (a * 80)), (13 - (a * 2)), 0, 2, 30));
a++;
};
}
function makeAmbush2(){
var a:int;
a = 0;
while (a < 3) {
l.waitFor(l.addFoe(new PinkJelly(530, (110 + (a * 80)), (-16 + (a * 1)), 0, 1, 5)));
l.waitFor(l.addFoe(new PinkJelly(-30, (110 + (a * 80)), (16 - (a * 1)), 0, 1, 5)));
l.waitFor(l.addFoe(new GreenJelly(530, (80 + (a * 80)), (-10 + (a * 1)), 0, 1, 30)));
l.waitFor(l.addFoe(new GreenJelly(-30, (80 + (a * 80)), (10 - (a * 1)), 0, 1, 30)));
a++;
};
}
function makeAmbush3(){
var a:int;
a = 0;
while (a < 3) {
l.waitFor(l.addFoe(new PurpleJelly(530, (110 + (a * 80)), (-13 + (a * 1)), 0, 1, 30)));
l.waitFor(l.addFoe(new PurpleJelly(-30, (110 + (a * 80)), (13 - (a * 1)), 0, 1, 30)));
l.waitFor(l.addFoe(new GreenJelly(530, (80 + (a * 80)), (-10 + (a * 1)), 0, 1, 30)));
l.waitFor(l.addFoe(new GreenJelly(-30, (80 + (a * 80)), (10 - (a * 1)), 0, 1, 30)));
a++;
};
l.waitFor(l.addFoe(new YellowJelly(530, 400, -10, 0, 1, 40))).drop = "heart";
l.waitFor(l.addFoe(new YellowJelly(-30, 400, 10, 0, 1, 40))).drop = "shield";
}
function makeMiniAmbush2(){
l.addFoe(new BlueJelly(530, 100, -11, 0, 0, 3));
l.addFoe(new BlueJelly(-30, 200, 11, 0, 0, 3));
}
function makeMiniAmbush3(){
l.addFoe(new PurpleJelly(530, 100, -12, 0, 0, 3));
l.addFoe(new PurpleJelly(-30, 200, 12, 0, 0, 3));
}
override public function spawn(t:Number){
if (((((t % 25) == 0)) && ((t < 480)))){
l.addFoe(new SpikeFish(((Math.random() * 400) + 50), -40, 0, 4, 0, 30));
};
if (((((((t % 30) == 0)) && ((t > 540)))) && ((t < 840)))){
l.addFoe(new YellowJelly((50 + (b * 20)), -30, 0, 5, 0, 55));
l.addFoe(new YellowJelly((450 - (b * 20)), -30, 0, 5, 0, 55));
b++;
};
if (((((((t % 30) == 0)) && ((t > 900)))) && ((t < 1140)))){
l.addFoe(new GreenJelly((50 + (b * 50)), -30, 0, 5, 0, 3));
l.addFoe(new GreenJelly((450 - (b * 50)), -30, 0, 5, 0, 3));
b++;
};
switch (t){
case 850:
b = 0;
break;
case 1200:
makeAmbush();
break;
case 1290:
makeAmbush2();
break;
case 1360:
makeAmbush3();
break;
case 1440:
makeMiniAmbush1();
break;
case 1460:
makeMiniAmbush1();
break;
case 1480:
makeMiniAmbush1();
break;
case 1570:
makeMiniAmbush2();
break;
case 1600:
makeMiniAmbush2();
break;
case 1690:
makeMiniAmbush3();
break;
case 1720:
makeMiniAmbush3();
break;
case 1820:
l.winLevel();
break;
};
}
function makeMiniAmbush1(){
l.addFoe(new GreenJelly(530, 100, -9, 0, 0, 1));
l.addFoe(new GreenJelly(-30, 200, 9, 0, 0, 1));
}
}
}//package levels
Section 158
//Level8 (levels.Level8)
package levels {
import foes.*;
public class Level8 extends Levels {
public var b:Number;// = 0
public function Level8(l:Level){
b = 0;
super(l);
}
function makeAmbush(){
var a:int;
a = 0;
while (a < 2) {
l.waitFor(l.addFoe(new PinkJelly(530, (110 + (a * 80)), (-13 + (a * 1)), 0, 1, 6)));
l.waitFor(l.addFoe(new PinkJelly(-30, (110 + (a * 80)), (13 - (a * 1)), 0, 1, 6)));
l.waitFor(l.addFoe(new Butterfly(530, (80 + (a * 80)), (-10 + (a * 1)), 0, 1, 30)));
l.waitFor(l.addFoe(new Butterfly(-30, (80 + (a * 80)), (10 - (a * 1)), 0, 1, 30)));
a++;
};
}
function makeAmbush2(){
var a:int;
a = 0;
while (a < 3) {
l.waitFor(l.addFoe(new YellowJelly(530, (110 + (a * 80)), (-13 + (a * 1)), 0, 1, 30)));
l.waitFor(l.addFoe(new YellowJelly(-30, (110 + (a * 80)), (13 - (a * 1)), 0, 1, 30)));
l.waitFor(l.addFoe(new Butterfly(530, (80 + (a * 80)), (-10 + (a * 1)), 0, 1, 30)));
l.waitFor(l.addFoe(new Butterfly(-30, (80 + (a * 80)), (10 - (a * 1)), 0, 1, 30)));
a++;
};
}
function makeAmbush3(){
var a:int;
a = 0;
while (a < 4) {
l.waitFor(l.addFoe(new BlueJelly(530, (110 + (a * 80)), (-16 + (a * 1)), 0, 1, 30)));
l.waitFor(l.addFoe(new GreenJelly(-30, (110 + (a * 80)), (16 - (a * 1)), 0, 1, 5)));
l.waitFor(l.addFoe(new PurpleJelly(530, (80 + (a * 80)), (-10 + (a * 1)), 0, 1, 30)));
l.waitFor(l.addFoe(new YellowJelly(-30, (80 + (a * 80)), (10 - (a * 1)), 0, 1, 30)));
a++;
};
}
function makeAmbush4(){
var a:int;
a = 0;
while (a < 3) {
l.waitFor(l.addFoe(new PurpleJelly(530, (110 + (a * 80)), (-13 + (a * 1)), 0, 1, 30)));
l.waitFor(l.addFoe(new PurpleJelly(-30, (110 + (a * 80)), (13 - (a * 1)), 0, 1, 30)));
l.waitFor(l.addFoe(new GreenJelly(530, (80 + (a * 80)), (-10 + (a * 1)), 0, 1, 30)));
l.waitFor(l.addFoe(new GreenJelly(-30, (80 + (a * 80)), (10 - (a * 1)), 0, 1, 30)));
a++;
};
l.waitFor(l.addFoe(new YellowJelly(530, 400, -10, 0, 1, 40))).drop = "heart";
l.waitFor(l.addFoe(new YellowJelly(-30, 400, 10, 0, 1, 40))).drop = "shield";
}
function makeMiniAmbush2(){
l.addFoe(new BlueJelly(530, 100, -11, 0, 0, 3));
l.addFoe(new BlueJelly(-30, 200, 11, 0, 0, 3));
}
function makeMiniAmbush3(){
l.addFoe(new PurpleJelly(530, 100, -12, 0, 0, 3));
l.addFoe(new PurpleJelly(-30, 200, 12, 0, 0, 3));
}
override public function spawn(t:Number){
if (((((t % 90) == 0)) && ((t < 480)))){
l.addFoe(new SeaBomb(((Math.random() * 400) + 50), -40, 0, 4, 0, 40));
};
if (((((((t % 35) == 0)) && ((t > 540)))) && ((t < 800)))){
l.addFoe(new YellowJelly(((Math.random() * 400) + 50), -30, 0, 5, 0, 40));
l.addFoe(new PurpleJelly(((Math.random() * 400) + 50), -30, 0, 5, 0, 60));
b++;
};
switch (t){
case 900:
makeAmbush();
break;
case 1000:
makeAmbush2();
break;
case 1100:
l.waitFor(l.addFoe(new Coral(250, -50, 0, 14, 3, 50)));
break;
case 1240:
l.winLevel();
break;
};
}
function makeMiniAmbush1(){
l.addFoe(new GreenJelly(530, 100, -9, 0, 0, 1));
l.addFoe(new GreenJelly(-30, 200, 9, 0, 0, 1));
}
}
}//package levels
Section 159
//Level9 (levels.Level9)
package levels {
import foes.*;
import bullets.*;
public class Level9 extends Levels {
public var b:Number;// = 0
public function Level9(l:Level){
b = 0;
super(l);
}
function makeMiniAmbush3(){
l.addFoe(new PurpleJelly(530, 100, -12, 0, 0, 3));
l.addFoe(new PurpleJelly(-30, 200, 12, 0, 0, 3));
}
function makeBlue(x:Number){
l.addFoe(new BlueJelly(x, -40, 0, 5, 0, 5000));
}
function makeAmbush(){
var a:int;
a = 0;
while (a < 5) {
l.waitFor(l.addFoe(new BlueJelly(530, (110 + (a * 80)), (-13 + (a * 1)), 0, 1, 6)));
l.waitFor(l.addFoe(new BlueJelly(-30, (110 + (a * 80)), (13 - (a * 1)), 0, 1, 6)));
l.waitFor(l.addFoe(new BlueJelly(530, (80 + (a * 80)), (-10 + (a * 1)), 0, 1, 30)));
l.waitFor(l.addFoe(new BlueJelly(-30, (80 + (a * 80)), (10 - (a * 1)), 0, 1, 30)));
a++;
};
}
function makePurple(x:Number){
l.addFoe(new PurpleJelly(x, -40, 0, 5, 0, 5000));
}
function makePink(x:Number){
l.addFoe(new PinkJelly(x, -40, 0, 5, 0, 5000));
}
function makeAmbush2(){
var a:int;
a = 0;
while (a < 3) {
l.waitFor(l.addFoe(new YellowJelly(530, (110 + (a * 80)), (-13 + (a * 1)), 0, 1, 30)));
l.waitFor(l.addFoe(new YellowJelly(-30, (110 + (a * 80)), (13 - (a * 1)), 0, 1, 30)));
l.waitFor(l.addFoe(new Butterfly(530, (80 + (a * 80)), (-10 + (a * 1)), 0, 1, 30)));
l.waitFor(l.addFoe(new Butterfly(-30, (80 + (a * 80)), (10 - (a * 1)), 0, 1, 30)));
a++;
};
}
function makeAmbush3(){
var a:int;
a = 0;
while (a < 4) {
l.waitFor(l.addFoe(new BlueJelly(530, (110 + (a * 80)), (-16 + (a * 1)), 0, 1, 30)));
l.waitFor(l.addFoe(new GreenJelly(-30, (110 + (a * 80)), (16 - (a * 1)), 0, 1, 5)));
l.waitFor(l.addFoe(new PurpleJelly(530, (80 + (a * 80)), (-10 + (a * 1)), 0, 1, 30)));
l.waitFor(l.addFoe(new YellowJelly(-30, (80 + (a * 80)), (10 - (a * 1)), 0, 1, 30)));
a++;
};
}
function makeAmbush4(){
var a:int;
a = 0;
while (a < 3) {
l.waitFor(l.addFoe(new PurpleJelly(530, (110 + (a * 80)), (-13 + (a * 1)), 0, 1, 30)));
l.waitFor(l.addFoe(new PurpleJelly(-30, (110 + (a * 80)), (13 - (a * 1)), 0, 1, 30)));
l.waitFor(l.addFoe(new GreenJelly(530, (80 + (a * 80)), (-10 + (a * 1)), 0, 1, 30)));
l.waitFor(l.addFoe(new GreenJelly(-30, (80 + (a * 80)), (10 - (a * 1)), 0, 1, 30)));
a++;
};
l.waitFor(l.addFoe(new YellowJelly(530, 400, -10, 0, 1, 40)));
l.waitFor(l.addFoe(new YellowJelly(-30, 400, 10, 0, 1, 40)));
}
function makeShark(y:Number, left:Boolean){
return (l.addFoe(new Shark(0, y, left, 1)));
}
function makeMiniAmbush2(){
l.addFoe(new BlueJelly(530, 100, -11, 0, 0, 3));
l.addFoe(new BlueJelly(-30, 200, 11, 0, 0, 3));
}
function makeMoor(y:Number, left:Boolean){
l.addFoe(new Moor(0, y, left, 1));
}
override public function spawn(t:Number){
if (((((((t % 25) == 0)) && ((t > 580)))) && ((t < 770)))){
makeBlue(70);
makePurple(140);
makeBlue(430);
makePurple(360);
makePink(290);
makePink(210);
};
if (((((((t % 35) == 0)) && ((t > 1200)))) && ((t < 1650)))){
l.addFoe(new SpikeFish(((Math.random() * 400) + 50), -40, 0, 4, 0, 30));
};
if (((((((t % 16) == 0)) && ((t > 1200)))) && ((t < 1650)))){
l.addFoe(new PurpleJelly(((Math.random() * 400) + 50), -40, 0, 5, 0, 50));
};
if (((((((t % 90) == 0)) && ((t > 1750)))) && ((t < 2100)))){
makeMoor(((Math.random() * 500) + 50), true);
};
if (((((((t % 90) == 45)) && ((t > 1750)))) && ((t < 2100)))){
makeMoor(((Math.random() * 500) + 50), false);
};
switch (t){
case 60:
makeShark(300, true);
break;
case 120:
makeShark(200, false);
break;
case 180:
makeShark(400, true);
break;
case 230:
makeShark(250, false);
break;
case 280:
makeShark(500, true);
break;
case 330:
makeShark(400, false);
break;
case 370:
makeShark(150, true);
break;
case 410:
makeShark(200, false);
break;
case 440:
makeShark(500, true);
break;
case 470:
makeShark(300, false);
break;
case 880:
makeShark(100, false);
makeShark(200, true).drop = "shield";
break;
case 960:
l.addFoe(new SeaBomb(400, -40, 0, 4, 0, 30));
l.addFoe(new SeaBomb(100, -40, 0, 4, 0, 30));
break;
case 1000:
l.addFoe(new SeaBomb(320, -40, 0, 4, 0, 30));
l.addFoe(new SeaBomb(180, -40, 0, 4, 0, 30));
break;
case 1130:
makeShark(100, false).drop = "heart";
makeShark(200, true);
break;
case 2290:
l.winLevel();
break;
};
}
function makeMiniAmbush1(){
l.addFoe(new GreenJelly(530, 100, -9, 0, 0, 1));
l.addFoe(new GreenJelly(-30, 200, 9, 0, 0, 1));
}
}
}//package levels
Section 160
//Levels (levels.Levels)
package levels {
public class Levels {
var l:Level;
public var survival:Boolean;// = false
public function Levels(l:Level){
survival = false;
super();
this.l = l;
}
public function timer(){
}
public function spawn(t:Number){
}
}
}//package levels
Section 161
//backgroundscrolling_375 (main_fla.backgroundscrolling_375)
package main_fla {
import flash.events.*;
import flash.media.*;
import flash.display.*;
import flash.utils.*;
import flash.text.*;
import flash.net.*;
import flash.ui.*;
import flash.system.*;
import flash.geom.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.external.*;
import flash.filters.*;
import flash.printing.*;
import flash.xml.*;
public dynamic class backgroundscrolling_375 extends MovieClip {
public var tiles:MovieClip;
public function backgroundscrolling_375(){
super();
addFrameScript(0, frame1);
}
function frame1(){
if (!Global.vars.options[0]){
stop();
};
}
}
}//package main_fla
Section 162
//backgroundstrips_377 (main_fla.backgroundstrips_377)
package main_fla {
import levels.*;
import flash.display.*;
public dynamic class backgroundstrips_377 extends MovieClip {
public function backgroundstrips_377(){
super();
addFrameScript(0, frame1, 1, frame2, 2, frame3, 3, frame4, 4, frame5, 5, frame6, 6, frame7, 7, frame8);
}
function frame3(){
stop();
gotoAndStop((parent.parent.parent as Level).bg);
}
function frame6(){
stop();
gotoAndStop((parent.parent.parent as Level).bg);
}
function frame7(){
stop();
gotoAndStop((parent.parent.parent as Level).bg);
}
function frame1(){
stop();
gotoAndStop((parent.parent.parent as Level).bg);
}
function frame4(){
stop();
gotoAndStop((parent.parent.parent as Level).bg);
}
function frame5(){
stop();
gotoAndStop((parent.parent.parent as Level).bg);
}
function frame8(){
stop();
gotoAndStop((parent.parent.parent as Level).bg);
}
function frame2(){
stop();
gotoAndStop((parent.parent.parent as Level).bg);
}
}
}//package main_fla
Section 163
//backgroundtiles_376 (main_fla.backgroundtiles_376)
package main_fla {
import flash.display.*;
public dynamic class backgroundtiles_376 extends MovieClip {
public var tile1:MovieClip;
public var tile2:MovieClip;
public var tile3:MovieClip;
public var tile4:MovieClip;
public function backgroundtiles_376(){
super();
addFrameScript(0, frame1, 102, frame103);
}
function frame1(){
stop();
}
function frame103(){
stop();
}
}
}//package main_fla
Section 164
//bottomBar_378 (main_fla.bottomBar_378)
package main_fla {
import flash.events.*;
import flash.display.*;
import foes.*;
import flash.text.*;
import flash.net.*;
public dynamic class bottomBar_378 extends MovieClip {
public var mainChargeBar:MovieClip;
public var hpBar:MovieClip;
public var weaponIcon1:MovieClip;
public var bombs:TextField;
public var weaponIcon2:MovieClip;
public var bossHP:FoeBar;
public var medalBox:MovieClip;
public var subChargeBar:MovieClip;
public var health:TextField;
public var hits:TextField;
public var powah:MovieClip;
public var konglink:SimpleButton;
public var score:TextField;
public var waves:MovieClip;
public var bomb:MovieClip;
public var sub:TextField;
public var main:TextField;
public var multiplier:TextField;
public var bullets:TextField;
public var p0:MovieClip;
public var kills:TextField;
public var fps:TextField;
public var money:TextField;
public function bottomBar_378(){
super();
addFrameScript(0, frame1);
}
function frame1(){
getChildByName("konglink").addEventListener(MouseEvent.CLICK, function (e:Event=null){
navigateToURL(new URLRequest("http://kongregate.com/?gamereferral=bullet-heaven"), "_blank");
});
}
}
}//package main_fla
Section 165
//coral2_102 (main_fla.coral2_102)
package main_fla {
import flash.display.*;
public dynamic class coral2_102 extends MovieClip {
public function coral2_102(){
super();
addFrameScript(0, frame1);
}
function frame1(){
}
}
}//package main_fla
Section 166
//fader_12 (main_fla.fader_12)
package main_fla {
import flash.display.*;
public dynamic class fader_12 extends MovieClip {
public var l:String;
public function fader_12(){
super();
addFrameScript(0, frame1, 7, frame8, 14, frame15);
}
function frame15(){
if (this){
gotoAndStop(1);
};
}
function frame1(){
stop();
}
function frame8(){
MovieClip(root).gotoAndStop(l);
}
}
}//package main_fla
Section 167
//kittenbody_164 (main_fla.kittenbody_164)
package main_fla {
import flash.display.*;
import foes.*;
public dynamic class kittenbody_164 extends MovieClip {
public function kittenbody_164(){
super();
addFrameScript(0, frame1);
}
function frame1(){
gotoAndStop((parent as Foe).kitten);
}
}
}//package main_fla
Section 168
//kittenhead_94 (main_fla.kittenhead_94)
package main_fla {
import flash.display.*;
import foes.*;
public dynamic class kittenhead_94 extends MovieClip {
public function kittenhead_94(){
super();
addFrameScript(0, frame1);
}
function frame1(){
gotoAndStop((parent as Foe).kitten);
}
}
}//package main_fla
Section 169
//Kongintro12fps_41 (main_fla.Kongintro12fps_41)
package main_fla {
import flash.events.*;
import flash.display.*;
import flash.net.*;
public dynamic class Kongintro12fps_41 extends MovieClip {
public var konglink:SimpleButton;
public function Kongintro12fps_41(){
super();
addFrameScript(0, frame1, 90, frame91);
}
function frame91(){
stop();
(root as Main).fadeTo("ads");
}
function frame1(){
getChildByName("konglink").addEventListener(MouseEvent.CLICK, function (e:Event=null){
navigateToURL(new URLRequest("http://kongregate.com/?gamereferral=bullet-heaven"), "_blank");
});
}
}
}//package main_fla
Section 170
//levelDisplay_417 (main_fla.levelDisplay_417)
package main_fla {
import flash.display.*;
import flash.text.*;
public dynamic class levelDisplay_417 extends MovieClip {
public var scoreT:TextField;
public var killsT:TextField;
public var waveT:TextField;
public function levelDisplay_417(){
super();
addFrameScript(0, frame1, 1, frame2, 2, frame3, 3, frame4, 4, frame5, 5, frame6, 6, frame7, 7, frame8, 8, frame9, 9, frame10, 10, frame11, 11, frame12, 12, frame13, 13, frame14, 14, frame15, 15, frame16, 16, frame17, 17, frame18, 18, frame19, 19, frame20, 20, frame21, 21, frame22, 22, frame23, 23, frame24, 24, frame25, 25, frame26, 26, frame27, 27, frame28);
}
function frame10(){
showScore();
}
function frame14(){
showScore();
}
function frame18(){
showScore();
}
function frame12(){
showScore();
}
function frame3(){
showScore();
}
function frame6(){
showScore();
}
function frame7(){
showScore();
}
function frame1(){
gotoAndStop((root as Main).selectedLevel);
showScore();
}
function frame19(){
showScore();
}
function frame25(){
showScore();
waveT.text = ("Best Wave: " + (root as Main).survivalWaves);
killsT.text = ("Most Kills: " + (root as Main).survivalKills);
}
function frame13(){
showScore();
}
function frame17(){
showScore();
}
function frame4(){
showScore();
}
function frame5(){
showScore();
}
function frame22(){
showScore();
}
function frame16(){
showScore();
}
function frame8(){
showScore();
}
function frame9(){
showScore();
}
function frame2(){
showScore();
}
function frame15(){
showScore();
}
function frame23(){
showScore();
}
function frame24(){
showScore();
}
public function showScore(){
scoreT.text = ("High Score: " + (root as Main).levelScores[currentFrame]);
}
function frame20(){
showScore();
}
function frame21(){
showScore();
}
function frame27(){
showScore();
}
function frame11(){
showScore();
}
function frame28(){
showScore();
}
function frame26(){
showScore();
}
}
}//package main_fla
Section 171
//levelicons_409 (main_fla.levelicons_409)
package main_fla {
import flash.display.*;
public dynamic class levelicons_409 extends MovieClip {
public function levelicons_409(){
super();
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package main_fla
Section 172
//levelstatus_403 (main_fla.levelstatus_403)
package main_fla {
import flash.display.*;
public dynamic class levelstatus_403 extends MovieClip {
public function levelstatus_403(){
super();
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package main_fla
Section 173
//levelunlocked_420 (main_fla.levelunlocked_420)
package main_fla {
import flash.display.*;
public dynamic class levelunlocked_420 extends MovieClip {
public function levelunlocked_420(){
super();
addFrameScript(0, frame1, 1, frame2);
}
function frame1(){
stop();
visible = false;
if ((root as Main).levelUnlock){
(root as Main).selectedLevel = (root as Main).unlockedLevel;
play();
(root as Main).levelUnlock = false;
if ((root as Main).levelScores[(root as Main).selectedLevel] == undefined){
(root as Main).levelScores[(root as Main).selectedLevel] = 0;
};
(root as Main).selectLevel((root as Main).selectedLevel);
};
}
function frame2(){
visible = true;
}
}
}//package main_fla
Section 174
//medalBox_15 (main_fla.medalBox_15)
package main_fla {
import flash.display.*;
public dynamic class medalBox_15 extends MovieClip {
public var icon:MedalIcon;
public function medalBox_15(){
super();
addFrameScript(0, frame1);
}
function frame1(){
icon.icon.gotoAndStop(Medals.current);
}
}
}//package main_fla
Section 175
//medalBox2_14 (main_fla.medalBox2_14)
package main_fla {
import flash.display.*;
public dynamic class medalBox2_14 extends MovieClip {
public function medalBox2_14(){
super();
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package main_fla
Section 176
//menuselecy_349 (main_fla.menuselecy_349)
package main_fla {
import flash.display.*;
public dynamic class menuselecy_349 extends MovieClip {
public function menuselecy_349(){
super();
addFrameScript(5, frame6);
}
function frame6(){
stop();
}
}
}//package main_fla
Section 177
//playaunlocked_418 (main_fla.playaunlocked_418)
package main_fla {
import flash.display.*;
public dynamic class playaunlocked_418 extends MovieClip {
public function playaunlocked_418(){
super();
addFrameScript(0, frame1, 1, frame2);
}
function frame1(){
stop();
visible = false;
if ((root as Main).playerUnlock){
play();
(root as Main).playerUnlock = false;
};
}
function frame2(){
visible = true;
}
}
}//package main_fla
Section 178
//playerButton_386 (main_fla.playerButton_386)
package main_fla {
import flash.display.*;
public dynamic class playerButton_386 extends MovieClip {
public var icons:MovieClip;
public function playerButton_386(){
super();
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package main_fla
Section 179
//playerIcons_387 (main_fla.playerIcons_387)
package main_fla {
import flash.display.*;
public dynamic class playerIcons_387 extends MovieClip {
public function playerIcons_387(){
super();
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package main_fla
Section 180
//playerPreview_411 (main_fla.playerPreview_411)
package main_fla {
import flash.display.*;
public dynamic class playerPreview_411 extends MovieClip {
public function playerPreview_411(){
super();
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package main_fla
Section 181
//playerpreview2_410 (main_fla.playerpreview2_410)
package main_fla {
import flash.display.*;
public dynamic class playerpreview2_410 extends MovieClip {
public var showPlayer:MovieClip;
public function playerpreview2_410(){
super();
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package main_fla
Section 182
//powah_391 (main_fla.powah_391)
package main_fla {
import flash.display.*;
public dynamic class powah_391 extends MovieClip {
public function powah_391(){
super();
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package main_fla
Section 183
//rankIcon_394 (main_fla.rankIcon_394)
package main_fla {
import flash.display.*;
public dynamic class rankIcon_394 extends MovieClip {
public function rankIcon_394(){
super();
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package main_fla
Section 184
//showlevels_416 (main_fla.showlevels_416)
package main_fla {
import flash.display.*;
public dynamic class showlevels_416 extends MovieClip {
public var showLevel:MovieClip;
public function showlevels_416(){
super();
addFrameScript(0, frame1, 9, frame10);
}
function frame10(){
stop();
}
function frame1(){
stop();
}
}
}//package main_fla
Section 185
//swordLoader_3 (main_fla.swordLoader_3)
package main_fla {
import flash.events.*;
import flash.display.*;
import flash.text.*;
public dynamic class swordLoader_3 extends MovieClip {
public var loaded:Number;
public var bar:MovieClip;
public var percent:TextField;
public var playButton:SimpleButton;
public var loadingComplete:Boolean;
public function swordLoader_3(){
super();
addFrameScript(0, frame1, 14, frame15);
}
public function enterFrameHandler(e:Event=null){
if (!loadingComplete){
if (loaderInfo){
loaded = (loaderInfo.bytesLoaded / loaderInfo.bytesTotal);
};
if (bar){
bar.scaleY = loaded;
percent.text = (("" + int((loaded * 100))) + "%");
};
if (loaded >= 1){
loadingComplete = true;
gotoAndPlay("loaded");
};
};
}
public function playButtonClickHandler(e:Event=null):void{
startMovie();
}
function frame15(){
stop();
if (((playButton) && (!(playButton.hasEventListener(MouseEvent.CLICK))))){
playButton.addEventListener(MouseEvent.CLICK, playButtonClickHandler, false, 0, true);
};
}
function frame1(){
addEventListener(Event.ENTER_FRAME, enterFrameHandler, false, 0, true);
loadingComplete = false;
loaded = 0;
stop();
}
public function startMovie():void{
removeEventListener(Event.ENTER_FRAME, enterFrameHandler);
if (((root) && ((root is MovieClip)))){
MovieClip(root).play();
};
}
}
}//package main_fla
Section 186
//tick1_370 (main_fla.tick1_370)
package main_fla {
import flash.display.*;
public dynamic class tick1_370 extends MovieClip {
public function tick1_370(){
super();
addFrameScript(6, frame7);
}
function frame7(){
stop();
}
}
}//package main_fla
Section 187
//tickBox_368 (main_fla.tickBox_368)
package main_fla {
import flash.display.*;
public dynamic class tickBox_368 extends MovieClip {
public var tick:MovieClip;
public function tickBox_368(){
super();
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package main_fla
Section 188
//ticky_369 (main_fla.ticky_369)
package main_fla {
import flash.display.*;
public dynamic class ticky_369 extends MovieClip {
public function ticky_369(){
super();
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package main_fla
Section 189
//Timeline_19 (main_fla.Timeline_19)
package main_fla {
import flash.events.*;
import flash.display.*;
import flash.net.*;
public dynamic class Timeline_19 extends MovieClip {
public var b2:SimpleButton;
public var b4:SimpleButton;
public var b9:SimpleButton;
public var b5:SimpleButton;
public var b6:SimpleButton;
public var b7:SimpleButton;
public var b1:SimpleButton;
public var b3:SimpleButton;
public var b8:SimpleButton;
public var k:SimpleButton;
public var konglink:SimpleButton;
public function Timeline_19(){
super();
addFrameScript(0, frame1, 1, frame2, 2, frame3, 3, frame4, 4, frame5, 5, frame6, 6, frame7, 7, frame8, 8, frame9, 9, frame10, 10, frame11, 11, frame12, 12, frame13, 13, frame14, 14, frame15, 15, frame16, 16, frame17, 17, frame18, 18, frame19, 19, frame20, 20, frame21);
}
function frame10(){
getChildByName("b8").addEventListener(MouseEvent.CLICK, function (e:Event=null){
navigateToURL(new URLRequest("http://halcyonicfalconx.newgrounds.com/news/post/579117"), "_blank");
});
}
function frame14(){
getChildByName("konglink").addEventListener(MouseEvent.CLICK, function (e:Event=null){
navigateToURL(new URLRequest("http://kongregate.com/?gamereferral=bullet-heaven"), "_blank");
});
}
function frame18(){
getChildByName("k").addEventListener(MouseEvent.CLICK, function (e:Event=null){
navigateToURL(new URLRequest("http://www.kongregate.com/shooter-games/?gamereferral=bullet-heaven"), "_blank");
});
}
function frame12(){
getChildByName("b8").addEventListener(MouseEvent.CLICK, function (e:Event=null){
navigateToURL(new URLRequest("http://www.zazzle.com/kupo707*"), "_blank");
});
}
function frame3(){
getChildByName("b3").addEventListener(MouseEvent.CLICK, function (e:Event=null){
navigateToURL(new URLRequest("http://www.kongregate.com/games/kupo707/epic-battle-fantasy-3/?gamereferral=bullet-heaven"), "_blank");
});
}
function frame6(){
getChildByName("b4").addEventListener(MouseEvent.CLICK, function (e:Event=null){
navigateToURL(new URLRequest("http://www.kongregate.com/games/kupo707/mecha-dress-up-game/?gamereferral=bullet-heaven"), "_blank");
});
}
function frame7(){
getChildByName("b6").addEventListener(MouseEvent.CLICK, function (e:Event=null){
navigateToURL(new URLRequest("http://kupo707.deviantart.com/"), "_blank");
});
}
function frame19(){
getChildByName("k").addEventListener(MouseEvent.CLICK, function (e:Event=null){
navigateToURL(new URLRequest("http://www.kongregate.com/shooter-games/?gamereferral=bullet-heaven"), "_blank");
});
}
function frame13(){
getChildByName("konglink").addEventListener(MouseEvent.CLICK, function (e:Event=null){
navigateToURL(new URLRequest("http://kongregate.com/?gamereferral=bullet-heaven"), "_blank");
});
}
function frame17(){
getChildByName("k").addEventListener(MouseEvent.CLICK, function (e:Event=null){
navigateToURL(new URLRequest("http://www.kongregate.com/shooter-games/?gamereferral=bullet-heaven"), "_blank");
});
}
function frame4(){
getChildByName("b3").addEventListener(MouseEvent.CLICK, function (e:Event=null){
navigateToURL(new URLRequest("http://www.kongregate.com/games/kupo707/epic-battle-fantasy-3/?gamereferral=bullet-heaven"), "_blank");
});
}
function frame5(){
getChildByName("b5").addEventListener(MouseEvent.CLICK, function (e:Event=null){
navigateToURL(new URLRequest("http://www.kongregate.com/games/kupo707/the-kitten-game/?gamereferral=bullet-heaven"), "_blank");
});
}
function frame9(){
getChildByName("b9").addEventListener(MouseEvent.CLICK, function (e:Event=null){
navigateToURL(new URLRequest("http://www.facebook.com/pages/Halcyonic-Falcon-X/148298581863486"), "_blank");
});
}
function frame16(){
getChildByName("k").addEventListener(MouseEvent.CLICK, function (e:Event=null){
navigateToURL(new URLRequest("http://www.kongregate.com/shooter-games/?gamereferral=bullet-heaven"), "_blank");
});
}
function frame8(){
getChildByName("b7").addEventListener(MouseEvent.CLICK, function (e:Event=null){
navigateToURL(new URLRequest("http://www.facebook.com/pages/Epic-Battle-Fantasy-3/121491377896263"), "_blank");
});
}
function frame21(){
getChildByName("k").addEventListener(MouseEvent.CLICK, function (e:Event=null){
navigateToURL(new URLRequest("http://www.kongregate.com/shooter-games/?gamereferral=bullet-heaven"), "_blank");
});
}
function frame2(){
getChildByName("b2").addEventListener(MouseEvent.CLICK, function (e:Event=null){
navigateToURL(new URLRequest("http://www.kongregate.com/games/kupo707/epic-battle-fantasy-2/?gamereferral=bullet-heaven"), "_blank");
});
}
function frame15(){
getChildByName("k").addEventListener(MouseEvent.CLICK, function (e:Event=null){
navigateToURL(new URLRequest("http://www.kongregate.com/shooter-games/?gamereferral=bullet-heaven"), "_blank");
});
}
function frame1(){
stop();
gotoAndStop((int((Math.random() * 21)) + 1));
getChildByName("b1").addEventListener(MouseEvent.CLICK, function (e:Event=null){
navigateToURL(new URLRequest("http://www.kongregate.com/games/kupo707/epic-battle-fantasy/?gamereferral=bullet-heaven"), "_blank");
});
}
function frame20(){
getChildByName("k").addEventListener(MouseEvent.CLICK, function (e:Event=null){
navigateToURL(new URLRequest("http://www.kongregate.com/shooter-games/?gamereferral=bullet-heaven"), "_blank");
});
}
function frame11(){
getChildByName("b8").addEventListener(MouseEvent.CLICK, function (e:Event=null){
navigateToURL(new URLRequest("http://halcyonicfalconx.newgrounds.com/news/post/579117"), "_blank");
});
}
}
}//package main_fla
Section 190
//Timeline_284 (main_fla.Timeline_284)
package main_fla {
import flash.display.*;
public dynamic class Timeline_284 extends MovieClip {
public function Timeline_284(){
super();
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package main_fla
Section 191
//Timeline_335 (main_fla.Timeline_335)
package main_fla {
import flash.display.*;
public dynamic class Timeline_335 extends MovieClip {
public function Timeline_335(){
super();
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package main_fla
Section 192
//Timeline_347 (main_fla.Timeline_347)
package main_fla {
import flash.display.*;
public dynamic class Timeline_347 extends MovieClip {
public function Timeline_347(){
super();
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package main_fla
Section 193
//Timeline_406 (main_fla.Timeline_406)
package main_fla {
import flash.display.*;
public dynamic class Timeline_406 extends MovieClip {
public function Timeline_406(){
super();
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package main_fla
Section 194
//Timeline_408 (main_fla.Timeline_408)
package main_fla {
import flash.display.*;
public dynamic class Timeline_408 extends MovieClip {
public var icons:MovieClip;
public function Timeline_408(){
super();
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package main_fla
Section 195
//Timeline_57 (main_fla.Timeline_57)
package main_fla {
import flash.display.*;
public dynamic class Timeline_57 extends MovieClip {
public function Timeline_57(){
super();
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package main_fla
Section 196
//upgradecomplete_422 (main_fla.upgradecomplete_422)
package main_fla {
import flash.display.*;
public dynamic class upgradecomplete_422 extends MovieClip {
public function upgradecomplete_422(){
super();
addFrameScript(0, frame1, 1, frame2);
}
function frame1(){
stop();
visible = false;
}
function frame2(){
visible = true;
}
}
}//package main_fla
Section 197
//waves_388 (main_fla.waves_388)
package main_fla {
import flash.display.*;
public dynamic class waves_388 extends MovieClip {
public function waves_388(){
super();
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package main_fla
Section 198
//weaponIcons_382 (main_fla.weaponIcons_382)
package main_fla {
import flash.display.*;
public dynamic class weaponIcons_382 extends MovieClip {
public function weaponIcons_382(){
super();
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package main_fla
Section 199
//ScoreLabel (misc.ScoreLabel)
package misc {
import flash.events.*;
import flash.display.*;
import flash.text.*;
public class ScoreLabel extends MovieClip {
public var label:TextField;
var score:String;
var time:Number;
public function ScoreLabel(score:Number, combo:Number, x:Number, y:Number){
super();
addFrameScript(0, frame1, 1, frame2, 2, frame3, 3, frame4, 4, frame5);
this.x = x;
this.y = y;
this.score = ("" + score);
if (combo != 1){
this.score = (this.score + ("x" + combo));
};
if (score == -1){
gotoAndStop(6);
time = 30;
} else {
if (score < 300){
gotoAndStop(1);
time = 20;
} else {
if (score < 1000){
gotoAndStop(2);
time = 30;
} else {
if (score < 3000){
gotoAndStop(3);
time = 40;
} else {
if (score < 10000){
gotoAndStop(4);
time = 50;
} else {
gotoAndStop(5);
time = 90;
};
};
};
};
};
addEventListener(Event.ENTER_FRAME, fade);
cacheAsBitmap = true;
}
function frame3(){
label.text = ("" + score);
}
function frame1(){
label.text = ("" + score);
}
function kill(){
removeEventListener(Event.ENTER_FRAME, fade);
if (this){
parent.removeChild(this);
};
}
function frame4(){
label.text = ("" + score);
}
function frame5(){
label.text = ("" + score);
}
function fade(e:Event){
if (time < 20){
cacheAsBitmap = false;
alpha = ((time * 5) / 100);
};
time--;
if (time == 0){
kill();
};
}
function frame2(){
label.text = ("" + score);
}
}
}//package misc
Section 200
//MochiCoins (mochi.as3.MochiCoins)
package mochi.as3 {
public class MochiCoins {
public static const STORE_HIDE:String = "StoreHide";
public static const NO_USER:String = "NoUser";
public static const IO_ERROR:String = "IOError";
public static const ITEM_NEW:String = "ItemNew";
public static const ITEM_OWNED:String = "ItemOwned";
public static const STORE_ITEMS:String = "StoreItems";
public static const ERROR:String = "Error";
public static const STORE_SHOW:String = "StoreShow";
private static var _dispatcher:MochiEventDispatcher = new MochiEventDispatcher();
public static var _inventory:MochiInventory;
public function MochiCoins(){
super();
}
public static function triggerEvent(eventType:String, args:Object):void{
_dispatcher.triggerEvent(eventType, args);
}
public static function removeEventListener(eventType:String, delegate:Function):void{
_dispatcher.removeEventListener(eventType, delegate);
}
public static function addEventListener(eventType:String, delegate:Function):void{
_dispatcher.addEventListener(eventType, delegate);
}
public static function getStoreItems():void{
MochiServices.send("coins_getStoreItems");
}
public static function get inventory():MochiInventory{
return (_inventory);
}
public static function showStore(options:Object=null):void{
MochiServices.setContainer();
MochiServices.bringToTop();
MochiServices.send("coins_showStore", {options:options}, null, null);
}
public static function requestFunding(properties:Object=null):void{
MochiServices.setContainer();
MochiServices.bringToTop();
MochiServices.send("social_requestFunding", properties);
}
public static function showItem(options:Object=null):void{
if (((!(options)) || (!((typeof(options.item) == "string"))))){
trace("ERROR: showItem call must pass an Object with an item key");
return;
};
MochiServices.setContainer();
MochiServices.bringToTop();
MochiServices.send("coins_showItem", {options:options}, null, null);
}
public static function getVersion():String{
return (MochiServices.getVersion());
}
public static function showVideo(options:Object=null):void{
if (((!(options)) || (!((typeof(options.item) == "string"))))){
trace("ERROR: showVideo call must pass an Object with an item key");
return;
};
MochiServices.setContainer();
MochiServices.bringToTop();
MochiServices.send("coins_showVideo", {options:options}, null, null);
}
addEventListener(MochiSocial.LOGGED_IN, function (args:Object):void{
_inventory = new MochiInventory();
});
addEventListener(MochiSocial.LOGGED_OUT, function (args:Object):void{
_inventory = null;
});
}
}//package mochi.as3
Section 201
//MochiDigits (mochi.as3.MochiDigits)
package mochi.as3 {
public final class MochiDigits {
private var Sibling:MochiDigits;
private var Fragment:Number;
private var Encoder:Number;
public function MochiDigits(digit:Number=0, index:uint=0):void{
super();
Encoder = 0;
setValue(digit, index);
}
public function set value(v:Number):void{
setValue(v);
}
public function reencode():void{
var newEncode:uint;
newEncode = int((2147483647 * Math.random()));
Fragment = (Fragment ^ (newEncode ^ Encoder));
Encoder = newEncode;
}
public function toString():String{
var s:String;
s = String.fromCharCode((Fragment ^ Encoder));
if (Sibling != null){
s = (s + Sibling.toString());
};
return (s);
}
public function get value():Number{
return (Number(this.toString()));
}
public function setValue(digit:Number=0, index:uint=0):void{
var s:String;
s = digit.toString();
var _temp1 = index;
index = (index + 1);
Fragment = (s.charCodeAt(_temp1) ^ Encoder);
if (index < s.length){
Sibling = new MochiDigits(digit, index);
} else {
Sibling = null;
};
reencode();
}
public function addValue(inc:Number):void{
value = (value + inc);
}
}
}//package mochi.as3
Section 202
//MochiEventDispatcher (mochi.as3.MochiEventDispatcher)
package mochi.as3 {
public class MochiEventDispatcher {
private var eventTable:Object;
public function MochiEventDispatcher():void{
super();
eventTable = {};
}
public function triggerEvent(event:String, args:Object):void{
var i:Object;
if (eventTable[event] == undefined){
return;
};
for (i in eventTable[event]) {
var _local6 = eventTable[event];
_local6[i](args);
};
}
public function removeEventListener(event:String, delegate:Function):void{
var s:Object;
if (eventTable[event] == undefined){
eventTable[event] = [];
return;
};
for (s in eventTable[event]) {
if (eventTable[event][s] != delegate){
} else {
eventTable[event].splice(Number(s), 1);
};
};
}
public function addEventListener(event:String, delegate:Function):void{
removeEventListener(event, delegate);
eventTable[event].push(delegate);
}
}
}//package mochi.as3
Section 203
//MochiEvents (mochi.as3.MochiEvents)
package mochi.as3 {
import flash.display.*;
public class MochiEvents {
public static const ALIGN_BOTTOM_LEFT:String = "ALIGN_BL";
public static const FORMAT_LONG:String = "LongForm";
public static const ALIGN_BOTTOM:String = "ALIGN_B";
public static const ACHIEVEMENT_RECEIVED:String = "AchievementReceived";
public static const FORMAT_SHORT:String = "ShortForm";
public static const ALIGN_TOP_RIGHT:String = "ALIGN_TR";
public static const ALIGN_BOTTOM_RIGHT:String = "ALIGN_BR";
public static const ALIGN_TOP:String = "ALIGN_T";
public static const ALIGN_LEFT:String = "ALIGN_L";
public static const ALIGN_RIGHT:String = "ALIGN_R";
public static const ALIGN_TOP_LEFT:String = "ALIGN_TL";
public static const ALIGN_CENTER:String = "ALIGN_C";
private static var _dispatcher:MochiEventDispatcher = new MochiEventDispatcher();
private static var gameStart:Number;
private static var levelStart:Number;
public function MochiEvents(){
super();
}
public static function endPlay():void{
MochiServices.send("events_clearRoundID", null, null, null);
}
public static function addEventListener(eventType:String, delegate:Function):void{
_dispatcher.addEventListener(eventType, delegate);
}
public static function trackEvent(tag:String, value=null):void{
MochiServices.send("events_trackEvent", {tag:tag, value:value}, null, null);
}
public static function removeEventListener(eventType:String, delegate:Function):void{
_dispatcher.removeEventListener(eventType, delegate);
}
public static function startSession(achievementID:String):void{
MochiServices.send("events_beginSession", {achievementID:achievementID}, null, null);
}
public static function triggerEvent(eventType:String, args:Object):void{
_dispatcher.triggerEvent(eventType, args);
}
public static function setNotifications(clip:MovieClip, style:Object):void{
var args:Object;
var s:Object;
args = {};
for (s in style) {
args[s] = style[s];
};
args.clip = clip;
MochiServices.send("events_setNotifications", args, null, null);
}
public static function getVersion():String{
return (MochiServices.getVersion());
}
public static function startPlay(tag:String="gameplay"):void{
MochiServices.send("events_setRoundID", {tag:String(tag)}, null, null);
}
}
}//package mochi.as3
Section 204
//MochiInventory (mochi.as3.MochiInventory)
package mochi.as3 {
import flash.events.*;
import flash.utils.*;
public dynamic class MochiInventory extends Proxy {
private var _timer:Timer;
private var _names:Array;
private var _consumableProperties:Object;
private var _syncID:Number;
private var _storeSync:Object;
private var _outstandingID:Number;
private var _syncPending:Boolean;
public static const READY:String = "InvReady";
public static const ERROR:String = "Error";
public static const IO_ERROR:String = "IoError";
private static const KEY_SALT:String = " syncMaint";
public static const WRITTEN:String = "InvWritten";
public static const NOT_READY:String = "InvNotReady";
public static const VALUE_ERROR:String = "InvValueError";
private static const CONSUMER_KEY:String = "MochiConsumables";
private static var _dispatcher:MochiEventDispatcher = new MochiEventDispatcher();
public function MochiInventory():void{
super();
MochiCoins.addEventListener(MochiCoins.ITEM_OWNED, itemOwned);
MochiCoins.addEventListener(MochiCoins.ITEM_NEW, newItems);
MochiSocial.addEventListener(MochiSocial.LOGGED_IN, loggedIn);
MochiSocial.addEventListener(MochiSocial.LOGGED_OUT, loggedOut);
_storeSync = new Object();
_syncPending = false;
_outstandingID = 0;
_syncID = 0;
_timer = new Timer(1000);
_timer.addEventListener(TimerEvent.TIMER, sync);
_timer.start();
if (MochiSocial.loggedIn){
loggedIn();
} else {
loggedOut();
};
}
private function newItems(event:Object):void{
if (!this[(event.id + KEY_SALT)]){
this[(event.id + KEY_SALT)] = 0;
};
if (!this[event.id]){
this[event.id] = 0;
};
this[(event.id + KEY_SALT)] = (this[(event.id + KEY_SALT)] + event.count);
this[event.id] = (this[event.id] + event.count);
if (((event.privateProperties) && (event.privateProperties.consumable))){
if (!this[event.privateProperties.tag]){
this[event.privateProperties.tag] = 0;
};
this[event.privateProperties.tag] = (this[event.privateProperties.tag] + (event.privateProperties.inc * event.count));
};
}
override "http://www.adobe.com/2006/actionscript/flash/proxy"?? function getProperty(name){
if (_consumableProperties == null){
triggerEvent(ERROR, {type:NOT_READY});
return (-1);
};
if (_consumableProperties[name]){
return (MochiDigits(_consumableProperties[name]).value);
};
return (undefined);
}
public function release():void{
MochiCoins.removeEventListener(MochiCoins.ITEM_NEW, newItems);
MochiSocial.removeEventListener(MochiSocial.LOGGED_IN, loggedIn);
MochiSocial.removeEventListener(MochiSocial.LOGGED_OUT, loggedOut);
}
override "http://www.adobe.com/2006/actionscript/flash/proxy"?? function hasProperty(name):Boolean{
if (_consumableProperties == null){
triggerEvent(ERROR, {type:NOT_READY});
return (false);
};
if (_consumableProperties[name] == undefined){
return (false);
};
return (true);
}
override "http://www.adobe.com/2006/actionscript/flash/proxy"?? function nextNameIndex(index:int):int{
return (((index)>=_names.length) ? 0 : (index + 1));
}
override "http://www.adobe.com/2006/actionscript/flash/proxy"?? function setProperty(name, value):void{
var d:MochiDigits;
if (_consumableProperties == null){
triggerEvent(ERROR, {type:NOT_READY});
return;
};
if (!(value is Number)){
triggerEvent(ERROR, {type:VALUE_ERROR, error:"Invalid type", arg:value});
return;
};
if (_consumableProperties[name]){
d = MochiDigits(_consumableProperties[name]);
if (d.value == value){
return;
};
d.value = value;
} else {
_names.push(name);
_consumableProperties[name] = new MochiDigits(value);
};
_syncID++;
}
private function sync(e:Event=null):void{
var output:Object;
var key:String;
if (((_syncPending) || ((_syncID == _outstandingID)))){
return;
};
_outstandingID = _syncID;
output = {};
for (key in _consumableProperties) {
output[key] = MochiDigits(_consumableProperties[key]).value;
};
MochiUserData.put(CONSUMER_KEY, output, putConsumableBag);
_syncPending = true;
}
override "http://www.adobe.com/2006/actionscript/flash/proxy"?? function nextName(index:int):String{
return (_names[(index - 1)]);
}
private function loggedIn(args:Object=null):void{
MochiUserData.get(CONSUMER_KEY, getConsumableBag);
}
override "http://www.adobe.com/2006/actionscript/flash/proxy"?? function deleteProperty(name):Boolean{
if (!_consumableProperties[name]){
return (false);
};
_names.splice(_names.indexOf(name), 1);
delete _consumableProperties[name];
return (true);
}
private function itemOwned(event:Object):void{
_storeSync[event.id] = {properties:event.properties, count:event.count};
}
private function putConsumableBag(userData:MochiUserData):void{
_syncPending = false;
if (userData.error){
triggerEvent(ERROR, {type:IO_ERROR, error:userData.error});
_outstandingID = -1;
};
triggerEvent(WRITTEN, {});
}
private function getConsumableBag(userData:MochiUserData):void{
var key:String;
var unsynced:Number;
if (userData.error){
triggerEvent(ERROR, {type:IO_ERROR, error:userData.error});
return;
};
_consumableProperties = {};
_names = new Array();
if (userData.data){
for (key in userData.data) {
_names.push(key);
_consumableProperties[key] = new MochiDigits(userData.data[key]);
};
};
for (key in _storeSync) {
unsynced = _storeSync[key].count;
if (_consumableProperties[(key + KEY_SALT)]){
unsynced = (unsynced - _consumableProperties[(key + KEY_SALT)].value);
};
if (unsynced == 0){
} else {
newItems({id:key, count:unsynced, properties:_storeSync[key].properties});
};
};
triggerEvent(READY, {});
}
private function loggedOut(args:Object=null):void{
_consumableProperties = null;
}
public static function triggerEvent(eventType:String, args:Object):void{
_dispatcher.triggerEvent(eventType, args);
}
public static function removeEventListener(eventType:String, delegate:Function):void{
_dispatcher.removeEventListener(eventType, delegate);
}
public static function addEventListener(eventType:String, delegate:Function):void{
_dispatcher.addEventListener(eventType, delegate);
}
}
}//package mochi.as3
Section 205
//MochiServices (mochi.as3.MochiServices)
package mochi.as3 {
import flash.events.*;
import flash.display.*;
import flash.utils.*;
import flash.net.*;
import flash.system.*;
import flash.geom.*;
public class MochiServices {
public static const CONNECTED:String = "onConnected";
private static var _container:Object;
private static var _connected:Boolean = false;
private static var _queue:Array;
private static var _swfVersion:String;
private static var _preserved:Object;
public static var netupAttempted:Boolean = false;
private static var _sendChannel:LocalConnection;
private static var _nextCallbackID:Number;
private static var _clip:MovieClip;
private static var _loader:Loader;
private static var _id:String;
private static var _services:String = "services.swf";
private static var _servURL:String = "http://www.mochiads.com/static/lib/services/";
public static var widget:Boolean = false;
private static var _timer:Timer;
private static var _sendChannelName:String;
private static var _dispatcher:MochiEventDispatcher = new MochiEventDispatcher();
private static var _callbacks:Object;
private static var _connecting:Boolean = false;
private static var _mochiLocalConnection:MovieClip;
private static var _listenChannelName:String = "__ms_";
public static var onError:Object;
public static var netup:Boolean = true;
private static var _mochiLC:String = "MochiLC.swf";
public function MochiServices(){
super();
}
public static function isNetworkAvailable():Boolean{
return (!((Security.sandboxType == "localWithFile")));
}
public static function get connected():Boolean{
return (_connected);
}
private static function onReceive(pkg:Object):void{
var cb:String;
var cblst:Object;
var method:*;
var methodName:String;
var obj:Object;
var pkg = pkg;
cb = pkg.callbackID;
cblst = _callbacks[cb];
if (!cblst){
return;
};
method = cblst.callbackMethod;
methodName = "";
obj = cblst.callbackObject;
if (((obj) && ((typeof(method) == "string")))){
methodName = method;
if (obj[method] != null){
method = obj[method];
} else {
trace((("Error: Method " + method) + " does not exist."));
};
};
if (method != undefined){
method.apply(obj, pkg.args);
//unresolved jump
var _slot1 = error;
trace(((("Error invoking callback method '" + methodName) + "': ") + _slot1.toString()));
} else {
if (obj != null){
obj(pkg.args);
//unresolved jump
var _slot1 = error;
trace(("Error invoking method on object: " + _slot1.toString()));
};
};
delete _callbacks[cb];
}
public static function send(methodName:String, args:Object=null, callbackObject:Object=null, callbackMethod:Object=null):void{
if (_connected){
_mochiLocalConnection.send(_sendChannelName, "onReceive", {methodName:methodName, args:args, callbackID:_nextCallbackID});
} else {
if ((((_clip == null)) || (!(_connecting)))){
trace(("Error: MochiServices not connected. Please call MochiServices.connect(). Function: " + methodName));
handleError(args, callbackObject, callbackMethod);
flush(true);
return;
};
_queue.push({methodName:methodName, args:args, callbackID:_nextCallbackID});
};
if (_clip != null){
if (_callbacks != null){
_callbacks[_nextCallbackID] = {callbackObject:callbackObject, callbackMethod:callbackMethod};
_nextCallbackID++;
};
};
}
private static function init(id:String, clip:Object):void{
_id = id;
if (clip != null){
_container = clip;
loadCommunicator(id, _container);
};
}
private static function clickMovie(url:String, cb:Function):MovieClip{
var avm1_bytecode:Array;
var b:int;
var header:Array;
var footer:Array;
var mc:MovieClip;
var lc:LocalConnection;
var lc_name:String;
var ba:ByteArray;
var cpool:ByteArray;
var actionLength:uint;
var fileLength:uint;
var loader:Loader;
avm1_bytecode = [150, 21, 0, 7, 1, 0, 0, 0, 0, 98, 116, 110, 0, 7, 2, 0, 0, 0, 0, 116, 104, 105, 115, 0, 28, 150, 22, 0, 0, 99, 114, 101, 97, 116, 101, 69, 109, 112, 116, 121, 77, 111, 118, 105, 101, 67, 108, 105, 112, 0, 82, 135, 1, 0, 0, 23, 150, 13, 0, 4, 0, 0, 111, 110, 82, 101, 108, 101, 97, 115, 101, 0, 142, 8, 0, 0, 0, 0, 2, 42, 0, 114, 0, 150, 17, 0, 0, 32, 0, 7, 1, 0, 0, 0, 8, 0, 0, 115, 112, 108, 105, 116, 0, 82, 135, 1, 0, 1, 23, 150, 7, 0, 4, 1, 7, 0, 0, 0, 0, 78, 150, 8, 0, 0, 95, 98, 108, 97, 110, 107, 0, 154, 1, 0, 0, 150, 7, 0, 0, 99, 108, 105, 99, 107, 0, 150, 7, 0, 4, 1, 7, 1, 0, 0, 0, 78, 150, 27, 0, 7, 2, 0, 0, 0, 7, 0, 0, 0, 0, 0, 76, 111, 99, 97, 108, 67, 111, 110, 110, 101, 99, 116, 105, 111, 110, 0, 64, 150, 6, 0, 0, 115, 101, 110, 100, 0, 82, 79, 150, 15, 0, 4, 0, 0, 95, 97, 108, 112, 104, 97, 0, 7, 0, 0, 0, 0, 79, 150, 23, 0, 7, 0xFF, 0, 0xFF, 0, 7, 1, 0, 0, 0, 4, 0, 0, 98, 101, 103, 105, 110, 70, 105, 108, 108, 0, 82, 23, 150, 25, 0, 7, 0, 0, 0, 0, 7, 0, 0, 0, 0, 7, 2, 0, 0, 0, 4, 0, 0, 109, 111, 118, 101, 84, 111, 0, 82, 23, 150, 25, 0, 7, 100, 0, 0, 0, 7, 0, 0, 0, 0, 7, 2, 0, 0, 0, 4, 0, 0, 108, 105, 110, 101, 84, 111, 0, 82, 23, 150, 25, 0, 7, 100, 0, 0, 0, 7, 100, 0, 0, 0, 7, 2, 0, 0, 0, 4, 0, 0, 108, 105, 110, 101, 84, 111, 0, 82, 23, 150, 25, 0, 7, 0, 0, 0, 0, 7, 100, 0, 0, 0, 7, 2, 0, 0, 0, 4, 0, 0, 108, 105, 110, 101, 84, 111, 0, 82, 23, 150, 25, 0, 7, 0, 0, 0, 0, 7, 0, 0, 0, 0, 7, 2, 0, 0, 0, 4, 0, 0, 108, 105, 110, 101, 84, 111, 0, 82, 23, 150, 16, 0, 7, 0, 0, 0, 0, 4, 0, 0, 101, 110, 100, 70, 105, 108, 108, 0, 82, 23];
header = [104, 0, 31, 64, 0, 7, 208, 0, 0, 12, 1, 0, 67, 2, 0xFF, 0xFF, 0xFF, 63, 3];
footer = [0, 64, 0, 0, 0];
mc = new MovieClip();
lc = new LocalConnection();
lc_name = ((("_click_" + Math.floor((Math.random() * 999999))) + "_") + Math.floor(new Date().time));
lc = new LocalConnection();
mc.lc = lc;
mc.click = cb;
lc.client = mc;
lc.connect(lc_name);
ba = new ByteArray();
cpool = new ByteArray();
cpool.endian = Endian.LITTLE_ENDIAN;
cpool.writeShort(1);
cpool.writeUTFBytes(((url + " ") + lc_name));
cpool.writeByte(0);
actionLength = ((avm1_bytecode.length + cpool.length) + 4);
fileLength = (actionLength + 35);
ba.endian = Endian.LITTLE_ENDIAN;
ba.writeUTFBytes("FWS");
ba.writeByte(8);
ba.writeUnsignedInt(fileLength);
for each (b in header) {
ba.writeByte(b);
};
ba.writeUnsignedInt(actionLength);
ba.writeByte(136);
ba.writeShort(cpool.length);
ba.writeBytes(cpool);
for each (b in avm1_bytecode) {
ba.writeByte(b);
};
for each (b in footer) {
ba.writeByte(b);
};
loader = new Loader();
loader.loadBytes(ba);
mc.addChild(loader);
return (mc);
}
private static function detach(event:Event):void{
var loader:LoaderInfo;
loader = LoaderInfo(event.target);
loader.removeEventListener(Event.COMPLETE, detach);
loader.removeEventListener(IOErrorEvent.IO_ERROR, detach);
loader.removeEventListener(Event.COMPLETE, loadLCBridgeComplete);
loader.removeEventListener(IOErrorEvent.IO_ERROR, loadError);
}
public static function stayOnTop():void{
_container.addEventListener(Event.ENTER_FRAME, MochiServices.bringToTop, false, 0, true);
if (_clip != null){
_clip.visible = true;
};
}
private static function loadLCBridgeComplete(e:Event):void{
var loader:Loader;
loader = LoaderInfo(e.target).loader;
_mochiLocalConnection = MovieClip(loader.content);
listen();
}
public static function disconnect():void{
if (((_connected) || (_connecting))){
if (_clip != null){
if (_clip.parent != null){
if ((_clip.parent is Sprite)){
Sprite(_clip.parent).removeChild(_clip);
_clip = null;
};
};
};
_connecting = (_connected = false);
flush(true);
_mochiLocalConnection.close();
//unresolved jump
var _slot1 = error;
};
if (_timer != null){
_timer.stop();
_timer.removeEventListener(TimerEvent.TIMER, connectWait);
_timer = null;
//unresolved jump
var _slot1 = error;
};
}
public static function allowDomains(server:String):String{
var hostname:String;
if (Security.sandboxType != "application"){
Security.allowDomain("*");
Security.allowInsecureDomain("*");
};
if (server.indexOf("http://") != -1){
hostname = server.split("/")[2].split(":")[0];
if (Security.sandboxType != "application"){
Security.allowDomain(hostname);
Security.allowInsecureDomain(hostname);
};
};
return (hostname);
}
public static function getVersion():String{
return ("3.9.2 as3");
}
public static function doClose():void{
_container.removeEventListener(Event.ENTER_FRAME, MochiServices.bringToTop);
}
public static function warnID(bid:String, leaderboard:Boolean):void{
var i:Number;
bid = bid.toLowerCase();
if (bid.length != 16){
trace((("WARNING: " + (leaderboard) ? "board" : "game") + " ID is not the appropriate length"));
return;
} else {
if (bid == "1e113c7239048b3f"){
if (leaderboard){
trace("WARNING: Using testing board ID");
} else {
trace("WARNING: Using testing board ID as game ID");
};
return;
} else {
if (bid == "84993a1de4031cd8"){
if (leaderboard){
trace("WARNING: Using testing game ID as board ID");
} else {
trace("WARNING: Using testing game ID");
};
return;
};
};
};
i = 0;
while (i < bid.length) {
switch (bid.charAt(i)){
case "0":
case "1":
case "2":
case "3":
case "4":
case "5":
case "6":
case "7":
case "8":
case "9":
case "a":
case "b":
case "c":
case "d":
case "e":
case "f":
break;
default:
trace(("WARNING: Board ID contains illegal characters: " + bid));
return;
};
i++;
};
}
private static function flush(error:Boolean):void{
var request:Object;
var callback:Object;
if (((_clip) && (_queue))){
while (_queue.length > 0) {
request = _queue.shift();
callback = null;
if (request != null){
if (request.callbackID != null){
callback = _callbacks[request.callbackID];
};
delete _callbacks[request.callbackID];
if (((error) && (!((callback == null))))){
handleError(request.args, callback.callbackObject, callback.callbackMethod);
};
};
};
};
}
public static function get id():String{
return (_id);
}
private static function onEvent(pkg:Object):void{
var target:String;
var event:String;
target = pkg.target;
event = pkg.event;
switch (target){
case "services":
MochiServices.triggerEvent(pkg.event, pkg.args);
break;
case "events":
MochiEvents.triggerEvent(pkg.event, pkg.args);
break;
case "coins":
MochiCoins.triggerEvent(pkg.event, pkg.args);
break;
case "social":
MochiSocial.triggerEvent(pkg.event, pkg.args);
break;
};
}
private static function urlOptions(clip:Object):Object{
var opts:Object;
var options:String;
var pairs:Array;
var i:Number;
var kv:Array;
opts = {};
if (clip.stage){
options = clip.stage.loaderInfo.parameters.mochiad_options;
} else {
options = clip.loaderInfo.parameters.mochiad_options;
};
if (options){
pairs = options.split("&");
i = 0;
while (i < pairs.length) {
kv = pairs[i].split("=");
opts[unescape(kv[0])] = unescape(kv[1]);
i++;
};
};
return (opts);
}
public static function addLinkEvent(url:String, burl:String, btn:DisplayObjectContainer, onClick:Function=null):void{
var vars:Object;
var avm1Click:DisplayObject;
var s:String;
var i:Number;
var x:String;
var req:URLRequest;
var loader:Loader;
var setURL:Function;
var err:Function;
var complete:Function;
var url = url;
var burl = burl;
var btn = btn;
var onClick = onClick;
vars = new Object();
vars["mav"] = getVersion();
vars["swfv"] = "9";
vars["swfurl"] = btn.loaderInfo.loaderURL;
vars["fv"] = Capabilities.version;
vars["os"] = Capabilities.os;
vars["lang"] = Capabilities.language;
vars["scres"] = ((Capabilities.screenResolutionX + "x") + Capabilities.screenResolutionY);
s = "?";
i = 0;
for (x in vars) {
if (i != 0){
s = (s + "&");
};
i = (i + 1);
s = (((s + x) + "=") + escape(vars[x]));
};
req = new URLRequest("http://link.mochiads.com/linkping.swf");
loader = new Loader();
setURL = function (url:String):void{
var rect:Rectangle;
if (avm1Click){
btn.removeChild(avm1Click);
};
avm1Click = clickMovie(url, onClick);
rect = btn.getBounds(btn);
btn.addChild(avm1Click);
avm1Click.x = rect.x;
avm1Click.y = rect.y;
avm1Click.scaleX = (0.01 * rect.width);
avm1Click.scaleY = (0.01 * rect.height);
};
err = function (ev:Object):void{
netup = false;
ev.target.removeEventListener(ev.type, arguments.callee);
setURL(burl);
};
complete = function (ev:Object):void{
ev.target.removeEventListener(ev.type, arguments.callee);
};
if (netup){
setURL((url + s));
} else {
setURL(burl);
};
if (!((netupAttempted) || (_connected))){
netupAttempted = true;
loader.contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR, err);
loader.contentLoaderInfo.addEventListener(Event.COMPLETE, complete);
loader.load(req);
};
}
public static function setContainer(container:Object=null, doAdd:Boolean=true):void{
if (_clip.parent){
_clip.parent.removeChild(_clip);
};
if (container != null){
if ((container is DisplayObjectContainer)){
_container = container;
};
};
if (doAdd){
if ((_container is DisplayObjectContainer)){
DisplayObjectContainer(_container).addChild(_clip);
};
};
}
private static function handleError(args:Object, callbackObject:Object, callbackMethod:Object):void{
var args = args;
var callbackObject = callbackObject;
var callbackMethod = callbackMethod;
if (args != null){
if (args.onError != null){
args.onError.apply(null, ["NotConnected"]);
};
if (((!((args.options == null))) && (!((args.options.onError == null))))){
args.options.onError.apply(null, ["NotConnected"]);
};
};
if (callbackMethod != null){
args = {};
args.error = true;
args.errorCode = "NotConnected";
if (((!((callbackObject == null))) && ((callbackMethod is String)))){
var _local5 = callbackObject;
_local5[callbackMethod](args);
//unresolved jump
var _slot1 = error;
} else {
if (callbackMethod != null){
callbackMethod.apply(args);
//unresolved jump
var _slot1 = error;
};
};
};
}
private static function loadError(ev:Object):void{
_clip._mochiad_ctr_failed = true;
trace("MochiServices could not load.");
MochiServices.disconnect();
MochiServices.onError("IOError");
}
public static function get childClip():Object{
return (_clip);
}
private static function initComChannels():void{
if (!_connected){
trace("[SERVICES_API] connected!");
_connecting = false;
_connected = true;
_mochiLocalConnection.send(_sendChannelName, "onReceive", {methodName:"handshakeDone"});
_mochiLocalConnection.send(_sendChannelName, "onReceive", {methodName:"registerGame", preserved:_preserved, id:_id, version:getVersion(), parentURL:_container.loaderInfo.loaderURL});
_clip.onReceive = onReceive;
_clip.onEvent = onEvent;
_clip.onError = function ():void{
MochiServices.onError("IOError");
};
while (_queue.length > 0) {
_mochiLocalConnection.send(_sendChannelName, "onReceive", _queue.shift());
};
};
}
public static function triggerEvent(eventType:String, args:Object):void{
_dispatcher.triggerEvent(eventType, args);
}
public static function removeEventListener(eventType:String, delegate:Function):void{
_dispatcher.removeEventListener(eventType, delegate);
}
private static function listen():void{
_mochiLocalConnection.connect(_listenChannelName);
_clip.handshake = function (args:Object):void{
MochiServices.comChannelName = args.newChannel;
};
trace("Waiting for MochiAds services to connect...");
}
public static function addEventListener(eventType:String, delegate:Function):void{
_dispatcher.addEventListener(eventType, delegate);
}
private static function loadLCBridge(clip:Object):void{
var loader:Loader;
var mochiLCURL:String;
var req:URLRequest;
loader = new Loader();
mochiLCURL = (_servURL + _mochiLC);
req = new URLRequest(mochiLCURL);
loader.contentLoaderInfo.addEventListener(Event.COMPLETE, detach);
loader.contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR, detach);
loader.contentLoaderInfo.addEventListener(Event.COMPLETE, loadLCBridgeComplete);
loader.contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR, loadError);
loader.load(req);
clip.addChild(loader);
}
public static function set comChannelName(val:String):void{
if (val != null){
if (val.length > 3){
_sendChannelName = (val + "_fromgame");
initComChannels();
};
};
}
private static function loadCommunicator(id:String, clip:Object):MovieClip{
var servicesURL:String;
var req:URLRequest;
var vars:URLVariables;
if (_clip != null){
return (_clip);
};
if (!MochiServices.isNetworkAvailable()){
return (null);
};
if (urlOptions(clip).servURL){
_servURL = urlOptions(clip).servURL;
};
servicesURL = (_servURL + _services);
if (urlOptions(clip).servicesURL){
servicesURL = urlOptions(clip).servicesURL;
};
_listenChannelName = (_listenChannelName + ((Math.floor(new Date().time) + "_") + Math.floor((Math.random() * 99999))));
MochiServices.allowDomains(servicesURL);
_clip = new MovieClip();
loadLCBridge(_clip);
_loader = new Loader();
_loader.contentLoaderInfo.addEventListener(Event.COMPLETE, detach);
_loader.contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR, detach);
_loader.contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR, loadError);
req = new URLRequest(servicesURL);
vars = new URLVariables();
vars.listenLC = _listenChannelName;
vars.mochiad_options = clip.loaderInfo.parameters.mochiad_options;
vars.api_version = getVersion();
if (widget){
vars.widget = true;
};
req.data = vars;
_loader.load(req);
_clip.addChild(_loader);
_sendChannel = new LocalConnection();
_queue = [];
_nextCallbackID = 0;
_callbacks = {};
_timer = new Timer(10000, 1);
_timer.addEventListener(TimerEvent.TIMER, connectWait);
_timer.start();
return (_clip);
}
public static function get clip():Object{
return (_container);
}
public static function connect(id:String, clip:Object, onError:Object=null):void{
var id = id;
var clip = clip;
var onError = onError;
warnID(id, false);
if ((clip is DisplayObject)){
if (clip.stage == null){
trace("MochiServices connect requires the containing clip be attached to the stage");
};
if (((!(_connected)) && ((_clip == null)))){
trace("MochiServices Connecting...");
_connecting = true;
init(id, clip);
};
} else {
trace("Error, MochiServices requires a Sprite, Movieclip or instance of the stage.");
};
if (onError != null){
MochiServices.onError = onError;
} else {
if (MochiServices.onError == null){
MochiServices.onError = function (errorCode:String):void{
trace(errorCode);
};
};
};
}
public static function bringToTop(e:Event=null):void{
var e = e;
if (((!((MochiServices.clip == null))) && (!((MochiServices.childClip == null))))){
if (MochiServices.clip.numChildren > 1){
MochiServices.clip.setChildIndex(MochiServices.childClip, (MochiServices.clip.numChildren - 1));
};
//unresolved jump
var _slot1 = errorObject;
trace("Warning: Depth sort error.");
_container.removeEventListener(Event.ENTER_FRAME, MochiServices.bringToTop);
};
}
public static function connectWait(e:TimerEvent):void{
if (!_connected){
_clip._mochiad_ctr_failed = true;
trace("MochiServices could not load. (timeout)");
MochiServices.disconnect();
MochiServices.onError("IOError");
} else {
_timer.stop();
_timer.removeEventListener(TimerEvent.TIMER, connectWait);
_timer = null;
};
}
}
}//package mochi.as3
Section 206
//MochiSocial (mochi.as3.MochiSocial)
package mochi.as3 {
public class MochiSocial {
public static const LOGGED_IN:String = "LoggedIn";
public static const ACTION_CANCELED:String = "onCancel";
public static const PROPERTIES_SIZE:String = "PropertiesSize";
public static const IO_ERROR:String = "IOError";
public static const NO_USER:String = "NoUser";
public static const FRIEND_LIST:String = "FriendsList";
public static const PROFILE_DATA:String = "ProfileData";
public static const GAMEPLAY_DATA:String = "GameplayData";
public static const ACTION_COMPLETE:String = "onComplete";
public static const LOGIN_SHOW:String = "LoginShow";
public static const PROFILE_HIDE:String = "ProfileHide";
public static const USER_INFO:String = "UserInfo";
public static const PROPERTIES_SAVED:String = "PropertySaved";
public static const WIDGET_LOADED:String = "WidgetLoaded";
public static const ERROR:String = "Error";
public static const LOGGED_OUT:String = "LoggedOut";
public static const PROFILE_SHOW:String = "ProfileShow";
public static const LOGIN_HIDE:String = "LoginHide";
public static const LOGIN_SHOWN:String = "LoginShown";
public static var _user_info:Object = null;
private static var _dispatcher:MochiEventDispatcher = new MochiEventDispatcher();
public function MochiSocial(){
super();
}
public static function requestFan(properties:Object=null):void{
MochiServices.setContainer();
MochiServices.bringToTop();
MochiServices.send("social_requestFan", properties);
}
public static function postToStream(properties:Object=null):void{
MochiServices.setContainer();
MochiServices.bringToTop();
MochiServices.send("social_postToStream", properties);
}
public static function getFriendsList(properties:Object=null):void{
MochiServices.send("social_getFriendsList", properties);
}
public static function requestLogin(properties:Object=null):void{
MochiServices.setContainer();
MochiServices.bringToTop();
MochiServices.send("social_requestLogin", properties);
}
public static function getVersion():String{
return (MochiServices.getVersion());
}
public static function saveUserProperties(properties:Object):void{
MochiServices.send("social_saveUserProperties", properties);
}
public static function triggerEvent(eventType:String, args:Object):void{
_dispatcher.triggerEvent(eventType, args);
}
public static function removeEventListener(eventType:String, delegate:Function):void{
_dispatcher.removeEventListener(eventType, delegate);
}
public static function inviteFriends(properties:Object=null):void{
MochiServices.setContainer();
MochiServices.bringToTop();
MochiServices.send("social_inviteFriends", properties);
}
public static function get loggedIn():Boolean{
return (!((_user_info == null)));
}
public static function addEventListener(eventType:String, delegate:Function):void{
_dispatcher.addEventListener(eventType, delegate);
}
public static function showLoginWidget(options:Object=null):void{
MochiServices.setContainer();
MochiServices.bringToTop();
MochiServices.send("social_showLoginWidget", {options:options});
}
public static function getAPIURL():String{
if (!_user_info){
return (null);
};
return (_user_info.api_url);
}
public static function hideLoginWidget():void{
MochiServices.send("social_hideLoginWidget");
}
public static function getAPIToken():String{
if (!_user_info){
return (null);
};
return (_user_info.api_token);
}
MochiSocial.addEventListener(MochiSocial.LOGGED_IN, function (args:Object):void{
_user_info = args;
});
MochiSocial.addEventListener(MochiSocial.LOGGED_OUT, function (args:Object):void{
_user_info = null;
});
}
}//package mochi.as3
Section 207
//MochiUserData (mochi.as3.MochiUserData)
package mochi.as3 {
import flash.events.*;
import flash.utils.*;
import flash.net.*;
public class MochiUserData extends EventDispatcher {
public var callback:Function;// = null
public var error:Event;// = null
public var key:String;// = null
public var operation:String;// = null
public var data;// = null
public var _loader:URLLoader;
public function MochiUserData(key:String="", callback:Function=null){
key = null;
data = null;
error = null;
operation = null;
callback = null;
super();
this.key = key;
this.callback = callback;
}
public function securityErrorHandler(event:SecurityErrorEvent):void{
errorHandler(new IOErrorEvent(IOErrorEvent.IO_ERROR, false, false, ("security error: " + event.toString())));
}
public function putEvent(obj):void{
request("put", serialize(obj));
}
public function request(_operation:String, _data:ByteArray):void{
var api_url:String;
var api_token:String;
var args:URLVariables;
var req:URLRequest;
var _operation = _operation;
var _data = _data;
operation = _operation;
api_url = MochiSocial.getAPIURL();
api_token = MochiSocial.getAPIToken();
if ((((api_url == null)) || ((api_token == null)))){
errorHandler(new IOErrorEvent(IOErrorEvent.IO_ERROR, false, false, "not logged in"));
return;
};
_loader = new URLLoader();
args = new URLVariables();
args.op = _operation;
args.key = key;
req = new URLRequest((((MochiSocial.getAPIURL() + "/") + "MochiUserData?") + args.toString()));
req.method = URLRequestMethod.POST;
req.contentType = "application/x-mochi-userdata";
req.requestHeaders = [new URLRequestHeader("x-mochi-services-version", MochiServices.getVersion()), new URLRequestHeader("x-mochi-api-token", api_token)];
req.data = _data;
_loader.dataFormat = URLLoaderDataFormat.BINARY;
_loader.addEventListener(Event.COMPLETE, completeHandler);
_loader.addEventListener(IOErrorEvent.IO_ERROR, errorHandler);
_loader.addEventListener(SecurityErrorEvent.SECURITY_ERROR, securityErrorHandler);
_loader.load(req);
//unresolved jump
var _slot1 = e;
errorHandler(new IOErrorEvent(IOErrorEvent.IO_ERROR, false, false, ("security error: " + _slot1.toString())));
}
public function completeHandler(event:Event):void{
var event = event;
if (_loader.data.length){
data = deserialize(_loader.data);
} else {
data = null;
};
//unresolved jump
var _slot1 = e;
errorHandler(new IOErrorEvent(IOErrorEvent.IO_ERROR, false, false, ("deserialize error: " + _slot1.toString())));
return;
if (callback != null){
performCallback();
} else {
dispatchEvent(event);
};
close();
}
public function performCallback():void{
callback(this);
//unresolved jump
var _slot1 = e;
trace(("[MochiUserData] exception during callback: " + _slot1));
}
public function serialize(obj):ByteArray{
var arr:ByteArray;
arr = new ByteArray();
arr.objectEncoding = ObjectEncoding.AMF3;
arr.writeObject(obj);
arr.compress();
return (arr);
}
public function errorHandler(event:IOErrorEvent):void{
data = null;
error = event;
if (callback != null){
performCallback();
} else {
dispatchEvent(event);
};
close();
}
public function getEvent():void{
request("get", serialize(null));
}
override public function toString():String{
return ((((((((("[MochiUserData operation=" + operation) + " key=\"") + key) + "\" data=") + data) + " error=\"") + error) + "\"]"));
}
public function close():void{
if (_loader){
_loader.removeEventListener(Event.COMPLETE, completeHandler);
_loader.removeEventListener(IOErrorEvent.IO_ERROR, errorHandler);
_loader.removeEventListener(SecurityErrorEvent.SECURITY_ERROR, securityErrorHandler);
_loader.close();
_loader = null;
};
error = null;
callback = null;
}
public function deserialize(arr:ByteArray){
arr.objectEncoding = ObjectEncoding.AMF3;
arr.uncompress();
return (arr.readObject());
}
public static function get(key:String, callback:Function):void{
var userData:MochiUserData;
userData = new MochiUserData(key, callback);
userData.getEvent();
}
public static function put(key:String, obj, callback:Function):void{
var userData:MochiUserData;
userData = new MochiUserData(key, callback);
userData.putEvent(obj);
}
}
}//package mochi.as3
Section 208
//HolyParticle (particles.HolyParticle)
package particles {
public class HolyParticle extends Particle {
public function HolyParticle(x:Number, y:Number){
addFrameScript(8, frame9);
super(x, y);
}
function frame9(){
kill();
}
}
}//package particles
Section 209
//LeafParticle (particles.LeafParticle)
package particles {
public class LeafParticle extends Particle {
public function LeafParticle(x:Number, y:Number){
addFrameScript(8, frame9);
super(x, y);
}
function frame9(){
kill();
}
}
}//package particles
Section 210
//OrangeParticle (particles.OrangeParticle)
package particles {
public class OrangeParticle extends Particle {
public function OrangeParticle(x:Number, y:Number){
addFrameScript(12, frame13);
super(x, y);
}
function frame13(){
kill();
}
}
}//package particles
Section 211
//Particle (particles.Particle)
package particles {
import flash.display.*;
public class Particle extends MovieClip {
public var yspeed:Number;
public var xspeed:Number;
public function Particle(x:Number, y:Number, r:Number=0){
super();
this.x = x;
this.y = y;
this.scaleX = (this.scaleX * (this.scaleY = (this.scaleY * ((Math.random() / 2) + 0.8))));
this.rotation = (Math.random() * 360);
}
public function kill(){
stop();
parent.removeChild(this);
}
}
}//package particles
Section 212
//SmashParticle (particles.SmashParticle)
package particles {
public class SmashParticle extends Particle {
public function SmashParticle(x:Number, y:Number){
addFrameScript(2, frame3);
super(x, y);
}
function frame3(){
kill();
}
}
}//package particles
Section 213
//YellowParticle (particles.YellowParticle)
package particles {
public class YellowParticle extends Particle {
public function YellowParticle(x:Number, y:Number){
addFrameScript(11, frame12);
super(x, y);
}
function frame12(){
if (this){
kill();
};
}
}
}//package particles
Section 214
//Anna (players.Anna)
package players {
import levels.*;
import shots.*;
public class Anna extends Player {
public var tree1:TreeShot;
public var tree2:TreeShot;
public var trees:Boolean;// = false
public var bxs:Number;// = 0
public var bys:Number;// = 0
public function Anna(){
bxs = 0;
bys = 0;
trees = false;
super();
addFrameScript(0, frame1, 1, frame2, 2, frame3, 3, frame4, 4, frame5, 5, frame6, 6, frame7, 7, frame8, 8, frame9, 9, frame10, 10, frame11, 11, frame12, 12, frame13, 13, frame14, 14, frame15, 15, frame16, 16, frame17, 17, frame18, 18, frame19, 19, frame20, 20, frame21, 49, frame50);
}
override public function statBonus(){
baseDamage = (baseDamage * 1.05);
}
function frame10(){
root.y = 50;
(root as Main).makeSound("hit", "p");
}
function frame16(){
root.y = 12;
}
function frame14(){
root.y = 20;
}
function frame15(){
root.y = -20;
}
function frame11(){
root.y = -50;
}
function frame5(){
root.y = -12;
}
function frame7(){
root.y = -6;
}
function frame19(){
root.y = -6;
}
function frame9(){
root.y = 0;
if (((this) && (!(dead)))){
gotoAndStop(1);
};
}
function frame1(){
stop();
}
function frame3(){
root.y = -20;
}
function frame4(){
root.y = 12;
}
function frame8(){
root.y = 3;
}
function frame2(){
root.y = 20;
(root as Main).makeSound("hit", "p");
}
function frame18(){
root.y = 6;
}
function frame21(){
root.y = 0;
}
override public function subAttack(){
if (trees){
tree1.dead = true;
tree2.dead = true;
trees = false;
} else {
if ((((subCharge > (maxCharge / 4))) && (!(trees)))){
(root as Main).makeSound("tree", "p");
tree1 = new TreeShot(x, y, false, this);
tree2 = new TreeShot(x, y, true, this);
parent.addChild(tree1);
parent.addChild(tree2);
subCharge = (subCharge - (maxCharge / 6));
trees = true;
};
};
}
function frame12(){
root.y = 40;
}
function frame6(){
root.y = 6;
}
function frame20(){
root.y = 3;
}
function frame13(){
root.y = -30;
}
function frame17(){
root.y = -12;
}
function frame50(){
stop();
end();
}
override public function shootStuff(){
if (trees){
subCharge = (subCharge - 0.7);
};
if (keyIsDown[leftKey]){
bxs = (bxs - 3);
} else {
if (keyIsDown[rightKey]){
bxs = (bxs + 3);
} else {
if (!((keyIsDown[mainKey]) || (keyIsDown[89]))){
bxs = 0;
};
};
};
bxs = (bxs * 0.7);
if (((((((((keyIsDown[mainKey]) || (keyIsDown[89]))) || (autoMain))) || (keyIsDown[1]))) && ((mainCharge > 5)))){
(root as Main).makeSound("arrow", "p");
parent.addChild(new ArrowShot((x + bxs), (y - 18), bxs, -28, bxs, (baseDamage * 3)));
if (buff > 0){
parent.addChild(new LeafShot(x, (y - 25), ((Math.random() * 20) - 10), -15, 0, (baseDamage * 3)));
};
mainCharge = (mainCharge - 5);
};
if (bombCondition()){
doBomb();
};
}
override public function loadStats(){
playerNo = 4;
baseDamage = (baseDamage * 1.05);
focusDot.gotoAndStop(2);
}
override public function doBomb(){
var bomb:PlayerBomb;
bombs--;
bomb = new AnnaBomb(x, y, (baseDamage * 3.8), (parent as Level));
parent.addChild(bomb);
parent.setChildIndex(bomb, 1);
(parent as Level).useBomb();
(parent as Level).theBomb = bomb;
}
}
}//package players
Section 215
//AnnaBomb (players.AnnaBomb)
package players {
public class AnnaBomb extends PlayerBomb {
public function AnnaBomb(x, y, damage, level){
addFrameScript(0, frame1, 129, frame130, 139, frame140, 149, frame150);
super(x, y, damage, level);
}
function frame1(){
(root as Main).makeSound("cross", "p");
}
override function special(){
this.x = level.player.x;
this.y = level.player.y;
}
function frame130(){
(root as Main).makeSound("cross2", "p");
}
function frame140(){
active = false;
}
function frame150(){
if (this){
kill();
};
}
}
}//package players
Section 216
//Lance (players.Lance)
package players {
import levels.*;
import shots.*;
public class Lance extends Player {
public var bxs:Number;// = 0
public var bys:Number;// = 0
public function Lance(){
bxs = 0;
bys = 0;
super();
addFrameScript(0, frame1, 1, frame2, 2, frame3, 3, frame4, 4, frame5, 5, frame6, 6, frame7, 7, frame8, 8, frame9, 9, frame10, 10, frame11, 11, frame12, 12, frame13, 13, frame14, 14, frame15, 15, frame16, 16, frame17, 17, frame18, 18, frame19, 19, frame20, 20, frame21, 48, frame49);
}
override public function statBonus(){
baseDamage = (baseDamage * 1.02);
subChargeSpeed = (subChargeSpeed * 1.1);
}
function frame10(){
root.y = 50;
(root as Main).makeSound("hit", "p");
}
function frame16(){
root.y = 12;
}
function frame14(){
root.y = 20;
}
function frame15(){
root.y = -20;
}
function frame11(){
root.y = -50;
(root as Main).makeSound("explode", "p");
}
function frame17(){
root.y = -12;
}
function frame18(){
root.y = 6;
}
function frame5(){
root.y = -12;
}
function frame7(){
root.y = -6;
}
function frame19(){
root.y = -6;
}
function frame9(){
root.y = 0;
if (((this) && (!(dead)))){
gotoAndStop(1);
};
}
function frame1(){
stop();
}
function frame3(){
root.y = -20;
}
function frame4(){
root.y = 12;
}
function frame8(){
root.y = 3;
}
function frame2(){
root.y = 20;
(root as Main).makeSound("hit", "p");
}
function frame21(){
root.y = 0;
}
override public function subAttack(){
bxs = 0;
bys = 0;
if (keyIsDown[leftKey]){
bxs = -20;
};
if (keyIsDown[rightKey]){
bxs = 20;
};
if (keyIsDown[upKey]){
bys = -20;
};
if (keyIsDown[downKey]){
bys = 20;
};
if (((((((!(keyIsDown[rightKey])) && (!(keyIsDown[leftKey])))) && (!(keyIsDown[downKey])))) && (!(keyIsDown[upKey])))){
bys = -20;
};
bys = -20;
bxs = 0;
if (subCharge == maxCharge){
(root as Main).makeSound("mine", "p");
shot = new BulletBomb(x, y, (bxs * 1.3), (bys * 1.3), baseDamage);
parent.addChild(shot);
parent.setChildIndex(shot, 2);
subCharge = (subCharge - (maxCharge / 4));
};
if (subCharge >= ((maxCharge * 3) / 4)){
(root as Main).makeSound("mine", "p");
shot = new BulletBomb(x, y, (bxs * 1.2), (bys * 1.2), baseDamage);
parent.addChild(shot);
parent.setChildIndex(shot, 2);
subCharge = (subCharge - (maxCharge / 4));
};
if (subCharge >= (maxCharge / 2)){
(root as Main).makeSound("mine", "p");
shot = new BulletBomb(x, y, (bxs * 1.1), (bys * 1.1), baseDamage);
parent.addChild(shot);
parent.setChildIndex(shot, 2);
subCharge = (subCharge - (maxCharge / 4));
};
if (subCharge >= (maxCharge / 4)){
(root as Main).makeSound("mine", "p");
shot = new BulletBomb(x, y, bxs, bys, baseDamage);
parent.addChild(shot);
parent.setChildIndex(shot, 2);
subCharge = (subCharge - (maxCharge / 4));
};
}
function frame6(){
root.y = 6;
}
function frame12(){
root.y = 40;
}
function frame49(){
stop();
end();
}
function frame20(){
root.y = 3;
}
function frame13(){
root.y = -30;
}
override public function shootStuff(){
while (((((((((keyIsDown[mainKey]) || (keyIsDown[89]))) || (autoMain))) || (keyIsDown[1]))) && ((mainCharge > 7)))) {
(root as Main).makeSound("bullet", "p");
parent.addChild(new BulletShot((x + 17), (y - 18), 0, -25, 0, (baseDamage * 2)));
parent.addChild(new BulletShot((x - 16), (y - 18), 0, -25, 0, (baseDamage * 2)));
mainCharge = (mainCharge - 7);
if (buff > 0){
parent.addChild(new BulletShot((x - 16), (y - 18), -13, -22, -33, (baseDamage * 2)));
parent.addChild(new BulletShot((x + 17), (y - 18), 13, -22, 33, (baseDamage * 2)));
};
};
if (bombCondition()){
doBomb();
};
}
override public function loadStats(){
playerNo = 3;
baseDamage = (baseDamage * 1.02);
subChargeSpeed = (subChargeSpeed * 1.1);
}
override public function doBomb(){
var bomb:PlayerBomb;
bombs--;
bomb = new LanceBomb(x, y, (baseDamage * 4), (parent as Level));
parent.addChild(bomb);
parent.setChildIndex(bomb, 1);
(parent as Level).useBomb();
(parent as Level).theBomb = bomb;
}
}
}//package players
Section 217
//LanceBomb (players.LanceBomb)
package players {
public class LanceBomb extends PlayerBomb {
public function LanceBomb(x, y, damage, level){
addFrameScript(0, frame1, 12, frame13, 14, frame15, 21, frame22, 25, frame26, 135, frame136);
super(x, y, damage, level);
}
function frame15(){
damage = (damage * 3);
}
function frame1(){
stop();
}
function frame13(){
(root as Main).makeSound("lance", "p");
}
function frame22(){
damage = (damage / 3);
}
function frame26(){
(root as Main).makeSound("lance2", "p");
}
override function special(){
this.x = level.player.x;
this.y = level.player.y;
}
function frame136(){
if (this){
kill();
};
}
}
}//package players
Section 218
//Matt (players.Matt)
package players {
import levels.*;
import shots.*;
public class Matt extends Player {
public var bxs:Number;// = 0
public var bys:Number;// = 0
public function Matt(){
bxs = 0;
bys = 0;
super();
addFrameScript(0, frame1, 1, frame2, 2, frame3, 3, frame4, 4, frame5, 5, frame6, 6, frame7, 7, frame8, 8, frame9, 9, frame10, 10, frame11, 11, frame12, 12, frame13, 13, frame14, 14, frame15, 15, frame16, 16, frame17, 17, frame18, 18, frame19, 19, frame20, 20, frame21, 53, frame54);
}
override public function statBonus(){
baseDamage = (baseDamage * 1.1);
}
function frame10(){
root.y = 50;
(root as Main).makeSound("hit", "p");
}
function frame16(){
root.y = 12;
}
function frame14(){
root.y = 20;
}
function frame15(){
root.y = -20;
}
function frame11(){
root.y = -50;
}
function frame17(){
root.y = -12;
}
function frame18(){
root.y = 6;
}
function frame5(){
root.y = -12;
}
function frame7(){
root.y = -6;
}
function frame19(){
root.y = -6;
}
function frame9(){
root.y = 0;
if (((this) && (!(dead)))){
gotoAndStop(1);
};
}
function frame1(){
stop();
}
function frame3(){
root.y = -20;
}
function frame4(){
root.y = 12;
}
function frame8(){
root.y = 3;
}
function frame2(){
root.y = 20;
(root as Main).makeSound("hit", "p");
}
function frame21(){
root.y = 0;
}
override public function subAttack(){
bxs = (bys = 0);
if (keyIsDown[leftKey]){
bxs = -20;
};
if (keyIsDown[rightKey]){
bxs = 20;
};
if (keyIsDown[upKey]){
bys = -20;
};
if (keyIsDown[downKey]){
bys = 20;
};
if (subCharge > (maxCharge / 4)){
(root as Main).makeSound("sword2", "p");
shot = new HugeSwordShot(x, y, 0, -20, (baseDamage * 2.4), 90, this, true);
parent.addChild(shot);
parent.setChildIndex(shot, 1);
subCharge = (subCharge - (maxCharge / 4));
};
}
function frame6(){
root.y = 6;
}
function frame12(){
root.y = 40;
}
function frame20(){
root.y = 3;
}
function frame13(){
root.y = -30;
}
function frame54(){
stop();
end();
}
override public function shootStuff(){
if (((((((((keyIsDown[mainKey]) || (keyIsDown[89]))) || (autoMain))) || (keyIsDown[1]))) && ((mainCharge > 8)))){
mainCharge = (mainCharge - 8);
if (buff > 0){
parent.addChild(new SwordShot((x + 10), (y - 18), 0, -25, 0, (baseDamage * 5)));
parent.addChild(new SwordShot((x - 10), (y - 18), 0, -25, 0, (baseDamage * 5)));
} else {
parent.addChild(new SwordShot(x, (y - 18), 0, -20, 0, (baseDamage * 5)));
};
(root as Main).makeSound("sword", "p");
if (mainCharge > 50){
parent.addChild(new SwordShot(x, (y - 18), (0 + 2), -18, 0, (baseDamage * 5)));
parent.addChild(new SwordShot(x, (y - 18), (0 - 2), -18, 0, (baseDamage * 5)));
parent.addChild(new SwordShot(x, (y - 18), (0 + 4), -16, 0, (baseDamage * 5)));
parent.addChild(new SwordShot(x, (y - 18), (0 - 4), -16, 0, (baseDamage * 5)));
parent.addChild(new SwordShot(x, (y - 18), (0 + 6), -14, 0, (baseDamage * 5)));
parent.addChild(new SwordShot(x, (y - 18), (0 - 6), -14, 0, (baseDamage * 5)));
mainCharge = (mainCharge - 16);
};
};
if (bombCondition()){
doBomb();
};
}
override public function loadStats(){
playerNo = 1;
speed = (speed * 0.95);
baseDamage = (baseDamage * 1.1);
focusDot.gotoAndStop(2);
bombs++;
}
override public function doBomb(){
var bomb:PlayerBomb;
bombs--;
bomb = new MattBomb(x, y, (baseDamage * 60), (parent as Level));
parent.addChild(bomb);
parent.setChildIndex(bomb, 1);
(parent as Level).useBomb();
(parent as Level).theBomb = bomb;
}
}
}//package players
Section 219
//MattBomb (players.MattBomb)
package players {
public class MattBomb extends PlayerBomb {
public function MattBomb(x, y, damage, level){
addFrameScript(3, frame4, 4, frame5, 5, frame6, 9, frame10, 54, frame55);
super(x, y, damage, level);
this.x = 0;
this.y = 0;
active = false;
blower = false;
}
function frame10(){
active = false;
}
function frame6(){
(root as Main).makeSound("rag2", "p");
}
function frame5(){
(root as Main).makeSound("rag", "p");
}
function frame4(){
active = true;
}
function frame55(){
if (this){
kill();
};
}
}
}//package players
Section 220
//Natalie (players.Natalie)
package players {
import levels.*;
import shots.*;
public class Natalie extends Player {
public var ball:HolyBallShot;
public var ball1:HolyBallShot;
public var ball2:HolyBallShot;
public var ball3:HolyBallShot;
public var bxs:Number;// = 0
public var holy:Boolean;// = false
public var bys:Number;// = 0
public var shieldCharge:int;// = 0
public function Natalie(){
bxs = 0;
bys = 0;
holy = false;
shieldCharge = 0;
super();
addFrameScript(0, frame1, 1, frame2, 2, frame3, 3, frame4, 4, frame5, 5, frame6, 6, frame7, 7, frame8, 8, frame9, 9, frame10, 10, frame11, 11, frame12, 12, frame13, 13, frame14, 14, frame15, 15, frame16, 16, frame17, 17, frame18, 18, frame19, 19, frame20, 20, frame21, 39, frame40);
}
override public function statBonus(){
baseDamage = (baseDamage * 1.02);
subChargeSpeed = (subChargeSpeed * 1.05);
}
function frame10(){
root.y = 50;
(root as Main).makeSound("hit", "p");
}
function frame16(){
root.y = 12;
}
function frame14(){
root.y = 20;
}
function frame15(){
root.y = -20;
}
function frame11(){
root.y = -50;
}
function frame17(){
root.y = -12;
}
function frame18(){
root.y = 6;
}
function frame5(){
root.y = -12;
}
function frame7(){
root.y = -6;
}
function frame19(){
root.y = -6;
}
function frame9(){
root.y = 0;
if (((this) && (!(dead)))){
gotoAndStop(1);
};
}
function frame1(){
stop();
}
function frame3(){
root.y = -20;
}
function frame4(){
root.y = 12;
}
function frame8(){
root.y = 3;
}
function frame2(){
root.y = 20;
(root as Main).makeSound("hit", "p");
}
function frame21(){
root.y = 0;
}
override public function subAttack(){
if (holy){
holy = false;
ball1.dead = true;
ball2.dead = true;
ball3.dead = true;
} else {
if ((((subCharge > (maxCharge / 4))) && (!(holy)))){
(root as Main).makeSound("holy", "p");
ball1 = new HolyBallShot(x, y, 0, 0, this, 0);
parent.addChild(ball1);
ball2 = new HolyBallShot(x, y, 0, 0, this, 1);
parent.addChild(ball2);
ball3 = new HolyBallShot(x, y, 0, 0, this, 2);
parent.addChild(ball3);
subCharge = (subCharge - (maxCharge / 8));
holy = true;
};
};
}
function frame6(){
root.y = 6;
}
function frame12(){
root.y = 40;
}
function frame40(){
stop();
end();
}
function frame20(){
root.y = 3;
}
function frame13(){
root.y = -30;
}
override public function shootStuff(){
var a:int;
if (holy){
subCharge = (subCharge - 1.4);
};
if (subCharge < 5){
holy = false;
};
if (keyIsDown[leftKey]){
bxs = (bxs - 2);
} else {
if (keyIsDown[rightKey]){
bxs = (bxs + 2);
} else {
if (!((keyIsDown[mainKey]) || (keyIsDown[89]))){
bxs = 0;
};
};
};
bxs = (bxs * 0.7);
if (((((((((keyIsDown[mainKey]) || (keyIsDown[89]))) || (autoMain))) || (keyIsDown[1]))) && ((mainCharge > 6)))){
(root as Main).makeSound("flame", "p");
if (buff > 0){
parent.addChild(new FlameShot((x + bxs), (y - 18), (bxs + 1), -12, (bxs + 1), (baseDamage * 4)));
parent.addChild(new FlameShot((x + bxs), (y - 18), (bxs - 1), -12, (bxs - 1), (baseDamage * 4)));
if (mainCharge > 70){
a = 0;
while (a < 16) {
parent.addChild(new FlameShot((x + bxs), (y - 18), ((bxs + (Math.random() * 10)) - 5), (-8 - (Math.random() * 10)), bxs, (baseDamage * 4)));
a++;
};
mainCharge = (mainCharge - 12);
};
} else {
parent.addChild(new FlameShot((x + bxs), (y - 18), bxs, -12, bxs, (baseDamage * 4)));
if (mainCharge > 70){
a = 0;
while (a < 8) {
parent.addChild(new FlameShot((x + bxs), (y - 18), ((bxs + (Math.random() * 10)) - 5), (-8 - (Math.random() * 10)), bxs, (baseDamage * 4)));
a++;
};
mainCharge = (mainCharge - 14);
};
};
t++;
mainCharge = (mainCharge - 6);
};
if (bombCondition()){
doBomb();
};
}
override public function loadStats(){
playerNo = 2;
speed = (speed * 0.9);
baseDamage = (baseDamage * 1.02);
subChargeSpeed = (subChargeSpeed * 1.05);
}
override public function doBomb(){
var bomb:PlayerBomb;
bombs--;
bomb = new NatalieBomb(x, y, (baseDamage * 8), (parent as Level));
parent.addChild(bomb);
(parent as Level).useBomb();
(parent as Level).theBomb = bomb;
}
}
}//package players
Section 221
//NatalieBomb (players.NatalieBomb)
package players {
public class NatalieBomb extends PlayerBomb {
public function NatalieBomb(x, y, damage, level){
addFrameScript(0, frame1, 24, frame25, 80, frame81);
super(x, y, damage, level);
this.x = 0;
this.y = 0;
blower = false;
}
function frame81(){
if (this){
kill();
};
}
function frame1(){
(root as Main).makeSound("cross", "p");
}
function frame25(){
(root as Main).makeSound("nuke", "p");
active = true;
}
}
}//package players
Section 222
//NoLegs (players.NoLegs)
package players {
import levels.*;
import shots.*;
public class NoLegs extends Player {
public function NoLegs(){
super();
addFrameScript(0, frame1, 1, frame2, 2, frame3, 3, frame4, 4, frame5, 5, frame6, 6, frame7, 7, frame8, 8, frame9, 9, frame10, 10, frame11, 11, frame12, 12, frame13, 13, frame14, 14, frame15, 15, frame16, 16, frame17, 17, frame18, 18, frame19, 19, frame20, 20, frame21, 37, frame38);
}
override public function statBonus(){
subChargeSpeed = (subChargeSpeed * 0.8);
}
function frame10(){
root.y = 50;
(root as Main).makeSound("hit", "p");
}
function frame16(){
root.y = 12;
}
function frame14(){
root.y = 20;
}
function frame15(){
root.y = -20;
}
function frame11(){
root.y = -50;
(root as Main).makeSound("meow2", "p");
}
function frame17(){
root.y = -12;
}
function frame18(){
root.y = 6;
}
function frame5(){
root.y = -12;
}
function frame7(){
root.y = -6;
}
function frame19(){
root.y = -6;
}
function frame9(){
root.y = 0;
if (((this) && (!(dead)))){
gotoAndStop(1);
};
}
function frame1(){
stop();
}
function frame3(){
root.y = -20;
(root as Main).makeSound("meow", "p");
}
function frame4(){
root.y = 12;
}
function frame8(){
root.y = 3;
}
function frame2(){
root.y = 20;
(root as Main).makeSound("hit", "p");
}
function frame38(){
stop();
end();
}
function frame21(){
root.y = 0;
}
override public function subAttack(){
if (subCharge == maxCharge){
(root as Main).makeSound("star3", "p");
shot = new SuperBigStarShot(x, y, (13 * spread), 0, (baseDamage * 2), (baseDamage * 3));
parent.addChild(shot);
parent.setChildIndex(shot, 1);
shot = new SuperBigStarShot(x, y, (-13 * spread), 0, (baseDamage * 2), (baseDamage * 3));
parent.addChild(shot);
parent.setChildIndex(shot, 1);
shot = new SuperBigStarShot(x, y, (9 * spread), 0, (baseDamage * 2), (baseDamage * 3));
parent.addChild(shot);
parent.setChildIndex(shot, 1);
shot = new SuperBigStarShot(x, y, (-9 * spread), 0, (baseDamage * 2), (baseDamage * 3));
parent.addChild(shot);
parent.setChildIndex(shot, 1);
shot = new BigStarShot(x, y, (15 * spread), 0, (baseDamage * 3));
parent.addChild(shot);
parent.setChildIndex(shot, 1);
shot = new BigStarShot(x, y, (-15 * spread), 0, (baseDamage * 3));
parent.addChild(shot);
parent.setChildIndex(shot, 1);
shot = new BigStarShot(x, y, (7 * spread), 0, (baseDamage * 3));
parent.addChild(shot);
parent.setChildIndex(shot, 1);
shot = new BigStarShot(x, y, (-7 * spread), 0, (baseDamage * 3));
parent.addChild(shot);
parent.setChildIndex(shot, 1);
subCharge = (subCharge - maxCharge);
} else {
if (subCharge > ((maxCharge * 3) / 4)){
(root as Main).makeSound("star3", "p");
shot = new BigStarShot(x, y, (14 * spread), 0, (baseDamage * 3));
parent.addChild(shot);
parent.setChildIndex(shot, 1);
shot = new BigStarShot(x, y, (-14 * spread), 0, (baseDamage * 3));
parent.addChild(shot);
parent.setChildIndex(shot, 1);
shot = new SuperBigStarShot(x, y, (12 * spread), 0, (baseDamage * 2), (baseDamage * 3));
parent.addChild(shot);
parent.setChildIndex(shot, 1);
shot = new SuperBigStarShot(x, y, (-12 * spread), 0, (baseDamage * 2), (baseDamage * 3));
parent.addChild(shot);
parent.setChildIndex(shot, 1);
shot = new BigStarShot(x, y, (9 * spread), 0, (baseDamage * 3));
parent.addChild(shot);
parent.setChildIndex(shot, 1);
shot = new BigStarShot(x, y, (-9 * spread), 0, (baseDamage * 3));
parent.addChild(shot);
parent.setChildIndex(shot, 1);
subCharge = (subCharge - ((maxCharge * 3) / 4));
} else {
if (subCharge > (maxCharge / 2)){
(root as Main).makeSound("star2", "p");
shot = new BigStarShot(x, y, (13 * spread), 0, (baseDamage * 3));
parent.addChild(shot);
parent.setChildIndex(shot, 1);
shot = new BigStarShot(x, y, (-13 * spread), 0, (baseDamage * 3));
parent.addChild(shot);
parent.setChildIndex(shot, 1);
shot = new BigStarShot(x, y, (9 * spread), 0, (baseDamage * 3));
parent.addChild(shot);
parent.setChildIndex(shot, 1);
shot = new BigStarShot(x, y, (-9 * spread), 0, (baseDamage * 3));
parent.addChild(shot);
parent.setChildIndex(shot, 1);
subCharge = (subCharge - (maxCharge / 2));
} else {
if (subCharge > (maxCharge / 4)){
(root as Main).makeSound("star2", "p");
shot = new BigStarShot(x, y, (12 * spread), 0, (baseDamage * 3));
parent.addChild(shot);
parent.setChildIndex(shot, 1);
shot = new BigStarShot(x, y, (-12 * spread), 0, (baseDamage * 3));
parent.addChild(shot);
parent.setChildIndex(shot, 1);
subCharge = (subCharge - (maxCharge / 4));
};
};
};
};
}
function frame6(){
root.y = 6;
}
function frame12(){
root.y = 40;
}
function frame20(){
root.y = 3;
}
function frame13(){
root.y = -30;
}
override public function shootStuff(){
while (((((((((keyIsDown[mainKey]) || (keyIsDown[89]))) || (autoMain))) || (keyIsDown[1]))) && ((mainCharge > 5)))) {
(root as Main).makeSound("star", "p");
parent.addChild(new StarShot(x, (y - 10), (((Math.random() * 4) - 2) * spread), (-7 - (Math.random() * 6)), (baseDamage * 3)));
mainCharge = (mainCharge - 5);
if (buff > 0){
parent.addChild(new StarShot(x, (y - 10), ((((Math.random() * 4) - 2) * spread) * 2), (-7 - (Math.random() * 6)), (baseDamage * 3)));
};
};
if (bombCondition()){
doBomb();
};
}
override public function loadStats(){
playerNo = 0;
subChargeSpeed = (subChargeSpeed * 0.8);
}
override public function doBomb(){
var bomb:PlayerBomb;
bombs--;
bomb = new NoLegsBomb(x, y, (baseDamage * 1.5), (parent as Level));
parent.addChild(bomb);
parent.setChildIndex(bomb, 1);
(parent as Level).useBomb();
(parent as Level).theBomb = bomb;
}
}
}//package players
Section 223
//NoLegsBomb (players.NoLegsBomb)
package players {
import shots.*;
public class NoLegsBomb extends PlayerBomb {
public function NoLegsBomb(x, y, damage, level){
addFrameScript(0, frame1, 1, frame2, 8, frame9, 26, frame27);
super(x, y, damage, level);
}
function pew(){
parent.addChild(new SuperBigStarShot(x, y, (12 * 2), -6, (damage * 2), damage));
parent.addChild(new SuperBigStarShot(x, y, (-12 * 2), -6, (damage * 2), damage));
}
function frame1(){
(root as Main).makeSound("starbomb", "p");
}
override public function kill(){
this.stop();
active = false;
if (this){
parent.removeChild(this);
};
}
function frame9(){
if (this){
nextStar();
};
}
function frame2(){
pew();
}
function frame27(){
if (this){
kill();
};
}
function nextStar(){
parent.addChild(new StarBomb(damage, 2, level));
}
}
}//package players
Section 224
//Player (players.Player)
package players {
import levels.*;
import flash.display.*;
import foes.*;
import bullets.*;
import shots.*;
public class Player extends MovieClip {
public var autoMain:Boolean;// = false
public var bombs:int;// = 0
public var recoveryRate:Number;
var aa:int;// = 0
public var keyIsDown:Array;
public var speed:Number;// = 10
public var blue:MovieClip;
public var buff:int;// = 0
var sq:Number;
public var focusKey:Number;// = 16
public var autoFocus:Boolean;// = false
public var damageUp:Number;
public var dead:Boolean;// = false
public var t:int;// = 0
public var bombKey:Number;// = 67
public var downKey:Number;// = 40
public var superArmor:Number;// = 90
public var playerNo:int;// = -1
var dx:Number;
public var rightKey:Number;// = 39
var dy:Number;
public var mainChargeSpeed:Number;// = 3.3
public var bounced:int;// = 0
public var leftKey:Number;// = 37
public var shot:Shot;
public var HP:Number;// = 3
public var subCharge:Number;// = 0
public var subLevel:Number;
public var shieldOn:int;// = 0
public var autoFocusKey:Number;// = 81
public var maxCharge;// = 100
public var bulletUp:Number;
public var autoMainKey:Number;// = 65
public var maxSpeed:Number;// = 10
var kc:int;// = 0
public var focusDot:MovieClip;
public var magnet:Number;// = 0
public var shield:MovieClip;
public var maxHP:Number;// = 3
public var spread:Number;// = 1
public var level:int;// = 0
public var baseDamage:Number;// = 3
public var subChargeSpeed:Number;// = 0.9
public var mainCharge:Number;// = 0
public var upKey:Number;// = 38
public var mainKey:Number;// = 90
public var grabRadius:Number;
public var subKey:Number;// = 88
public static var magnetLevel:int = 0;
public static var bombLevel:int = 0;
public static var speedTree:Array = [[9, 0], [10, 100], [11, 500], [12, 2000]];
public static var mainDamageTree:Array = [[1, 0], [1.3, 50], [1.6, 150], [2, 300], [2.4, 700], [2.8, 1500], [3.2, 3000], [3.6, 6000], [4, 12000]];
public static var healthLevel:int = 0;
public static var mainChargeTree:Array = [[0.7, 0], [1, 30], [1.3, 100], [1.7, 200], [2.1, 500], [2.5, 1200], [3, 3000], [3.6, 6000]];
public static var subChargeTree:Array = [[0.13, 0], [0.2, 30], [0.26, 70], [0.33, 150], [0.4, 400], [0.46, 1100], [0.52, 2200], [0.59, 4000], [0.65, 8000]];
public static var healthTree:Array = [[3, 0], [4, 40], [5, 160], [6, 400], [7, 1500], [8, 3500], [9, 10000]];
public static var mainDamageLevel:int = 0;
public static var subChargeLevel:int = 0;
public static var bombTree:Array = [[1, 0], [2, 800], [3, 6000]];
public static var magnetTree:Array = [[0, 0], [2, 30], [3, 80], [4, 150], [6, 300], [8, 600], [10, 1200], [12, 2000], [15, 4000]];
public static var mainChargeLevel:int = 0;
public static var speedLevel:int = 0;
public function Player(){
keyIsDown = [];
speed = 10;
magnet = 0;
maxSpeed = 10;
bounced = 0;
mainCharge = 0;
subCharge = 0;
mainChargeSpeed = (1.1 * 3);
subChargeSpeed = (0.3 * 3);
maxCharge = 100;
baseDamage = 3;
maxHP = 3;
HP = 3;
superArmor = 90;
autoMain = false;
autoFocus = false;
spread = 1;
mainKey = 90;
subKey = 88;
bombKey = 67;
focusKey = 16;
autoMainKey = 65;
autoFocusKey = 81;
upKey = 38;
leftKey = 37;
rightKey = 39;
downKey = 40;
dead = false;
bombs = 0;
shieldOn = 0;
buff = 0;
t = 0;
kc = 0;
playerNo = -1;
level = 0;
aa = 0;
super();
focusDot = new FocusDot();
addChild(focusDot);
focusDot.alpha = 0;
}
public function survivalStats(){
mainChargeSpeed = 1;
subChargeSpeed = 0.2;
baseDamage = 1;
magnet = 15;
speed = 12;
maxHP = 9;
HP = 9;
bombs = 3;
if (playerNo == 1){
bombs++;
};
if (playerNo == 2){
speed = (speed * 0.9);
};
if (playerNo == 1){
speed = (speed * 0.95);
};
statBonus();
}
public function keyDownGet(e:Number){
if (!keyIsDown[e]){
if (!(parent as Level).pause){
if (!(parent as Level).pause){
if (e == subKey){
subAttack();
};
if (e == -2){
subAttack();
};
if ((((e == autoFocusKey)) && (false))){
autoFocus = !(autoFocus);
};
if ((((e == autoMainKey)) && (false))){
autoMain = !(autoMain);
};
};
};
if ((((((e == 80)) || ((e == 27)))) || ((e == 17)))){
(parent as Level).pauseGame();
};
};
}
public function statBonus(){
}
public function setStatTrees(){
}
public function getShield(){
shieldOn = 240;
shield.visible = true;
Medals.stats.powerUps++;
}
public function setup(){
if ((parent is Level)){
keyIsDown = (parent as Level).keyIsDown;
x = ((parent as Level).xlimit / 2);
y = ((parent as Level).ylimit - 100);
};
shield = new Shield();
this.addChild(shield);
blue = new BlueGlow();
this.addChild(blue);
autoMain = Global.vars.options[7];
baseDamage = mainDamageTree[Player.mainDamageLevel][0];
mainChargeSpeed = mainChargeTree[Player.mainChargeLevel][0];
subChargeSpeed = subChargeTree[Player.subChargeLevel][0];
maxHP = healthTree[Player.healthLevel][0];
HP = maxHP;
magnet = magnetTree[Player.magnetLevel][0];
speed = speedTree[Player.speedLevel][0];
bombs = (bombLevel + 1);
loadStats();
}
public function getHeart(){
HP = (HP + 1);
if (HP > maxHP){
HP = maxHP;
};
}
public function bombCondition(){
return (((((((keyIsDown[bombKey]) || (keyIsDown[32]))) && (!((parent as Level).bomb)))) && ((bombs > 0))));
}
public function subAttack(){
}
public function getBuff(){
buff = 360;
blue.visible = true;
Medals.stats.powerUps++;
}
public function end(){
trace("DEAD!");
(parent as Level).endLevel();
}
public function shootStuff(){
}
public function levelUp(){
level++;
if (level == 10){
level = 9;
};
mainChargeSpeed = (1 + (3.5 / (10 - level)));
subChargeSpeed = (0.2 + (0.6 / (10 - level)));
baseDamage = (1 + (3.5 / (10 - level)));
trace(("LEVEL UP!!: " + level));
trace(((((("" + mainChargeSpeed) + " ") + subChargeSpeed) + " ") + baseDamage));
statBonus();
}
public function loadStats(){
}
public function shieldBounce(){
var i:int;
var bullet:Bullet;
var nb:HolyShot;
if (shieldOn != 0){
shieldOn--;
if (shieldOn < 60){
shield.visible = !(shield.visible);
};
i = 0;
while (i < Global.vars.bulletArray.length) {
bullet = Global.vars.bulletArray[i];
if (this.hitTestPoint(bullet.x, bullet.y, true)){
(root as Main).makeSound("shield2", "i");
nb = new HolyShot(bullet.x, bullet.y, ((-(bullet.xspeed) * 1.5) * ((Math.random() / 2) + 0.8)), ((-(bullet.yspeed) * 1.5) * ((Math.random() / 2) + 0.8)), (baseDamage * 2));
if ((((((nb.xspeed < 2)) && ((nb.xspeed > -2)))) && ((((nb.yspeed < 2)) && ((nb.yspeed > -2)))))){
nb.yspeed = -2.5;
};
parent.addChild(nb);
bullet.kill();
i--;
bounced++;
if (bounced == 100){
Medals.unlockMedal("Counter Attack");
};
};
i++;
};
} else {
shield.visible = false;
bounced = 0;
};
}
public function hit(){
if ((((((superArmor <= 0)) && (!((parent as Level).bomb)))) && (!(dead)))){
(parent as Level).addCombo(-10);
(parent as Level).addHit();
play();
HP = (HP - 1);
Medals.stats.damage++;
superArmor = 90;
if (HP == 0){
focusDot.alpha = 0;
mainCharge = 0;
subCharge = 0;
dead = true;
gotoAndPlay("die");
if (Global.vars.bullets >= 666){
Medals.unlockMedalNo(26);
};
if (((((parent as Level).foeList.length == 0)) || (((((parent as Level).foeList.length == 1)) && ((((parent as Level).foeList[0] as Foe).HP <= 0)))))){
Medals.unlockMedal("Stray Bullets");
};
};
};
}
public function move(){
if (!dead){
if ((((superArmor > 0)) || ((parent as Level).bomb))){
superArmor--;
alpha = (1 - alpha);
} else {
alpha = 1;
};
mainCharge = (mainCharge + mainChargeSpeed);
subCharge = (subCharge + subChargeSpeed);
spread = 1;
if (mainCharge > maxCharge){
mainCharge = maxCharge;
};
if (subCharge > maxCharge){
subCharge = maxCharge;
};
if (((((keyIsDown[focusKey]) && (!(Global.vars.options[8])))) || (((!(keyIsDown[focusKey])) && (Global.vars.options[8]))))){
speed = (speed * 0.5);
spread = 0.5;
};
if ((root as Main).mouse){
dx = (root.mouseX - this.x);
dy = (root.mouseY - this.y);
sq = Math.sqrt((Math.pow(dx, 2) + Math.pow(dy, 2)));
if (sq > speed){
x = (x + ((speed / sq) * dx));
y = (y + ((speed / sq) * dy));
} else {
x = (x + dx);
y = (y + dy);
};
keyIsDown[rightKey] = (keyIsDown[leftKey] = (keyIsDown[upKey] = (keyIsDown[downKey] = false)));
if ((((dx > (dy / 3))) && ((dx > 3)))){
keyIsDown[rightKey] = true;
};
if ((((dx < (dy / 3))) && ((dx < -3)))){
keyIsDown[leftKey] = true;
};
if ((((dy > (dx / 3))) && ((dy > 3)))){
keyIsDown[downKey] = true;
};
if ((((dy < (dx / 3))) && ((dy < -3)))){
keyIsDown[upKey] = true;
};
} else {
kc = 0;
if (keyIsDown[leftKey]){
kc++;
};
if (keyIsDown[upKey]){
kc++;
};
if (keyIsDown[rightKey]){
kc++;
};
if (keyIsDown[downKey]){
kc++;
};
if (kc > 1){
speed = (speed * 0.8);
};
if (keyIsDown[leftKey]){
x = (x - speed);
};
if (keyIsDown[upKey]){
y = (y - speed);
};
if (keyIsDown[rightKey]){
x = (x + speed);
};
if (keyIsDown[downKey]){
y = (y + speed);
};
if (kc > 1){
speed = (speed / 0.8);
};
};
if (((((keyIsDown[focusKey]) && (!(Global.vars.options[8])))) || (((!(keyIsDown[focusKey])) && (Global.vars.options[8]))))){
speed = (speed * 2);
focusDot.alpha = 1;
} else {
focusDot.alpha = 0;
};
shootStuff();
shieldBounce();
if (buff < 60){
blue.visible = !(blue.visible);
};
if (buff < 1){
blue.visible = false;
};
if (x > 500){
x = 500;
};
if (y > 598){
y = 598;
};
if (x < 2){
x = 2;
};
if (y < 2){
y = 2;
};
buff--;
};
}
public function doBomb(){
}
}
}//package players
Section 225
//PlayerBomb (players.PlayerBomb)
package players {
import levels.*;
import flash.display.*;
import foes.*;
import bullets.*;
public class PlayerBomb extends MovieClip {
public var active:Boolean;// = true
public var damage:Number;
public var level:Level;
public var blower:Boolean;// = true
public function PlayerBomb(x, y, damage, level){
active = true;
blower = true;
super();
this.x = x;
this.y = y;
this.damage = damage;
this.level = level;
stop();
Medals.unlockMedal("Boom");
}
public function kill(){
(parent as Level).bomb = false;
this.stop();
if (this){
parent.removeChild(this);
};
}
function special(){
}
public function onFrame(){
var bullet:Bullet;
var i:int;
var foes:Array;
var f:Foe;
special();
if (active){
i = 0;
while (i < Global.vars.bulletArray.length) {
bullet = Global.vars.bulletArray[i];
if (this.hitTestPoint(bullet.x, bullet.y, true)){
if (blower){
bullet.yspeed = (bullet.yspeed - 2);
if (bullet.yspeed == 0){
bullet.yspeed = -1;
};
} else {
bullet.kill();
i--;
};
};
i++;
};
foes = (parent as Level).foeList;
for each (f in foes) {
if (((((this.hitTestPoint(f.x, f.y, true)) && (!(f.dead)))) && (!((f.superArmor > 0))))){
f.hit(damage);
};
};
};
nextFrame();
}
}
}//package players
Section 226
//ArrowShot (shots.ArrowShot)
package shots {
import particles.*;
public class ArrowShot extends Shot {
public function ArrowShot(x:Number, y:Number, xspeed:Number, yspeed:Number, rotation:Number, damage:Number){
super(x, y, xspeed, yspeed, damage);
alpha = 0.5;
this.rotation = rotation;
}
override function death(){
parent.addChild(new SmashParticle(x, (y - 20)));
}
}
}//package shots
Section 227
//BigStarShot (shots.BigStarShot)
package shots {
import levels.*;
import particles.*;
public class BigStarShot extends Shot {
public function BigStarShot(x:Number, y:Number, xspeed:Number, yspeed:Number, damage:Number){
super(x, y, xspeed, yspeed, damage);
HP = (20 * damage);
}
override function death(){
parent.addChild(new YellowParticle(x, y));
parent.addChild(new YellowParticle(x, y));
parent.addChild(new YellowParticle(x, y));
parent.addChild(new YellowParticle(x, y));
parent.addChild(new YellowParticle(x, y));
}
override public function onFrame(){
if (xspeed > 0){
xspeed = (xspeed - 0.5);
} else {
if (xspeed < 0){
xspeed = (xspeed + 0.5);
} else {
yspeed = (yspeed - 1);
};
};
x = (x + xspeed);
y = (y + yspeed);
if ((((x > ((parent as Level).xlimit + 10))) || ((x < (0 - 10))))){
xspeed = (xspeed * -1);
x = (x + xspeed);
};
if ((((y > ((parent as Level).ylimit + 10))) || ((y < (0 - 10))))){
kill();
} else {
hitStuff();
};
}
}
}//package shots
Section 228
//BulletBomb (shots.BulletBomb)
package shots {
import particles.*;
public class BulletBomb extends Shot {
var bullet:Shot;
var decel:Number;// = 2
var alim2:Number;// = 0
var level:Number;
var direction:String;// = ""
var alim:Number;// = 360
var time:Number;// = 30
var angle:Number;// = 0
public function BulletBomb(x:Number, y:Number, xspeed:Number, yspeed:Number, damage:Number, level:Number=1){
decel = 2;
angle = 0;
alim = 360;
alim2 = 0;
direction = "";
time = 30;
super(x, y, xspeed, yspeed, (damage * 3));
this.level = level;
HP = 20;
if (((!((yspeed == 0))) || (!((xspeed == 0))))){
alim = 90;
};
if ((((yspeed > 0)) && ((xspeed == 0)))){
alim2 = (135 + 180);
};
if ((((yspeed < 0)) && ((xspeed == 0)))){
alim2 = (-45 + 180);
};
if ((((yspeed < 0)) && ((xspeed > 0)))){
alim2 = -270;
};
if ((((yspeed < 0)) && ((xspeed < 0)))){
alim2 = -180;
};
if ((((yspeed > 0)) && ((xspeed > 0)))){
alim2 = 0;
};
if ((((yspeed > 0)) && ((xspeed < 0)))){
alim2 = -90;
};
if ((((yspeed == 0)) && ((xspeed < 0)))){
alim2 = (180 + 45);
};
if ((((yspeed == 0)) && ((xspeed > 0)))){
alim2 = 45;
};
this.xspeed = (int(((Math.random() * 10) - 5)) * 2);
time = int((40 - (Math.random() * 20)));
}
override function death(){
var a:Number;
(root as Main).makeSound("mine2", "p");
a = 0;
while (a < 30) {
parent.addChild(new OrangeParticle(x, y));
angle = ((Math.random() * alim) + alim2);
angle = (angle * (Math.PI / 180));
parent.addChild(new BulletShot(x, y, (Math.sin(angle) * 8), (Math.cos(angle) * 8), ((((angle / Math.PI) * 180) * -1) + 180), ((damage / 3) * 2)));
a++;
};
}
override function special():Boolean{
time--;
if (xspeed > 0){
xspeed = (xspeed - decel);
};
if (xspeed < 0){
xspeed = (xspeed + decel);
};
if (yspeed > 0){
yspeed = (yspeed - decel);
};
if (yspeed < 0){
yspeed = (yspeed + decel);
};
if (time == 0){
die();
return (true);
};
return (false);
}
}
}//package shots
Section 229
//BulletShot (shots.BulletShot)
package shots {
import particles.*;
public class BulletShot extends Shot {
public function BulletShot(x:Number, y:Number, xspeed:Number, yspeed:Number, rotation:Number, damage:Number){
super(x, y, xspeed, yspeed, damage);
alpha = 0.4;
this.rotation = rotation;
}
override function death(){
parent.addChild(new OrangeParticle(x, y));
}
}
}//package shots
Section 230
//FlameShot (shots.FlameShot)
package shots {
import particles.*;
public class FlameShot extends Shot {
public function FlameShot(x:Number, y:Number, xspeed:Number, yspeed:Number, rotation:Number, damage:Number){
super(x, y, xspeed, yspeed, damage);
alpha = 0.6;
this.rotation = rotation;
}
override function death(){
parent.addChild(new OrangeParticle(x, y));
}
}
}//package shots
Section 231
//HolyBallShot (shots.HolyBallShot)
package shots {
import players.*;
public class HolyBallShot extends Shot {
var an:Number;// = 0
public var dead:Boolean;// = false
var p:Player;
var alim2:Number;// = 0
var delay:Number;// = 0
var direction:String;// = ""
var alim:Number;// = 360
var time:Number;// = 30
var angle:Number;// = 0
var accel:Number;// = 1
public function HolyBallShot(x:Number, y:Number, xspeed, yspeed, p:Player, side:int){
angle = 0;
alim = 360;
alim2 = 0;
direction = "";
time = 30;
dead = false;
accel = 1;
delay = 0;
an = 0;
addFrameScript(8, frame9, 13, frame14);
super(0, 0, 0, 0, (p.baseDamage * 1.4));
alpha = 0.7;
this.HP = Infinity;
this.p = p;
size = 2000;
this.scaleX = (this.scaleX * 0.7);
this.scaleY = (this.scaleY * 0.7);
an = (180 * side);
}
function frame14(){
kill();
}
function frame9(){
stop();
}
override function special():Boolean{
if ((((delay == 0)) && (!(dead)))){
delay = 5;
parent.addChild(new FlameShot(x, y, ((Math.random() * 6) - 3), (-8 - (Math.random() * 4)), 0, (p.baseDamage * 3)));
};
delay--;
an = (an + 0.2);
this.x = (p.x + (Math.cos(an) * 140));
this.y = (p.y + (Math.sin(an) * 200));
if ((((p.subCharge < 5)) || (dead))){
if (p.subCharge < 5){
(p as Natalie).holy = false;
};
dead = true;
play();
};
return (false);
}
}
}//package shots
Section 232
//HolyShot (shots.HolyShot)
package shots {
import particles.*;
public class HolyShot extends Shot {
public function HolyShot(x:Number, y:Number, xspeed:Number, yspeed:Number, damage:Number){
super(x, y, xspeed, yspeed, damage);
alpha = 0.6;
if ((((((((yspeed > -2)) && ((yspeed < 2)))) && ((xspeed > -2)))) && ((xspeed < 2)))){
yspeed = -2;
};
}
override function death(){
parent.addChild(new HolyParticle(x, y));
}
}
}//package shots
Section 233
//HugeSwordShot (shots.HugeSwordShot)
package shots {
import players.*;
import particles.*;
public class HugeSwordShot extends Shot {
var bullet:Shot;
var decel:Number;// = 2
var p:Player;
var level:Number;
var direction:String;// = ""
var time:Number;// = 30
var angle:Number;// = 0
public function HugeSwordShot(x:Number, y:Number, xspeed:Number, yspeed:Number, damage:Number, HP:Number, p:Player, b:Boolean=false){
decel = 2;
angle = 0;
direction = "";
time = 30;
addFrameScript(19, frame20);
super(x, y, xspeed, yspeed, damage);
alpha = 0.7;
this.HP = Infinity;
if ((((yspeed > 0)) && ((xspeed == 0)))){
rotation = 180;
if (b){
this.scaleX = (this.scaleX * 1.5);
this.scaleY = (this.scaleY * 1.5);
};
};
if ((((yspeed < 0)) && ((xspeed == 0)))){
rotation = 0;
if (b){
this.scaleX = (this.scaleX * 1.5);
this.scaleY = (this.scaleY * 1.5);
};
};
if ((((yspeed < 0)) && ((xspeed > 0)))){
rotation = 45;
};
if ((((yspeed < 0)) && ((xspeed < 0)))){
rotation = -45;
};
if ((((yspeed > 0)) && ((xspeed > 0)))){
rotation = 135;
};
if ((((yspeed > 0)) && ((xspeed < 0)))){
rotation = -135;
};
if ((((yspeed == 0)) && ((xspeed < 0)))){
rotation = 270;
if (b){
this.scaleX = (this.scaleX * 1.5);
this.scaleY = (this.scaleY * 1.5);
};
};
if ((((yspeed == 0)) && ((xspeed > 0)))){
rotation = 90;
if (b){
this.scaleX = (this.scaleX * 1.5);
this.scaleY = (this.scaleY * 1.5);
};
};
this.xspeed = 0;
this.yspeed = 0;
this.p = p;
}
function frame20(){
if (this){
this.kill();
};
}
override function death(){
var a:Number;
play();
a = 0;
while (a < 5) {
parent.addChild(new YellowParticle(x, y));
a++;
};
}
override function special():Boolean{
this.x = p.x;
this.y = p.y;
HP--;
if (HP == 0){
death();
return (true);
};
return (false);
}
override public function spark(x:Number, y:Number){
}
}
}//package shots
Section 234
//LeafShot (shots.LeafShot)
package shots {
import particles.*;
public class LeafShot extends Shot {
public function LeafShot(x:Number, y:Number, xspeed:Number, yspeed:Number, rotation:Number, damage:Number){
super(x, y, xspeed, yspeed, damage);
alpha = 0.4;
this.rotation = rotation;
}
override function death(){
parent.addChild(new LeafParticle(x, y));
parent.addChild(new LeafParticle(x, y));
}
}
}//package shots
Section 235
//Shot (shots.Shot)
package shots {
import levels.*;
import flash.display.*;
import foes.*;
public class Shot extends MovieClip {
public var size:int;// = 10
public var HP:Number;
public var dead2:Boolean;// = false
public var yspeed:Number;
public var damage:Number;
public var bounce:Number;// = 0
public var xspeed:Number;
public function Shot(x:Number, y:Number, xspeed:Number, yspeed:Number, damage:Number, rotation:Number=INF){
bounce = 0;
dead2 = false;
size = 10;
super();
this.damage = damage;
this.x = x;
this.y = y;
this.xspeed = xspeed;
this.yspeed = yspeed;
if (rotation != Infinity){
this.rotation = rotation;
};
HP = 1;
cacheAsBitmap = true;
Global.vars.shotArray.push(this);
}
function hitStuff(){
var foes:Array;
var f:Foe;
foes = (parent as Level).foeList;
for each (f in foes) {
if (((((this.hitTestObject(f)) && (!(f.dead)))) && (!((f.superArmor > 0))))){
f.hit(damage);
HP = (HP - damage);
if (f){
spark(f.x, f.y);
};
if (HP < 0){
die();
break;
};
};
};
}
public function kill(){
Global.vars.shotArray.splice(Global.vars.shotArray.indexOf(this), 1);
this.stop();
dead2 = true;
if (this){
parent.removeChild(this);
};
}
function death(){
}
public function die(){
death();
kill();
}
function special():Boolean{
return (false);
}
public function onFrame(){
x = (x + xspeed);
y = (y + yspeed);
if (special()){
} else {
if ((((x > ((parent as Level).xlimit + size))) || ((x < -(size))))){
kill();
} else {
if ((((y > ((parent as Level).ylimit + size))) || ((y < -(size))))){
kill();
} else {
hitStuff();
};
};
};
}
public function spark(x:Number, y:Number){
}
}
}//package shots
Section 236
//StarBomb (shots.StarBomb)
package shots {
import levels.*;
import foes.*;
import bullets.*;
public class StarBomb extends Shot {
public var active:Boolean;// = true
var repeats:Number;
public var level:Level;
public function StarBomb(damage:Number, repeats:Number, level:Level){
active = true;
addFrameScript(0, frame1, 1, frame2, 14, frame15, 26, frame27);
super(0, 0, 0, 0, damage);
height = (height * 0.7);
width = (width * 0.7);
this.x = ((Math.random() * 400) + 100);
this.y = ((Math.random() * 500) + 100);
this.repeats = repeats;
this.level = level;
stop();
}
function pew(){
parent.addChild(new BigStarShot(x, y, 12, -3, (damage * 2)));
parent.addChild(new BigStarShot(x, y, -12, -3, (damage * 2)));
}
function frame15(){
if (this){
nextStar();
};
}
function frame1(){
(root as Main).makeSound("starbomb", "p");
}
function frame27(){
if (this){
kill2();
};
}
function kill2(){
if (repeats == 0){
(parent as Level).bomb = false;
};
kill();
}
override public function onFrame(){
var i:int;
var foes:Array;
var f:Foe;
var bullet:Bullet;
special();
if (active){
i = 0;
while (i < Global.vars.bulletArray.length) {
bullet = Global.vars.bulletArray[i];
if (this.hitTestPoint(bullet.x, bullet.y, true)){
bullet.yspeed = (bullet.yspeed - 2);
if (bullet.yspeed == 0){
bullet.yspeed = -1;
};
};
i++;
};
foes = (parent as Level).foeList;
for each (f in foes) {
if (((((this.hitTestPoint(f.x, f.y, true)) && (!(f.dead)))) && (!((f.superArmor > 0))))){
f.hit(damage);
};
};
};
nextFrame();
}
function nextStar(){
if (repeats != 0){
parent.addChild(new StarBomb(damage, (repeats - 1), level));
};
}
function frame2(){
pew();
}
}
}//package shots
Section 237
//StarShot (shots.StarShot)
package shots {
import particles.*;
public class StarShot extends Shot {
public function StarShot(x:Number, y:Number, xspeed:Number, yspeed:Number, damage:Number){
super(x, y, xspeed, yspeed, damage);
alpha = 0.4;
height = (height * 0.5);
width = (width * 0.5);
}
override function death(){
parent.addChild(new YellowParticle(x, y));
}
}
}//package shots
Section 238
//SuperBigStarShot (shots.SuperBigStarShot)
package shots {
import levels.*;
import particles.*;
public class SuperBigStarShot extends Shot {
var c:Number;// = 0
var damage2:Number;
public function SuperBigStarShot(x:Number, y:Number, xspeed:Number, yspeed:Number, damage:Number, damage2:Number){
c = 0;
super(x, y, xspeed, yspeed, damage);
this.damage2 = damage2;
height = (height * 1.5);
width = (width * 1.5);
HP = (30 * damage);
}
override function death(){
parent.addChild(new YellowParticle(x, y));
parent.addChild(new YellowParticle(x, y));
parent.addChild(new YellowParticle(x, y));
parent.addChild(new YellowParticle(x, y));
parent.addChild(new YellowParticle(x, y));
parent.addChild(new YellowParticle(x, y));
}
override public function onFrame(){
if (xspeed > 0){
xspeed = (xspeed - 0.5);
} else {
if (xspeed < 0){
xspeed = (xspeed + 0.5);
} else {
yspeed = (yspeed - 1);
};
};
x = (x + xspeed);
y = (y + yspeed);
c++;
if (((((c % 4) == 0)) && ((yspeed < -4)))){
parent.addChild(new StarShot(x, y, ((Math.random() * 4) - 2), (yspeed / 2), damage2));
};
if ((((x > ((parent as Level).xlimit + 10))) || ((x < -10)))){
xspeed = (xspeed * -1);
x = (x + xspeed);
};
if ((((y > ((parent as Level).ylimit + 10))) || ((y < -10)))){
kill();
} else {
hitStuff();
};
}
}
}//package shots
Section 239
//SwordShot (shots.SwordShot)
package shots {
import particles.*;
public class SwordShot extends Shot {
public function SwordShot(x:Number, y:Number, xspeed:Number, yspeed:Number, rotation:Number, damage:Number){
super(x, y, xspeed, yspeed, damage);
alpha = 0.5;
this.rotation = rotation;
}
override function death(){
parent.addChild(new YellowParticle(x, y));
parent.addChild(new YellowParticle(x, y));
}
}
}//package shots
Section 240
//TreeShot (shots.TreeShot)
package shots {
import players.*;
import particles.*;
public class TreeShot extends Shot {
var bullet:Shot;
var decel:Number;// = 2
var position:Boolean;
public var dead:Boolean;// = false
var p:Player;
var delay:Number;// = -10
var level:Number;
var direction:String;// = ""
var time:Number;// = 30
var angle:Number;// = 0
public function TreeShot(x:Number, y:Number, position:Boolean, p:Player){
decel = 2;
angle = 0;
direction = "";
time = 30;
dead = false;
delay = -10;
addFrameScript(12, frame13, 30, frame31);
super(x, y, 0, 0, 1);
alpha = 0.5;
this.HP = Infinity;
this.xspeed = 0;
this.yspeed = 0;
this.p = p;
this.position = position;
if (position){
this.scaleX = (this.scaleX * -1);
};
}
function frame13(){
stop();
}
override function special():Boolean{
var a:int;
if (delay == -10){
a = 0;
while (a < 2) {
parent.addChild(new LeafShot(x, (y - 25), ((Math.random() * 20) - 10), (-10 - (Math.random() * 8)), 0, (p.baseDamage * 2)));
a++;
};
delay = 0;
};
if ((((delay == 0)) && (!(dead)))){
delay = 4;
(root as Main).makeSound("leaf", "p");
parent.addChild(new LeafShot(x, (y - 25), ((Math.random() * 20) - 10), -15, 0, (p.baseDamage * 2)));
};
delay--;
if (position){
this.x = (p.x + 70);
} else {
this.x = (p.x - 70);
};
this.y = p.y;
if ((((p.subCharge < 5)) || (dead))){
if (p.subCharge < 5){
(p as Anna).trees = false;
};
dead = true;
play();
};
if (x < 0){
x = 0;
};
if (x > 500){
x = 500;
};
return (true);
}
function frame31(){
kill();
}
override public function spark(x:Number, y:Number){
parent.addChild(new LeafParticle(x, (y - 15)));
}
}
}//package shots
Section 241
//BGM (BGM)
package {
import flash.events.*;
import flash.media.*;
public class BGM {
static var paus:Boolean = false;
static var thisSong:String = "1";
static var mute:Boolean = false;
static var volume:Number = 0;
static var music:SoundChannel = new SoundChannel();
static var nextSong:String = "";
static var maxvol:Number = 1;
static var fader:SoundTransform = new SoundTransform();
static var fade:Boolean = false;
public function BGM(){
super();
}
public static function stop(){
music.stop();
}
public static function resume(){
trace("Resume music.");
paus = false;
volume = maxvol;
setVolume();
}
static function getSong():Sound{
if (nextSong == "starMusic"){
return (new starMusic());
};
if (nextSong == "waterMusic"){
return (new waterMusic());
};
if (nextSong == "spaceMusic"){
return (new spaceMusic());
};
if (nextSong == "neverMusic"){
return (new rainMusic());
};
if (nextSong == "menuMusic"){
return (new menuMusic());
};
if (nextSong == "bossMusic"){
return (new bossMusic());
};
return (new starMusic());
}
static function setVolume(){
fader.volume = volume;
music.soundTransform = fader;
}
public static function loop(e:Event){
if (!Global.vars.options[5]){
volume = 0;
} else {
if (paus){
volume = 0.2;
} else {
if ((((volume < maxvol)) && (fade))){
volume = (volume + 0.02);
};
if ((((volume > 0)) && (!(fade)))){
volume = (volume - 0.02);
};
if ((((volume <= 0)) && (!((nextSong == ""))))){
music.stop();
trace(("Playing music: " + nextSong));
music = getSong().play(0, int.MAX_VALUE);
music.soundTransform = fader;
thisSong = nextSong;
nextSong = "";
volume = 0.02;
fade = true;
};
};
};
setVolume();
}
public static function play(track:String){
paus = false;
if (!(((thisSong == track)) && (fade))){
trace("Prepared next song.");
fade = false;
nextSong = track;
} else {
trace("Same song already playing.");
};
}
public static function pause(){
trace("Pause music.");
paus = true;
volume = 0.2;
setVolume();
}
}
}//package
Section 242
//BlueGlow (BlueGlow)
package {
import flash.display.*;
public dynamic class BlueGlow extends MovieClip {
public function BlueGlow(){
super();
}
}
}//package
Section 243
//bossMusic (bossMusic)
package {
import flash.media.*;
public dynamic class bossMusic extends Sound {
public function bossMusic(){
super();
}
}
}//package
Section 244
//fire (fire)
package {
import flash.display.*;
public dynamic class fire extends MovieClip {
public function fire(){
super();
addFrameScript(25, frame26);
}
function frame26(){
if (this){
parent.removeChild(this);
};
}
}
}//package
Section 245
//FocusDot (FocusDot)
package {
import flash.display.*;
public dynamic class FocusDot extends MovieClip {
public function FocusDot(){
super();
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package
Section 246
//GetReady (GetReady)
package {
import levels.*;
import flash.events.*;
import flash.media.*;
import flash.display.*;
import flash.utils.*;
import flash.text.*;
import flash.net.*;
import flash.ui.*;
import flash.system.*;
import flash.geom.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.external.*;
import flash.filters.*;
import flash.printing.*;
import flash.xml.*;
public dynamic class GetReady extends MovieClip {
public var start:SimpleButton;
public var tip:MovieClip;
public function GetReady(){
super();
addFrameScript(0, frame1, 1, frame2, 2, frame3, 10, frame11, 90, frame91, 113, frame114);
}
function frame91(){
(parent as Level).wait--;
(parent as Level).background.tiles.play();
}
function frame3(){
tip.gotoAndStop((parent as Level).levelNo);
}
function frame1(){
visible = false;
}
function frame2(){
visible = true;
if ((root as Main).levelRanks[(parent as Level).levelNo] > 1){
gotoAndPlay("notip");
};
}
function frame114(){
(parent as Level).ready = null;
stage.focus = stage;
parent.removeChild(this);
}
function frame11(){
stop();
getChildByName("start").addEventListener(MouseEvent.CLICK, function (e:Event=null){
play();
});
}
}
}//package
Section 247
//Global (Global)
package {
public class Global {
public static var vars:Object = {};
public function Global(){
super();
}
}
}//package
Section 248
//LevelEnd (LevelEnd)
package {
import levels.*;
import flash.events.*;
import flash.display.*;
import flash.text.*;
public class LevelEnd extends MovieClip {
public var cheats:MovieClip;
public var scoreT:TextField;
public var moneyCollectedT:TextField;
var s1:String;// = "s1"
var s2:String;// = "s2"
var s3:String;// = "s3"
public var menu:SimpleButton;
public var foesKilledT:TextField;
public var waveT:TextField;
public var bestComboT:TextField;
public var retry:SimpleButton;
public var rankT:MovieClip;
public var hitsTakenT:TextField;
public var best2:MovieClip;
public var best3:MovieClip;
public var best4:MovieClip;
public var best1:MovieClip;
public var rr:int;// = 1
public var status:MovieClip;
public function LevelEnd(score:Number, foesKilled:String, hitsTaken:Number, bestCombo:Number, moneyCollected:Number, rank:Number){
var score = score;
var foesKilled = foesKilled;
var hitsTaken = hitsTaken;
var bestCombo = bestCombo;
var moneyCollected = moneyCollected;
var rank = rank;
s1 = "s1";
s2 = "s2";
s3 = "s3";
rr = 1;
super();
addFrameScript(0, frame1, 1, frame2);
scoreT.text = (s1 = String(score));
foesKilledT.text = (s2 = String(foesKilled));
bestComboT.text = String(bestCombo);
hitsTakenT.text = String(hitsTaken);
moneyCollectedT.text = String(moneyCollected);
getChildByName("menu").addEventListener(MouseEvent.CLICK, function (e:Event=null){
(parent as Level).exitLevel();
});
getChildByName("retry").addEventListener(MouseEvent.CLICK, function (e:Event=null){
(parent as Level).retryLevel();
});
}
function frame1(){
stop();
rankT.gotoAndStop(rr);
if (rr == 1){
rankT.gotoAndStop(9);
status.gotoAndStop(2);
};
}
function frame2(){
scoreT.text = s1;
foesKilledT.text = s2;
waveT.text = s3;
waveT.text = ("" + ((parent as Level).level as Level25).waveCount);
rankT.gotoAndStop(rr);
if (rr == 1){
rankT.gotoAndStop(9);
};
trace(("rank: " + rr));
}
}
}//package
Section 249
//Main (Main)
package {
import levels.*;
import flash.events.*;
import flash.display.*;
import mochi.as3.*;
import foes.*;
import flash.utils.*;
import flash.text.*;
import flash.net.*;
import players.*;
import CPMStar.*;
import flash.ui.*;
import bullets.*;
import shots.*;
import misc.*;
import flash.system.*;
import flash.geom.*;
public class Main extends MovieClip {
public var survivalWaves:int;// = 0
public var b1:SimpleButton;
public var b2:SimpleButton;
public var b3:SimpleButton;
public var b4:SimpleButton;
public var b5:SimpleButton;
public var b6:SimpleButton;
public var b8:SimpleButton;
public var b9:SimpleButton;
public var loader:Loader;
public var b7:SimpleButton;
public var ad:DisplayObject;
public var keyIsDown:Array;
public var showPlayer:MovieClip;
public var survivalKills:int;// = 0
public var musicLink2;
public var musicLink3;
public var li10:MovieClip;
public var li11:MovieClip;
public var li13:MovieClip;
public var li14:MovieClip;
public var li15:MovieClip;
public var li16:MovieClip;
public var li17:MovieClip;
public var li12:MovieClip;
public var li18:MovieClip;
public var e1:MovieClip;
public var e2:MovieClip;
public var e3:MovieClip;
public var e4:MovieClip;
public var e5:MovieClip;
public var e6:MovieClip;
public var li20:MovieClip;
public var tick10:MovieClip;
public var tick11:MovieClip;
public var tick12:MovieClip;
public var tick14:MovieClip;
public var tick16:MovieClip;
public var li22:MovieClip;
public var tick13:MovieClip;
public var li25:MovieClip;
public var tick15:MovieClip;
public var li21:MovieClip;
public var li24:MovieClip;
public var b:int;
public var delsel:SimpleButton;
public var tick17:MovieClip;
public var e7:MovieClip;
public var li23:MovieClip;
public var j:Number;
public var moreGames;
public var a:int;
public var ths:int;
public var levelRanks:Array;
public var CPMStarContentSpotID:String;
public var mouse:Boolean;// = false
public var li19:MovieClip;
public var mattLink3;
public var mattLink2;
public var levelScores:Array;
public var domain:String;
public var money:int;// = 0
public var cla:Class;
public var ii:int;
public var myMenu:ContextMenu;
public var paramObj:Object;
public var mattLink;
public var sounds:MovieClip;
public var moreGames2;
public var moreGames3;
public var jj:int;
public var countSound:int;// = 0
public var maxedStats:int;
public var apiPath:String;
public var selectedPlayer:Number;// = 1
public var m1:SimpleButton;
public var m2:SimpleButton;
public var m3:SimpleButton;
public var m6:SimpleButton;
public var m4:SimpleButton;
public var m5:SimpleButton;
public var fader:MovieClip;
public var playerUnlock:Boolean;// = false
public var mcc:MovieClip;
public var allowed:String;
public var selectedLevel:Number;// = 1
public var newGame:Boolean;
public var p0:MovieClip;
public var p1:MovieClip;
public var p2:MovieClip;
public var p3:MovieClip;
public var upgraded:MovieClip;
public var p4:MovieClip;
public var le2:TextField;
public var le3:TextField;
public var le4:TextField;
public var le5:TextField;
public var le6:TextField;
public var le7:TextField;
public var le1:TextField;
public var kongregate;
public var survivalScore:int;// = 0
public var levelicon:MovieClip;
public var r0:MovieClip;
public var r1:MovieClip;
public var r2:MovieClip;
public var r3:MovieClip;
public var r4:MovieClip;
public var r5:MovieClip;
public var r6:MovieClip;
public var r7:MovieClip;
public var r8:MovieClip;
public var r9:MovieClip;
public var r11:MovieClip;
public var r12:MovieClip;
public var r14:MovieClip;
public var r15:MovieClip;
public var r16:MovieClip;
public var r10:MovieClip;
public var r19:MovieClip;
public var r13:MovieClip;
public var s1:TextField;
public var r18:MovieClip;
public var s4:TextField;
public var s5:TextField;
public var s6:TextField;
public var s2:TextField;
public var s3:TextField;
public var medalDesc:TextField;
public var medalName:TextField;
public var r20:MovieClip;
public var r21:MovieClip;
public var r22:MovieClip;
public var r23:MovieClip;
public var startButton:SimpleButton;
public var tick2:MovieClip;
public var tick3:MovieClip;
public var tick4:MovieClip;
public var tick5:MovieClip;
public var tick8:MovieClip;
public var tick9:MovieClip;
public var t2:Number;// = 200000
public var tick1:MovieClip;
public var r25:MovieClip;
public var r17:MovieClip;
public var tick6:MovieClip;
public var tick7:MovieClip;
public var r24:MovieClip;
public var li0:MovieClip;
public var li2:MovieClip;
public var li3:MovieClip;
public var li4:MovieClip;
public var li5:MovieClip;
public var li6:MovieClip;
public var li8:MovieClip;
public var u1:SimpleButton;
public var u2:SimpleButton;
public var u3:SimpleButton;
public var u4:SimpleButton;
public var u5:SimpleButton;
public var li7:MovieClip;
public var u7:SimpleButton;
public var li9:MovieClip;
public var lastPage:String;
public var u6:SimpleButton;
public var t1:Number;// = 0
public var unlockedLevel:Number;// = 0
public var li1:MovieClip;
public var showLevel:MovieClip;
public var request:URLRequest;
public var mm1:TextField;
public var mm4:TextField;
public var mm5:TextField;
public var mm6:TextField;
public var mm7:TextField;
public var mm2:TextField;
public var mm3:TextField;
public var prevSound:String;// = ""
public var adBox:MovieClip;
public var playersUnlocked:Array;
public var playericon:MovieClip;
public var totalhigh:TextField;
public var medal:Object;
public var icons:Array;
public var medalBox:MovieClip;
public var mu1:SimpleButton;
public var mu2:SimpleButton;
public var mu3:SimpleButton;
public var mu5:SimpleButton;
public var mu6:SimpleButton;
public var mu4:SimpleButton;
public var moneyT:TextField;
public var konglink:SimpleButton;
public var level:Level;
public var mtt:TextField;
public var musicLink;
public var playerUpgrades:Array;
public var levelUnlock:Boolean;// = false
public function Main(){
selectedLevel = 1;
unlockedLevel = 0;
selectedPlayer = 1;
keyIsDown = [];
t1 = 0;
t2 = 200000;
money = 0;
levelRanks = [0];
playersUnlocked = [true, true, false, false, false];
levelScores = [];
levelUnlock = false;
playerUnlock = false;
playerUpgrades = [];
mouse = false;
prevSound = "";
countSound = 0;
survivalKills = 0;
survivalScore = 0;
survivalWaves = 0;
super();
addFrameScript(0, frame1, 1, frame2, 2, frame3, 3, frame4, 4, frame5, 5, frame6, 6, frame7, 7, frame8, 8, frame9, 9, frame10, 10, frame11);
MochiServices.connect("dc089a30e5985f83", root, onConnectError);
MochiEvents.trackEvent("viewed preloader");
Global.vars.bullets = 0;
Global.vars.foes = 0;
stage.addEventListener(KeyboardEvent.KEY_DOWN, keyDownGet);
stage.addEventListener(KeyboardEvent.KEY_UP, keyUpGet);
stage.addEventListener(MouseEvent.MOUSE_DOWN, mouseDown);
stage.addEventListener(MouseEvent.MOUSE_UP, mouseUp);
}
public function deleteData(){
if (Global.vars.options[9]){
trace("Reset progress & upgrades!");
levelRanks = [0];
money = 0;
Player.bombLevel = 0;
Player.mainChargeLevel = 0;
Player.subChargeLevel = 0;
Player.healthLevel = 0;
Player.speedLevel = 0;
Player.magnetLevel = 0;
Player.mainDamageLevel = 0;
saveGame();
};
if (Global.vars.options[10]){
trace("Reset medals & scores!");
Medals.locks = [];
Medals.stats = {kills:0, powerUps:0, damage:0, playerLevels:[0, 0, 0, 0, 0]};
levelScores = [];
survivalKills = 0;
survivalWaves = 0;
saveGame();
};
}
public function upgradePlayer(m:TextField, t:String, l:String, yy:int, e:Event=null){
if (money >= Number(m.text)){
money = (money - Number(m.text));
var _local6 = cla;
var _local7 = l;
var _local8 = (_local6[_local7] + 1);
_local6[_local7] = _local8;
showUpgrades();
(upgraded as MovieClip).gotoAndPlay(2);
(upgraded as MovieClip).y = (0 + (yy * 68));
saveGame();
trace(("UPGRADE " + l));
} else {
trace("NOT ENOUGH MONEY");
};
}
public function keyDownGet(e:KeyboardEvent){
if (level){
level.player.keyDownGet(e.keyCode);
level.player.keyIsDown = keyIsDown;
if (((level.ready) && (level.ready.tip))){
level.ready.play();
};
};
keyIsDown[e.keyCode] = true;
if (e.keyCode == 57){
debug();
};
}
public function loadComplete(event:Event):void{
kongregate = event.target.content;
kongregate.services.connect();
}
public function startLevel(){
level = new Level(selectedPlayer, selectedLevel);
addChild(level);
level.keyIsDown = keyIsDown;
if (((!(level.level.survival)) && (Global.vars.options[14]))){
stage.frameRate = 25;
};
}
function frame10(){
stop();
startLevel();
}
function frame3(){
newGame = loadGame();
lastPage = "mainMenu";
addEventListener(Event.ENTER_FRAME, BGM.loop);
if (!Global.vars.options[11]){
stage.quality = "low";
} else {
stage.quality = "high";
};
mouse = Global.vars.options[6];
startButton.addEventListener(MouseEvent.CLICK, function (e:Event=null){
(root as Main).fadeTo("mainMenu");
});
getChildByName("b1").addEventListener(MouseEvent.CLICK, function (e:Event=null){
navigateToURL(new URLRequest("http://www.kongregate.com/games/kupo707/epic-battle-fantasy/?gamereferral=bullet-heaven"), "_blank");
});
getChildByName("b2").addEventListener(MouseEvent.CLICK, function (e:Event=null){
navigateToURL(new URLRequest("http://www.kongregate.com/games/kupo707/epic-battle-fantasy-2/?gamereferral=bullet-heaven"), "_blank");
});
getChildByName("b3").addEventListener(MouseEvent.CLICK, function (e:Event=null){
navigateToURL(new URLRequest("http://www.kongregate.com/games/kupo707/epic-battle-fantasy-3/?gamereferral=bullet-heaven"), "_blank");
});
getChildByName("b4").addEventListener(MouseEvent.CLICK, function (e:Event=null){
navigateToURL(new URLRequest("http://www.kongregate.com/games/kupo707/mecha-dress-up-game/?gamereferral=bullet-heaven"), "_blank");
});
getChildByName("b5").addEventListener(MouseEvent.CLICK, function (e:Event=null){
navigateToURL(new URLRequest("http://www.kongregate.com/games/kupo707/the-kitten-game/?gamereferral=bullet-heaven"), "_blank");
});
getChildByName("b6").addEventListener(MouseEvent.CLICK, function (e:Event=null){
navigateToURL(new URLRequest("http://kupo707.deviantart.com/"), "_blank");
});
getChildByName("b7").addEventListener(MouseEvent.CLICK, function (e:Event=null){
navigateToURL(new URLRequest("http://www.facebook.com/pages/Epic-Battle-Fantasy-3/121491377896263"), "_blank");
});
getChildByName("b8").addEventListener(MouseEvent.CLICK, function (e:Event=null){
navigateToURL(new URLRequest("http://www.zazzle.com/kupo707*"), "_blank");
});
getChildByName("b9").addEventListener(MouseEvent.CLICK, function (e:Event=null){
navigateToURL(new URLRequest("http://www.facebook.com/pages/Halcyonic-Falcon-X/148298581863486"), "_blank");
});
}
public function upgradeMagnet(e:Event=null){
upgradePlayer(mm6, "magnetTree", "magnetLevel", 5);
}
public function upgradeDamage(e:Event=null){
upgradePlayer(mm4, "mainDamageTree", "mainDamageLevel", 3);
}
function frame8(){
getChildByName("b1").addEventListener(MouseEvent.CLICK, function (e:Event=null){
(root as Main).fadeTo(lastPage);
});
getChildByName("b2").addEventListener(MouseEvent.CLICK, function (e:Event=null){
(root as Main).fadeTo("levelSelect");
});
}
public function mouseDouble(){
trace("double click");
if (level){
level.player.keyDownGet(-2);
};
}
function frame1(){
paramObj = LoaderInfo(root.loaderInfo).parameters;
apiPath = ((paramObj.kongregate_api_path) || ("http://www.kongregate.com/flash/API_AS3_Local.swf"));
Security.allowDomain(apiPath);
request = new URLRequest(apiPath);
loader = new Loader();
loader.contentLoaderInfo.addEventListener(Event.COMPLETE, loadComplete);
loader.load(request);
this.addChild(loader);
myMenu = new ContextMenu();
myMenu.hideBuiltInItems();
moreGames = new ContextMenuItem("Sponsored by Kongregate");
moreGames2 = new ContextMenuItem("-> Play more Shooters");
moreGames3 = new ContextMenuItem("-> Play Matt's other games");
mattLink = new ContextMenuItem("Game by Matt Roszak");
mattLink2 = new ContextMenuItem("-> Follow him on Facebook");
mattLink3 = new ContextMenuItem("-> Follow him on DeviantArt");
musicLink = new ContextMenuItem("Music by Halcyonic Falcon X");
musicLink2 = new ContextMenuItem("-> Follow her on Facebook");
musicLink3 = new ContextMenuItem("-> Download the soundtrack");
mattLink.separatorBefore = true;
musicLink.separatorBefore = true;
moreGames.addEventListener(ContextMenuEvent.MENU_ITEM_SELECT, openLink);
moreGames2.addEventListener(ContextMenuEvent.MENU_ITEM_SELECT, openLink2);
moreGames3.addEventListener(ContextMenuEvent.MENU_ITEM_SELECT, openLink3);
mattLink2.addEventListener(ContextMenuEvent.MENU_ITEM_SELECT, openLink4);
mattLink3.addEventListener(ContextMenuEvent.MENU_ITEM_SELECT, openLink5);
musicLink2.addEventListener(ContextMenuEvent.MENU_ITEM_SELECT, openLink6);
musicLink3.addEventListener(ContextMenuEvent.MENU_ITEM_SELECT, openLink7);
myMenu.customItems.push(moreGames, moreGames2, moreGames3, mattLink, mattLink2, mattLink3, musicLink, musicLink2, musicLink3);
contextMenu = myMenu;
stop();
getChildByName("konglink").addEventListener(MouseEvent.CLICK, function (e:Event=null){
navigateToURL(new URLRequest("http://kongregate.com/?gamereferral=bullet-heaven"), "_blank");
});
allowed = "kongregate.";
domain = this.root.loaderInfo.url.split("/")[2];
adBox.visible = false;
if (domain.indexOf(allowed) >= 0){
} else {
adBox.visible = true;
CPMStarContentSpotID = "4235Q55C262F5";
ad = new AdLoader(CPMStarContentSpotID);
adBox.addChild(ad);
};
}
function frame5(){
BGM.play("menuMusic");
getChildByName("konglink").addEventListener(MouseEvent.CLICK, function (e:Event=null){
navigateToURL(new URLRequest("http://kongregate.com/?gamereferral=bullet-heaven"), "_blank");
});
lastPage = "levelSelect";
y = 0;
stage.frameRate = 30;
moneyT.text = String(money);
if ((((levelRanks[1] == 0)) || ((levelRanks[1] == undefined)))){
levelRanks[1] = 1;
};
selectLevel(selectedLevel);
selectPlayer(selectedPlayer);
j = 1;
while (j <= 25) {
levelbutton(("li" + j), j);
j++;
};
buttonize("p0", 1);
buttonize("p1", 2);
buttonize("p2", 3);
buttonize("p3", 4);
buttonize("p4", 5);
getChildByName("b1").addEventListener(MouseEvent.CLICK, function (e:Event=null){
(root as Main).fadeTo("mainMenu");
});
getChildByName("b2").addEventListener(MouseEvent.CLICK, function (e:Event=null){
(root as Main).fadeTo("upgrades");
});
getChildByName("b3").addEventListener(MouseEvent.CLICK, function (e:Event=null){
(root as Main).fadeTo("playLevel");
});
getChildByName("b4").addEventListener(MouseEvent.CLICK, function (e:Event=null){
(root as Main).fadeTo("instructions");
newGame = false;
});
getChildByName("b5").addEventListener(MouseEvent.CLICK, function (e:Event=null){
(root as Main).fadeTo("options");
});
getChildByName("b6").addEventListener(MouseEvent.CLICK, function (e:Event=null){
(root as Main).fadeTo("medals");
});
getChildByName("b7").addEventListener(MouseEvent.CLICK, function (e:Event=null){
(root as Main).fadeTo("credits");
});
}
function frame11(){
b = 1;
while (b < 18) {
tickenize("tick", b);
b++;
};
getChildByName("b1").addEventListener(MouseEvent.CLICK, function (e:Event=null){
(root as Main).fadeTo(lastPage);
});
getChildByName("delsel").addEventListener(MouseEvent.CLICK, function (e:Event=null){
(root as Main).deleteData();
});
}
function frame7(){
getChildByName("b1").addEventListener(MouseEvent.CLICK, function (e:Event=null){
(root as Main).fadeTo(lastPage);
});
MochiEvents.trackEvent("viewed credits");
getChildByName("b2").addEventListener(MouseEvent.CLICK, function (e:Event=null){
navigateToURL(new URLRequest("http://www.kongregate.com/games/kupo707/epic-battle-fantasy-2/?gamereferral=bullet-heaven"), "_blank");
});
getChildByName("b3").addEventListener(MouseEvent.CLICK, function (e:Event=null){
navigateToURL(new URLRequest("http://www.kongregate.com/games/kupo707/epic-battle-fantasy-3/?gamereferral=bullet-heaven"), "_blank");
});
getChildByName("b4").addEventListener(MouseEvent.CLICK, function (e:Event=null){
navigateToURL(new URLRequest("http://www.kongregate.com/games/kupo707/mecha-dress-up-game/?gamereferral=bullet-heaven"), "_blank");
});
getChildByName("b5").addEventListener(MouseEvent.CLICK, function (e:Event=null){
navigateToURL(new URLRequest("http://www.kongregate.com/games/kupo707/the-kitten-game/?gamereferral=bullet-heaven"), "_blank");
});
getChildByName("b6").addEventListener(MouseEvent.CLICK, function (e:Event=null){
navigateToURL(new URLRequest("http://kupo707.deviantart.com/"), "_blank");
});
getChildByName("b7").addEventListener(MouseEvent.CLICK, function (e:Event=null){
navigateToURL(new URLRequest("http://www.facebook.com/pages/Epic-Battle-Fantasy-3/121491377896263"), "_blank");
});
getChildByName("b8").addEventListener(MouseEvent.CLICK, function (e:Event=null){
navigateToURL(new URLRequest("http://halcyonicfalconx.newgrounds.com/news/post/579117"), "_blank");
});
getChildByName("b9").addEventListener(MouseEvent.CLICK, function (e:Event=null){
navigateToURL(new URLRequest("http://www.facebook.com/pages/Halcyonic-Falcon-X/148298581863486"), "_blank");
});
getChildByName("mu1").addEventListener(MouseEvent.CLICK, function (e:Event=null){
BGM.play("menuMusic");
});
getChildByName("mu2").addEventListener(MouseEvent.CLICK, function (e:Event=null){
BGM.play("starMusic");
});
getChildByName("mu3").addEventListener(MouseEvent.CLICK, function (e:Event=null){
BGM.play("waterMusic");
});
getChildByName("mu4").addEventListener(MouseEvent.CLICK, function (e:Event=null){
BGM.play("neverMusic");
});
getChildByName("mu5").addEventListener(MouseEvent.CLICK, function (e:Event=null){
BGM.play("spaceMusic");
});
getChildByName("mu6").addEventListener(MouseEvent.CLICK, function (e:Event=null){
BGM.play("bossMusic");
});
getChildByName("konglink").addEventListener(MouseEvent.CLICK, function (e:Event=null){
navigateToURL(new URLRequest("http://kongregate.com/?gamereferral=bullet-heaven"), "_blank");
});
}
public function buttonize(m:String, i:Number){
var mc:MovieClip;
var m = m;
var i = i;
mc = (getChildByName(m) as MovieClip);
if (playersUnlocked[(i - 1)]){
mc.icons.gotoAndStop(i);
mc.buttonMode = true;
mc.addEventListener(MouseEvent.MOUSE_DOWN, function (e:Event=null){
selectPlayer((i - 1));
mc.gotoAndStop(3);
saveGame();
});
mc.addEventListener(MouseEvent.ROLL_OVER, function (e:Event=null){
mc.gotoAndStop(2);
});
mc.addEventListener(MouseEvent.MOUSE_UP, function (e:Event=null){
mc.gotoAndStop(2);
});
mc.addEventListener(MouseEvent.ROLL_OUT, function (e:Event=null){
mc.gotoAndStop(1);
});
} else {
mc.icons.gotoAndStop(6);
};
}
function frame4(){
stop();
lastPage = "mainMenu";
BGM.play("menuMusic");
MochiEvents.trackEvent("viewed main menu");
sounds = new Sounds();
getChildByName("m1").addEventListener(MouseEvent.CLICK, function (e:Event=null){
if (newGame){
(root as Main).fadeTo("instructions");
newGame = false;
} else {
(root as Main).fadeTo("levelSelect");
};
});
getChildByName("m2").addEventListener(MouseEvent.CLICK, function (e:Event=null){
(root as Main).fadeTo("instructions");
newGame = false;
});
getChildByName("m3").addEventListener(MouseEvent.CLICK, function (e:Event=null){
(root as Main).fadeTo("options");
});
getChildByName("m4").addEventListener(MouseEvent.CLICK, function (e:Event=null){
(root as Main).fadeTo("medals");
});
getChildByName("m5").addEventListener(MouseEvent.CLICK, function (e:Event=null){
(root as Main).fadeTo("credits");
});
getChildByName("m6").addEventListener(MouseEvent.CLICK, function (e:Event=null){
navigateToURL(new URLRequest("http://kongregate.com/?gamereferral=bullet-heaven"), "_blank");
});
}
public function tickenize(m:String, b:int){
var mc:MovieClip;
var m = m;
var b = b;
mc = (getChildByName((m + b)) as MovieClip);
mc.buttonMode = true;
mc.addEventListener(MouseEvent.MOUSE_DOWN, function (e:Event=null){
toggleOption(mc, b);
mc.gotoAndStop(3);
saveGame();
});
mc.addEventListener(MouseEvent.ROLL_OVER, function (e:Event=null){
mc.gotoAndStop(2);
});
mc.addEventListener(MouseEvent.MOUSE_UP, function (e:Event=null){
mc.gotoAndStop(2);
});
mc.addEventListener(MouseEvent.ROLL_OUT, function (e:Event=null){
mc.gotoAndStop(1);
});
if (Global.vars.options[(b - 1)]){
mc.tick.nextFrame();
};
}
function frame9(){
a = 0;
icons = [];
ths = 0;
ii = 0;
while (ii < levelScores.length) {
if (levelScores[ii] != undefined){
ths = (ths + levelScores[ii]);
};
ii++;
};
totalhigh.text = ("" + ths);
kongregate.stats.submit("totalScore", ths);
getChildByName("b1").addEventListener(MouseEvent.CLICK, function (e:Event=null){
jj = 0;
while (jj < icons.length) {
removeChild(icons[jj]);
jj++;
};
(root as Main).fadeTo(lastPage);
});
for each (medal in Medals.medals) {
medalIconize(medal, a);
a++;
};
}
public function toggleOption(mc:MovieClip, b:int){
if (mc.tick.currentFrame == 1){
mc.tick.nextFrame();
Global.vars.options[(b - 1)] = true;
trace((("Option " + b) + " is on."));
} else {
if (mc.tick.currentFrame == 2){
mc.tick.prevFrame();
Global.vars.options[(b - 1)] = false;
trace((("Option " + b) + " is off."));
};
};
if (!Global.vars.options[11]){
stage.quality = "low";
} else {
stage.quality = "high";
};
mouse = Global.vars.options[6];
}
function frame6(){
maxedStats = 0;
showUpgrades();
(getChildByName("p0") as MovieClip).icons.gotoAndStop((selectedPlayer + 1));
getChildByName("b1").addEventListener(MouseEvent.CLICK, function (e:Event=null){
(root as Main).fadeTo("levelSelect");
});
if (getChildByName("u1")){
getChildByName("u1").addEventListener(MouseEvent.CLICK, upgradeHealth, false, 0, true);
};
if (getChildByName("u2")){
getChildByName("u2").addEventListener(MouseEvent.CLICK, upgradeMain, false, 0, true);
};
if (getChildByName("u3")){
getChildByName("u3").addEventListener(MouseEvent.CLICK, upgradeSub, false, 0, true);
};
if (getChildByName("u4")){
getChildByName("u4").addEventListener(MouseEvent.CLICK, upgradeDamage, false, 0, true);
};
if (getChildByName("u5")){
getChildByName("u5").addEventListener(MouseEvent.CLICK, upgradeSpeed, false, 0, true);
};
if (getChildByName("u6")){
getChildByName("u6").addEventListener(MouseEvent.CLICK, upgradeMagnet, false, 0, true);
};
if (getChildByName("u7")){
getChildByName("u7").addEventListener(MouseEvent.CLICK, upgradeBomb, false, 0, true);
};
for each (mcc in [e1, e2, e3, e4, e5, e6, e7]) {
mcc.mouseEnabled = false;
};
for each (mtt in [le1, le2, le3, le4, le5, le6, le7, mm1, mm2, mm3, mm4, mm5, mm6, mm7]) {
mtt.mouseEnabled = false;
};
upgraded.mouseEnabled = false;
}
public function resetUpgrades(){
trace("HAX: reset upgrades");
Player.healthLevel = 0;
Player.mainChargeLevel = 0;
Player.subChargeLevel = 0;
Player.speedLevel = 0;
Player.magnetLevel = 0;
Player.mainDamageLevel = 0;
Player.bombLevel = 0;
}
public function openLink(e:ContextMenuEvent):void{
navigateToURL(new URLRequest("http://www.kongregate.com/?gamereferral=bullet-heaven"));
}
function frame2(){
stop();
}
public function setFrameRate(r:int){
stage.frameRate = r;
}
public function retryLevel(){
Medals.level = undefined;
removeChild(level);
gotoAndStop(14);
gotoAndStop("playLevel");
stage.focus = stage;
}
public function unlockPlayers(){
trace("HAX: unlock players");
}
public function unlockLevels(){
trace("HAX: unlock levels");
levelRanks = [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1];
}
public function upgradeMain(e:Event=null){
upgradePlayer(mm2, "mainChargeTree", "mainChargeLevel", 1);
}
public function loadGame():Boolean{
var so:SharedObject;
trace("LOADING");
so = SharedObject.getLocal("EBF33save");
survivalWaves = so.data.survivalWaves;
survivalKills = so.data.survivalKills;
if (so.data.stats != undefined){
Medals.locks = so.data.medals;
Medals.stats = so.data.stats;
};
if (so.data.options != undefined){
Global.vars.options = so.data.options;
} else {
Global.vars.options = [true, true, true, true, true, true, true, false, false, false, false, true, false, false, false, false, false, false];
};
if (so.data.money != undefined){
trace("data loaded successfully");
money = so.data.money;
trace(so.data.selectedLevel);
trace(Boolean(so.data.selectedLevel));
if (so.data.selectedLevel != undefined){
selectedLevel = so.data.selectedLevel;
};
if (so.data.selectedPlayer != undefined){
selectedPlayer = so.data.selectedPlayer;
};
levelRanks = so.data.levelRanks;
playersUnlocked = so.data.playersUnlocked;
levelScores = so.data.levelScores;
loadPlayer("players.Player", so);
return (false);
};
money = 0;
trace("no data found");
return (true);
}
public function fadeTo(label:String){
trace(("fade to " + label));
MovieClip(fader).l = label;
MovieClip(fader).gotoAndPlay("fade");
}
public function mouseUp(e:Event){
keyIsDown[1] = false;
if (level){
level.player.keyIsDown = keyIsDown;
};
}
public function debug(){
}
public function lockLevels(){
trace("HAX: lock levels");
levelRanks = [0];
}
public function upgradeSub(e:Event=null){
upgradePlayer(mm3, "subChargeTree", "subChargeLevel", 2);
}
public function onConnectError(status:String):void{
}
public function savePlayer(playa:String, so:SharedObject){
var cla:Class;
cla = (getDefinitionByName(playa) as Class);
so.data[playa] = [cla.healthLevel, cla.mainChargeLevel, cla.subChargeLevel, cla.speedLevel, cla.magnetLevel, cla.mainDamageLevel, cla.bombLevel];
}
public function upgradeBomb(e:Event=null){
upgradePlayer(mm7, "bombTree", "bombLevel", 6);
}
public function mouseDown(e:Event){
t2 = getTimer();
if ((t2 - t1) < 600){
mouseDouble();
t2 = 0;
};
t1 = t2;
keyIsDown[1] = true;
if (level){
level.player.keyDownGet(-1);
level.player.keyIsDown = keyIsDown;
};
}
public function selectPlayer(p:Number){
selectedPlayer = p;
showPlayer.showPlayer.gotoAndStop(11);
showPlayer.showPlayer.gotoAndStop((p + 1));
showPlayer.gotoAndPlay(2);
playericon.icons.gotoAndStop((p + 1));
}
public function getMoney(){
trace("HAX: get money");
money = (money + 10000);
}
public function saveGame(){
var so:SharedObject;
trace("SAVING");
so = SharedObject.getLocal("EBF33save");
so.data.medals = Medals.locks;
so.data.stats = Medals.stats;
so.data.selectedLevel = selectedLevel;
so.data.selectedPlayer = selectedPlayer;
so.data.money = money;
so.data.survivalWaves = survivalWaves;
so.data.survivalKills = survivalKills;
so.data.levelRanks = levelRanks;
so.data.playersUnlocked = playersUnlocked;
so.data.levelScores = levelScores;
so.data.options = Global.vars.options;
savePlayer("players.Player", so);
so.flush();
}
public function medalIconize(medal:Object, a:int){
var mi:MovieClip;
var medal = medal;
var a = a;
mi = new MedalIcon();
addChild(mi);
icons[a] = mi;
mi.x = (((a % 8) * 58) + 62);
mi.y = (100 + (58 * Math.floor((a / 8))));
if (Medals.locks[a]){
mi.icon.gotoAndStop(medal.pic);
} else {
mi.icon.gotoAndStop(33);
};
mi.buttonMode = true;
mi.addEventListener(MouseEvent.MOUSE_DOWN, function (e:Event=null){
viewMedal(medal);
mi.gotoAndStop(3);
});
mi.addEventListener(MouseEvent.ROLL_OVER, function (e:Event=null){
mi.gotoAndStop(2);
});
mi.addEventListener(MouseEvent.MOUSE_UP, function (e:Event=null){
mi.gotoAndStop(2);
});
mi.addEventListener(MouseEvent.ROLL_OUT, function (e:Event=null){
mi.gotoAndStop(1);
});
}
public function unlockPlayer(p:int){
if (!playersUnlocked[p]){
playersUnlocked[p] = true;
playerUnlock = true;
saveGame();
};
}
public function openLink2(e:ContextMenuEvent):void{
navigateToURL(new URLRequest("http://www.kongregate.com/shooter-games/?gamereferral=bullet-heaven"));
}
public function openLink3(e:ContextMenuEvent):void{
navigateToURL(new URLRequest("http://www.kongregate.com/games/kupo707/?gamereferral=bullet-heaven"));
}
public function openLink4(e:ContextMenuEvent):void{
navigateToURL(new URLRequest("http://www.facebook.com/pages/Epic-Battle-Fantasy-3/121491377896263"));
}
public function openLink6(e:ContextMenuEvent):void{
navigateToURL(new URLRequest("http://www.facebook.com/pages/Halcyonic-Falcon-X/148298581863486"));
}
public function openLink7(e:ContextMenuEvent):void{
navigateToURL(new URLRequest("http://halcyonicfalconx.newgrounds.com/news/post/579117"));
}
public function openLink5(e:ContextMenuEvent):void{
navigateToURL(new URLRequest("http://kupo707.deviantart.com/"));
}
public function viewMedal(m:Object){
medalName.text = m.name;
medalDesc.text = m.desc;
}
public function loadPlayer(playa:String, so:SharedObject){
var cla:Class;
cla = (getDefinitionByName(playa) as Class);
cla.healthLevel = so.data[playa][0];
cla.mainChargeLevel = so.data[playa][1];
cla.subChargeLevel = so.data[playa][2];
cla.speedLevel = so.data[playa][3];
cla.magnetLevel = so.data[playa][4];
cla.mainDamageLevel = so.data[playa][5];
cla.bombLevel = so.data[playa][6];
}
public function upgradeSpeed(e:Event=null){
upgradePlayer(mm5, "speedTree", "speedLevel", 4);
}
public function upgradeHealth(e:Event=null){
upgradePlayer(mm1, "healthTree", "healthLevel", 0);
}
public function getPrice(t:TextField, a:Array, l:Number){
if (l >= (a.length - 1)){
maxedStats++;
if (maxedStats == 7){
Medals.unlockMedal("Max Power", medalBox);
};
t.text = "maxed";
Medals.unlockMedal("Power Up", medalBox);
return (true);
//unresolved jump
};
t.text = a[(l + 1)][1];
return (false);
}
public function keyUpGet(e:KeyboardEvent){
keyIsDown[e.keyCode] = false;
}
public function makeSound(s:String, t:String){
if (s == prevSound){
countSound++;
} else {
countSound = 0;
prevSound = s;
};
if ((((countSound < 3)) && ((((((((t == "p")) && (Global.vars.options[2]))) || ((((t == "f")) && (Global.vars.options[3]))))) || ((((t == "i")) && (Global.vars.options[4]))))))){
(sounds as MovieClip).gotoAndStop(s);
(sounds as MovieClip).gotoAndStop(1);
};
}
public function levelbutton(m:String, i:Number){
var mc:MovieClip;
var rc:MovieClip;
var m = m;
var i = i;
mc = (getChildByName(m) as MovieClip);
rc = (getChildByName(("r" + i)) as MovieClip);
if ((((((levelRanks[i] > 0)) || ((i <= 0)))) || ((i == 25)))){
rc.gotoAndStop(levelRanks[i]);
rc.scaleX = (rc.scaleX * 0.7);
rc.scaleY = (rc.scaleY * 0.7);
rc.y = (rc.y + 5);
mc.buttonMode = true;
mc.addEventListener(MouseEvent.MOUSE_DOWN, function (e:Event=null){
selectLevel(i);
mc.gotoAndStop(3);
saveGame();
});
mc.icons.gotoAndStop((i + 1));
mc.addEventListener(MouseEvent.ROLL_OVER, function (e:Event=null){
mc.gotoAndStop(2);
});
mc.addEventListener(MouseEvent.MOUSE_UP, function (e:Event=null){
mc.gotoAndStop(2);
});
mc.addEventListener(MouseEvent.ROLL_OUT, function (e:Event=null){
mc.gotoAndStop(1);
});
};
}
public function selectLevel(p:Number){
trace(("displaying level " + p));
selectedLevel = p;
showLevel.showLevel.gotoAndStop(30);
showLevel.showLevel.gotoAndStop(p);
if (levelScores[p] == undefined){
levelScores[p] = 0;
};
showLevel.gotoAndPlay(3);
levelicon.icons.gotoAndStop((p + 1));
}
public function showUpgrades(){
moneyT.text = String(money);
cla = (Player as Class);
maxedStats = 0;
if (((getPrice(mm1, cla.healthTree, cla.healthLevel)) && (getChildByName("u1")))){
removeChild(getChildByName("u1"));
};
if (((getPrice(mm2, cla.mainChargeTree, cla.mainChargeLevel)) && (getChildByName("u2")))){
removeChild(getChildByName("u2"));
};
if (((getPrice(mm3, cla.subChargeTree, cla.subChargeLevel)) && (getChildByName("u3")))){
removeChild(getChildByName("u3"));
};
if (((getPrice(mm4, cla.mainDamageTree, cla.mainDamageLevel)) && (getChildByName("u4")))){
removeChild(getChildByName("u4"));
};
if (((getPrice(mm5, cla.speedTree, cla.speedLevel)) && (getChildByName("u5")))){
removeChild(getChildByName("u5"));
};
if (((getPrice(mm6, cla.magnetTree, cla.magnetLevel)) && (getChildByName("u6")))){
removeChild(getChildByName("u6"));
};
if (((getPrice(mm7, cla.bombTree, cla.bombLevel)) && (getChildByName("u7")))){
removeChild(getChildByName("u7"));
};
s1.text = String(cla.healthTree[cla.healthLevel][0]);
s2.text = String(cla.mainChargeTree[cla.mainChargeLevel][0]);
s3.text = String(cla.subChargeTree[cla.subChargeLevel][0]);
s4.text = String(cla.mainDamageTree[cla.mainDamageLevel][0]);
s5.text = String(cla.speedTree[cla.speedLevel][0]);
s6.text = String(cla.magnetTree[cla.magnetLevel][0]);
le1.text = String(("Level " + cla.healthLevel));
le2.text = String(("Level " + cla.mainChargeLevel));
le3.text = String(("Level " + cla.subChargeLevel));
le4.text = String(("Level " + cla.mainDamageLevel));
le5.text = String(("Level " + cla.speedLevel));
le6.text = String(("Level " + cla.magnetLevel));
le7.text = String(("Level " + cla.bombLevel));
e1.gotoAndStop(11);
e2.gotoAndStop((selectedPlayer + 1));
e3.gotoAndStop((selectedPlayer + 6));
e4.gotoAndStop(12);
e5.gotoAndStop(13);
e6.gotoAndStop(14);
e7.gotoAndStop((selectedPlayer + 15));
}
}
}//package
Section 250
//MedalIcon (MedalIcon)
package {
import flash.display.*;
public dynamic class MedalIcon extends MovieClip {
public var icon:MovieClip;
public function MedalIcon(){
super();
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package
Section 251
//Medals (Medals)
package {
import levels.*;
import flash.display.*;
public class Medals {
public static var level:Level;
public static var locks:Array = [];
public static var current:int = 33;
public static var medals:Array = [{name:"Bronze Badge", desc:"Get A ranks in 5 or more levels.", pic:25}, {name:"Silver Badge", desc:"Get A ranks in 10 or more levels.", pic:26}, {name:"Gold Badge", desc:"Get A ranks in 15 or more levels.", pic:27}, {name:"Platinum Badge", desc:"Get A ranks in 20 or more levels.", pic:28}, {name:"Diamond Badge", desc:"Get A ranks in all 25 levels.", pic:29}, {name:"Pacifism", desc:"Reach wave 33 in Survival without killing anything.", pic:21}, {name:"Mass Murderer", desc:"Kill 1,000 foes in a single game of Survival.", pic:22}, {name:"Perfect Run", desc:"Beat any level between 16 and 20 without taking any damage.", pic:24}, {name:"Shooter", desc:"Kill 300 enemies in total.", pic:1}, {name:"Sniper", desc:"Kill 1000 enemies in total.", pic:2}, {name:"Killer", desc:"Kill 3000 enemies in total.", pic:3}, {name:"Slayer", desc:"Kill 10000 enemies in total.", pic:4}, {name:"Power Up", desc:"Fully upgrade any stat.", pic:19}, {name:"Max Power", desc:"Fully upgrade all stats", pic:17}, {name:"Shields On", desc:"Collect 100 power ups in total.", pic:18}, {name:"Punching Bag", desc:"Get hit 100 times in total.", pic:23}, {name:"Stars Everywhere", desc:"Play 10 levels as NoLegs.", pic:5}, {name:"I Like Swords", desc:"Play 10 levels as Matt.", pic:6}, {name:"Angel Wings", desc:"Play 10 levels as Natalie.", pic:7}, {name:"Pew Pew Pew", desc:"Play 10 levels as Lance.", pic:8}, {name:"Tree Hugger", desc:"Play 10 levels as Anna.", pic:9}, {name:"500k", desc:"Get a score of 500,000 in any level except survival.", pic:31}, {name:"Millionaire", desc:"Get a score of 1,000,000 in any level except survival.", pic:30}, {name:"Gold Farmer", desc:"Finish any level except Survival with over 3,000 coins.", pic:20}, {name:"Boom", desc:"Use a bomb for the first time.", pic:15}, {name:"Ultimate Blade", desc:"Kill 25 enemies instantly.", pic:14}, {name:"Bullet Hell", desc:"Die with over 666 enemy bullets on screen.", pic:11}, {name:"Counter Attack", desc:"Reflect over 100 bullets with a single shield.", pic:12}, {name:"Bullet Master", desc:"Complete all bonus levels.", pic:10}, {name:"The End", desc:"Defeat the final boss and complete the standard set of 20 levels.", pic:32}, {name:"Stray Bullets", desc:"Get killed with no enemies on screen.", pic:13}, {name:"3 Heart Challenge", desc:"Beat the first 20 levels without upgrading your health.", pic:16}];
public static var stats:Object = {kills:0, powerUps:0, damage:0, playerLevels:[0, 0, 0, 0, 0]};
public function Medals(){
super();
}
public static function unlockMedal(medal:String, box:MovieClip=null){
var a:int;
if (level){
level.unlockMedal(medal);
} else {
a = 0;
while (a < medals.length) {
if (medal == medals[a].name){
if (locks[a]){
trace(("Medal already unlocked: " + a));
} else {
locks[a] = true;
current = medals[a].pic;
box.gotoAndPlay(0);
trace(("Unlocking medal: " + a));
};
};
a++;
};
};
}
public static function unlockMedalNo(medal:Number){
if (level){
level.unlockMedalNo(medal);
};
}
}
}//package
Section 252
//menuMusic (menuMusic)
package {
import flash.media.*;
public dynamic class menuMusic extends Sound {
public function menuMusic(){
super();
}
}
}//package
Section 253
//PauseScreen (PauseScreen)
package {
import levels.*;
import flash.events.*;
import flash.display.*;
public class PauseScreen extends MovieClip {
public var tick2:MovieClip;
public var tick3:MovieClip;
public var tick5:MovieClip;
public var tick8:MovieClip;
public var tick9:MovieClip;
public var tick4:MovieClip;
public var tick1:MovieClip;
public var tick6:MovieClip;
public var menu:SimpleButton;
public var b:int;
public var tick7:MovieClip;
public var retry:SimpleButton;
public var tick12:MovieClip;
public function PauseScreen(){
super();
addFrameScript(0, frame1);
getChildByName("menu").addEventListener(MouseEvent.CLICK, function (e:Event=null){
(parent as Level).exitLevel();
});
getChildByName("retry").addEventListener(MouseEvent.CLICK, function (e:Event=null){
(parent as Level).retryLevel();
});
}
function frame1(){
b = 1;
while (b < 10) {
tickenize("tick", b);
b++;
};
tickenize("tick", 12);
}
public function tickenize(m:String, b:int){
var mc:MovieClip;
var m = m;
var b = b;
mc = (getChildByName((m + b)) as MovieClip);
mc.buttonMode = true;
mc.addEventListener(MouseEvent.MOUSE_DOWN, function (e:Event=null){
toggleOption(mc, b);
mc.gotoAndStop(3);
(root as Main).saveGame();
});
mc.addEventListener(MouseEvent.ROLL_OVER, function (e:Event=null){
mc.gotoAndStop(2);
});
mc.addEventListener(MouseEvent.MOUSE_UP, function (e:Event=null){
mc.gotoAndStop(2);
});
mc.addEventListener(MouseEvent.ROLL_OUT, function (e:Event=null){
mc.gotoAndStop(1);
});
if (Global.vars.options[(b - 1)]){
mc.tick.nextFrame();
};
}
public function toggleOption(mc:MovieClip, b:int){
if (mc.tick.currentFrame == 1){
mc.tick.nextFrame();
Global.vars.options[(b - 1)] = true;
trace((("Option " + b) + " is on."));
} else {
if (mc.tick.currentFrame == 2){
mc.tick.prevFrame();
Global.vars.options[(b - 1)] = false;
trace((("Option " + b) + " is off."));
};
};
if (!Global.vars.options[11]){
stage.quality = "low";
} else {
stage.quality = "high";
};
(root as Main).mouse = Global.vars.options[6];
(parent as Level).player.autoMain = Global.vars.options[7];
}
}
}//package
Section 254
//rainMusic (rainMusic)
package {
import flash.media.*;
public dynamic class rainMusic extends Sound {
public function rainMusic(){
super();
}
}
}//package
Section 255
//Shield (Shield)
package {
import flash.display.*;
public class Shield extends MovieClip {
public function Shield(){
super();
}
}
}//package
Section 256
//Sounds (Sounds)
package {
import flash.display.*;
public dynamic class Sounds extends MovieClip {
public function Sounds(){
super();
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package
Section 257
//spaceMusic (spaceMusic)
package {
import flash.media.*;
public dynamic class spaceMusic extends Sound {
public function spaceMusic(){
super();
}
}
}//package
Section 258
//starMusic (starMusic)
package {
import flash.media.*;
public dynamic class starMusic extends Sound {
public function starMusic(){
super();
}
}
}//package
Section 259
//waterMusic (waterMusic)
package {
import flash.media.*;
public dynamic class waterMusic extends Sound {
public function waterMusic(){
super();
}
}
}//package